-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authorize upgrade tests for testnet runtimes + execute_as_governance
refactor
#7656
Conversation
/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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
Weight::zero(), | ||
) | ||
} | ||
} | ||
|
||
/// Enum representing governance origin/location. | ||
#[derive(Clone)] | ||
pub enum GovernanceOrigin<RuntimeOrigin> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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_upgrade
to all SP testnets.TODO
RuntimeHelper::<Runtime>::execute_as_governance
(because it is using hard-codedLocation::parent()
) to useRuntimeHelper::<Runtime>::execute_as_governance_call
Follow-up
ClearOrigin
before all side-effect sent to different chain