Skip to content

Commit

Permalink
Update whitelist origin
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav committed Nov 26, 2024
1 parent e1d63c0 commit f8a1b8b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
17 changes: 16 additions & 1 deletion runtime/crab/src/pallets/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<WhitelistedCaller>;
#[cfg(feature = "runtime-benchmarks")]
type DispatchWhitelistedOrigin = Root;
#[cfg(not(feature = "runtime-benchmarks"))]
type DispatchWhitelistedOrigin = RootOrDiverse<
frame_support::traits::EitherOfDiverse<
WhitelistedCaller,
frame_system::EnsureSignedBy<DispatchWhitelistedDao, Self::AccountId>,
>,
>;
type Preimages = Preimage;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
Expand Down
17 changes: 16 additions & 1 deletion runtime/darwinia/src/pallets/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<WhitelistedCaller>;
#[cfg(feature = "runtime-benchmarks")]
type DispatchWhitelistedOrigin = Root;
#[cfg(not(feature = "runtime-benchmarks"))]
type DispatchWhitelistedOrigin = RootOrDiverse<
frame_support::traits::EitherOfDiverse<
WhitelistedCaller,
frame_system::EnsureSignedBy<DispatchWhitelistedDao, Self::AccountId>,
>,
>;
type Preimages = Preimage;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
Expand Down
6 changes: 4 additions & 2 deletions runtime/koi/src/pallets/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -94,7 +96,7 @@ impl pallet_whitelist::Config for Runtime {
type DispatchWhitelistedOrigin = RootOrDiverse<
frame_support::traits::EitherOfDiverse<
WhitelistedCaller,
frame_system::EnsureSignedBy<RingDaoAccount, Self::AccountId>,
frame_system::EnsureSignedBy<DispatchWhitelistedDao, Self::AccountId>,
>,
>;
type Preimages = Preimage;
Expand Down

0 comments on commit f8a1b8b

Please sign in to comment.