Nomination pool configurations can be managed by custom origin (#3959)

closes https://github.com/paritytech/polkadot-sdk/issues/3894

Allows Nomination Pool configuration to be set by a custom origin
instead of root.

In runtimes, we would set this to be `StakingAdmin`, same as for
pallet-staking.

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
This commit is contained in:
Ankan
2024-04-09 12:14:19 +02:00
committed by GitHub
parent 6ce126a88d
commit 10ed76437f
9 changed files with 61 additions and 9 deletions
+5 -2
View File
@@ -1657,6 +1657,9 @@ pub mod pallet {
/// The maximum length, in bytes, that a pools metadata maybe.
type MaxMetadataLen: Get<u32>;
/// The origin that can manage pool configurations.
type AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>;
}
/// The sum of funds across all pools.
@@ -2495,7 +2498,7 @@ pub mod pallet {
}
/// Update configurations for the nomination pools. The origin for this call must be
/// Root.
/// [`Config::AdminOrigin`].
///
/// # Arguments
///
@@ -2516,7 +2519,7 @@ pub mod pallet {
max_members_per_pool: ConfigOp<u32>,
global_max_commission: ConfigOp<Perbill>,
) -> DispatchResult {
ensure_root(origin)?;
T::AdminOrigin::ensure_origin(origin)?;
macro_rules! config_op_exp {
($storage:ty, $op:ident) => {