mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 22:51:03 +00:00
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:
@@ -17,8 +17,11 @@
|
||||
|
||||
use super::*;
|
||||
use crate::{self as pools};
|
||||
use frame_support::{assert_ok, derive_impl, parameter_types, traits::fungible::Mutate, PalletId};
|
||||
use frame_system::RawOrigin;
|
||||
use frame_support::{
|
||||
assert_ok, derive_impl, ord_parameter_types, parameter_types, traits::fungible::Mutate,
|
||||
PalletId,
|
||||
};
|
||||
use frame_system::{EnsureSignedBy, RawOrigin};
|
||||
use sp_runtime::{BuildStorage, FixedU128};
|
||||
use sp_staking::{OnStakingUpdate, Stake};
|
||||
|
||||
@@ -289,6 +292,11 @@ parameter_types! {
|
||||
pub static CheckLevel: u8 = 255;
|
||||
pub const PoolsPalletId: PalletId = PalletId(*b"py/nopls");
|
||||
}
|
||||
|
||||
ord_parameter_types! {
|
||||
pub const Admin: u128 = 42;
|
||||
}
|
||||
|
||||
impl pools::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WeightInfo = ();
|
||||
@@ -303,6 +311,7 @@ impl pools::Config for Runtime {
|
||||
type MaxMetadataLen = MaxMetadataLen;
|
||||
type MaxUnbonding = MaxUnbonding;
|
||||
type MaxPointsToBalance = frame_support::traits::ConstU8<10>;
|
||||
type AdminOrigin = EnsureSignedBy<Admin, AccountId>;
|
||||
}
|
||||
|
||||
type Block = frame_system::mocking::MockBlock<Runtime>;
|
||||
|
||||
Reference in New Issue
Block a user