diff --git a/pallets/subspace/src/global.rs b/pallets/subspace/src/global.rs index 79a3b234c..18425a72f 100644 --- a/pallets/subspace/src/global.rs +++ b/pallets/subspace/src/global.rs @@ -40,7 +40,10 @@ impl Pallet { // check if the name already exists ensure!(params.max_name_length > 0, Error::::InvalidMaxNameLength); - ensure!(params.min_delegation_fee.deconstruct() <= 100, Error::::InvalidMinDelegationFee); + ensure!( + params.min_delegation_fee.deconstruct() <= 100, + Error::::InvalidMinDelegationFee + ); ensure!( params.max_allowed_subnets > 0, diff --git a/pallets/subspace/src/lib.rs b/pallets/subspace/src/lib.rs index 54c93408f..36c3dabe2 100644 --- a/pallets/subspace/src/lib.rs +++ b/pallets/subspace/src/lib.rs @@ -242,8 +242,9 @@ pub mod pallet { Percent::from_percent(5u8) } - #[pallet::storage] - pub type MinDelegationFeeGlobal = StorageValue<_, Percent, ValueQuery, DefaultMinDelegationFeeGlobal>; + #[pallet::storage] + pub type MinDelegationFeeGlobal = + StorageValue<_, Percent, ValueQuery, DefaultMinDelegationFeeGlobal>; #[pallet::type_value] pub fn DefaultMinWeightStake() -> u64 { @@ -282,11 +283,11 @@ pub mod pallet { pub max_proposals: u64, // max number of proposals per block // mins - pub min_burn: u64, // min burn required - pub max_burn: u64, // max burn allowed - pub min_stake: u64, // min stake required + pub min_burn: u64, // min burn required + pub max_burn: u64, // max burn allowed + pub min_stake: u64, // min stake required pub min_delegation_fee: Percent, // min delegation fee - pub min_weight_stake: u64, // min weight stake required + pub min_weight_stake: u64, // min weight stake required // other pub target_registrations_per_interval: u16, // desired number of registrations per interval @@ -1170,7 +1171,8 @@ pub mod pallet { params.name = name; params.address = address; if let Some(delegation_fee) = delegation_fee { - ensure!(delegation_fee >= Self::get_min_deleg_fee_global(), + ensure!( + delegation_fee >= Self::get_min_deleg_fee_global(), Error::::InvalidMinDelegationFee ); params.delegation_fee = delegation_fee; diff --git a/pallets/subspace/src/staking.rs b/pallets/subspace/src/staking.rs index c84870656..f0bac902f 100644 --- a/pallets/subspace/src/staking.rs +++ b/pallets/subspace/src/staking.rs @@ -255,7 +255,7 @@ impl Pallet { pub fn get_delegation_fee(netuid: u16, module_key: &T::AccountId) -> Percent { let min_deleg_fee_global = Self::get_min_deleg_fee_global(); let delegation_fee = DelegationFee::::get(netuid, module_key); - + delegation_fee.max(min_deleg_fee_global) }