Authorize upgrade tests for testnet runtimes + execute_as_governance refactor#7656
Authorize upgrade tests for testnet runtimes + execute_as_governance refactor#7656
execute_as_governance refactor#7656Conversation
|
/cmd prdoc --audience runtime_dev --bump patch |
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
|
/cmd fmt |
execute_as_governance refactor
|
/cmd prdoc --audience runtime_dev --bump patch |
|
Command "prdoc --audience runtime_dev --bump patch" has failed ❌! See logs here |
|
/cmd prdoc --audience runtime_dev --bump patch --force |
…ump patch --force'
| parachains_runtimes_test_utils::test_cases::can_governance_authorize_upgrade::< | ||
| Runtime, | ||
| RuntimeOrigin, | ||
| >(GovernanceOrigin::Location(Location::new(1, Parachain(ASSET_HUB_ID)))), |
There was a problem hiding this comment.
just minor comment: maybe it would be good idea to reuse existing config parameter AssetHubLocation, so for example GovernanceOrigin::Location(AssetHubLocation::get())
There was a problem hiding this comment.
@karolk91 hmm, good point, I didn't realize this, I just copy this test to all runtimes, I didn't realize that AssetHubLocation exists for some runtimes. The idea here is that now assert_err for AssetHub now, but within AHM, this assert_err should fail and should be changed to assert_ok, because the governance will be moved also to the AH.
I would suggest to replace Location::new(1, Parachain(ASSET_HUB_ID) with AssetHubLocation::get() later when we will come to this:
#7626
#7623
#7566
|
|
||
| /// Enum representing governance origin/location. | ||
| #[derive(Clone)] | ||
| pub enum GovernanceOrigin<RuntimeOrigin> { |
There was a problem hiding this comment.
please ignore if it doesn't make sense, asking more for a learning purpose - I was wondering if RuntimeOrigin isn't already a type that encompasses various origins like Xcm, System/signed ? And if you could just use RuntimeOrigin instead of wrapping different possibilites into enum
There was a problem hiding this comment.
RuntimeOrigin here is just a generic type; it could also be simply RO or O or OriginWhateverName.
The actual RuntimeOrigin is provided at the runtime level, e.g., coretime_westend_runtime::RuntimeOrigin. This real type is constructed by the construct_runtime! macro from all the configured origins (as you said) defined in the runtime.
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-7656-to-stable2407
git worktree add --checkout .worktree/backport-7656-to-stable2407 backport-7656-to-stable2407
cd .worktree/backport-7656-to-stable2407
git reset --hard HEAD^
git cherry-pick -x e9be92d66f6b61c5cfbd2b56456e2205b478b04c
git push --force-with-lease |
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-7656-to-stable2409
git worktree add --checkout .worktree/backport-7656-to-stable2409 backport-7656-to-stable2409
cd .worktree/backport-7656-to-stable2409
git reset --hard HEAD^
git cherry-pick -x e9be92d66f6b61c5cfbd2b56456e2205b478b04c
git push --force-with-lease |
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-7656-to-stable2412
git worktree add --checkout .worktree/backport-7656-to-stable2412 backport-7656-to-stable2412
cd .worktree/backport-7656-to-stable2412
git reset --hard HEAD^
git cherry-pick -x e9be92d66f6b61c5cfbd2b56456e2205b478b04c
git push --force-with-lease |
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-7656-to-stable2503
git worktree add --checkout .worktree/backport-7656-to-stable2503 backport-7656-to-stable2503
cd .worktree/backport-7656-to-stable2503
git reset --hard HEAD^
git cherry-pick -x e9be92d66f6b61c5cfbd2b56456e2205b478b04c
git push --force-with-lease |
…` refactor (#7656) Relates to: #7541 Relates to: #7566 This PR contains improved test cases that rely on the governance location as preparation for AHM to capture the state as it is. It introduces `execute_as_governance_call`, which can be configured with various governance location setups instead of the hard-coded `Location::parent()`. Additionally, it adds a test for `authorize_upgrade` to all SP testnets. ## TODO - [x] rewrite all tests using `RuntimeHelper::<Runtime>::execute_as_governance` (because it is using hard-coded `Location::parent()`) to use `RuntimeHelper::<Runtime>::execute_as_governance_call` ## Follow-up - [ ] add similar test for westend-runtime - [ ] add test that ensure xcm-executor adds `ClearOrigin` before all side-effect sent to different chain --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> (cherry picked from commit e9be92d) # Conflicts: # cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/tests/tests.rs
Backport #7656 into `stable2503` from bkontur. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Relates to: #7541
Relates to: #7566
This PR contains improved test cases that rely on the governance location as preparation for AHM to capture the state as it is.
It introduces
execute_as_governance_call, which can be configured with various governance location setups instead of the hard-codedLocation::parent().Additionally, it adds a test for
authorize_upgradeto all SP testnets.TODO
RuntimeHelper::<Runtime>::execute_as_governance(because it is using hard-codedLocation::parent()) to useRuntimeHelper::<Runtime>::execute_as_governance_callFollow-up
ClearOriginbefore all side-effect sent to different chain