Skip to content

Commit

Permalink
style: run rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
aripiprazole committed Mar 9, 2024
1 parent 46d909f commit 87f4cfb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
5 changes: 4 additions & 1 deletion pallets/subspace/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ impl<T: Config> Pallet<T> {
// check if the name already exists
ensure!(params.max_name_length > 0, Error::<T>::InvalidMaxNameLength);

ensure!(params.min_delegation_fee.deconstruct() <= 100, Error::<T>::InvalidMinDelegationFee);
ensure!(
params.min_delegation_fee.deconstruct() <= 100,
Error::<T>::InvalidMinDelegationFee
);

ensure!(
params.max_allowed_subnets > 0,
Expand Down
16 changes: 9 additions & 7 deletions pallets/subspace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ pub mod pallet {
Percent::from_percent(5u8)
}

#[pallet::storage]
pub type MinDelegationFeeGlobal<T> = StorageValue<_, Percent, ValueQuery, DefaultMinDelegationFeeGlobal<T>>;
#[pallet::storage]
pub type MinDelegationFeeGlobal<T> =
StorageValue<_, Percent, ValueQuery, DefaultMinDelegationFeeGlobal<T>>;

#[pallet::type_value]
pub fn DefaultMinWeightStake<T: Config>() -> u64 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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::<T>::InvalidMinDelegationFee
);
params.delegation_fee = delegation_fee;
Expand Down
2 changes: 1 addition & 1 deletion pallets/subspace/src/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ impl<T: Config> Pallet<T> {
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::<T>::get(netuid, module_key);

delegation_fee.max(min_deleg_fee_global)
}

Expand Down

0 comments on commit 87f4cfb

Please sign in to comment.