mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
pallet-sudo: Accept Root origin as valid sudo (#2783)
This changes `pallet-sudo` to also accept `Root` origin for `ensure_sudo`. This can be useful for parachains who allow the relay chain to have superuser rights to setup the sudo pallet for example.
This commit is contained in:
@@ -169,6 +169,18 @@ fn remove_key_works() {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn using_root_origin_works() {
|
||||
new_test_ext(1).execute_with(|| {
|
||||
assert_ok!(Sudo::remove_key(RuntimeOrigin::root()));
|
||||
assert!(Sudo::key().is_none());
|
||||
System::assert_has_event(TestEvent::Sudo(Event::KeyRemoved {}));
|
||||
|
||||
assert_ok!(Sudo::set_key(RuntimeOrigin::root(), 1));
|
||||
assert_eq!(Some(1), Sudo::key());
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sudo_as_basics() {
|
||||
new_test_ext(1).execute_with(|| {
|
||||
|
||||
Reference in New Issue
Block a user