From f8a1b8b7965e2105e7fa61d18579648ffd167274 Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Wed, 27 Nov 2024 01:29:35 +0800 Subject: [PATCH] Update whitelist origin --- runtime/crab/src/pallets/governance.rs | 17 ++++++++++++++++- runtime/darwinia/src/pallets/governance.rs | 17 ++++++++++++++++- runtime/koi/src/pallets/governance.rs | 6 ++++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/runtime/crab/src/pallets/governance.rs b/runtime/crab/src/pallets/governance.rs index 50814a563..d0285753e 100644 --- a/runtime/crab/src/pallets/governance.rs +++ b/runtime/crab/src/pallets/governance.rs @@ -74,10 +74,25 @@ impl pallet_referenda::Config for Runtime { impl custom_origins::Config for Runtime {} +frame_support::ord_parameter_types! { + // 0x663fC3000f0101BF16FDc9F73F02DA6Efa8c5875. + pub const DispatchWhitelistedDao: AccountId = AccountId::from([ + 102, 63, 195, 0, 15, 1, 1, 191, 22, 253, 201, 247, 63, 2, 218, 110, 250, 140, 88, 117, + ]); +} + // The purpose of this pallet is to queue calls to be dispatched as by root later => the Dispatch // origin corresponds to the Gov2 Whitelist track. impl pallet_whitelist::Config for Runtime { - type DispatchWhitelistedOrigin = RootOr; + #[cfg(feature = "runtime-benchmarks")] + type DispatchWhitelistedOrigin = Root; + #[cfg(not(feature = "runtime-benchmarks"))] + type DispatchWhitelistedOrigin = RootOrDiverse< + frame_support::traits::EitherOfDiverse< + WhitelistedCaller, + frame_system::EnsureSignedBy, + >, + >; type Preimages = Preimage; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; diff --git a/runtime/darwinia/src/pallets/governance.rs b/runtime/darwinia/src/pallets/governance.rs index 3c79cd3e5..6057f4376 100644 --- a/runtime/darwinia/src/pallets/governance.rs +++ b/runtime/darwinia/src/pallets/governance.rs @@ -74,10 +74,25 @@ impl pallet_referenda::Config for Runtime { impl custom_origins::Config for Runtime {} +frame_support::ord_parameter_types! { + // 0x4DCf0f14cC58fc2Bf313e70573dDB7309523bb23. + pub const DispatchWhitelistedDao: AccountId = AccountId::from([ + 77, 207, 15, 20, 204, 88, 252, 43, 243, 19, 231, 5, 115, 221, 183, 48, 149, 35, 187, 35, + ]); +} + // The purpose of this pallet is to queue calls to be dispatched as by root later => the Dispatch // origin corresponds to the Gov2 Whitelist track. impl pallet_whitelist::Config for Runtime { - type DispatchWhitelistedOrigin = RootOr; + #[cfg(feature = "runtime-benchmarks")] + type DispatchWhitelistedOrigin = Root; + #[cfg(not(feature = "runtime-benchmarks"))] + type DispatchWhitelistedOrigin = RootOrDiverse< + frame_support::traits::EitherOfDiverse< + WhitelistedCaller, + frame_system::EnsureSignedBy, + >, + >; type Preimages = Preimage; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; diff --git a/runtime/koi/src/pallets/governance.rs b/runtime/koi/src/pallets/governance.rs index 777f8588c..89e6ca30b 100644 --- a/runtime/koi/src/pallets/governance.rs +++ b/runtime/koi/src/pallets/governance.rs @@ -82,7 +82,9 @@ impl custom_origins::Config for Runtime {} frame_support::ord_parameter_types! { // 0x005493b5658e6201F06FE2adF492610635505F4C. - pub const RingDaoAccount: AccountId = AccountId::from([0, 84, 147, 181, 101, 142, 98, 1, 240, 111, 226, 173, 244, 146, 97, 6, 53, 80, 95, 76]); + pub const DispatchWhitelistedDao: AccountId = AccountId::from([ + 0, 84, 147, 181, 101, 142, 98, 1, 240, 111, 226, 173, 244, 146, 97, 6, 53, 80, 95, 76 + ]); } // The purpose of this pallet is to queue calls to be dispatched as by root later => the Dispatch @@ -94,7 +96,7 @@ impl pallet_whitelist::Config for Runtime { type DispatchWhitelistedOrigin = RootOrDiverse< frame_support::traits::EitherOfDiverse< WhitelistedCaller, - frame_system::EnsureSignedBy, + frame_system::EnsureSignedBy, >, >; type Preimages = Preimage;