From fff0c7b2c117a9bb2f47148c002bc1519ca4fc2b Mon Sep 17 00:00:00 2001 From: Tarek Mohamed Abdalla Date: Thu, 19 Sep 2024 07:50:07 +0000 Subject: [PATCH] . --- pallets/parachain-staking/src/lib.rs | 11 ++++++++--- pallets/parachain-staking/src/types.rs | 9 --------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pallets/parachain-staking/src/lib.rs b/pallets/parachain-staking/src/lib.rs index 516ecb3149..b150cb904d 100644 --- a/pallets/parachain-staking/src/lib.rs +++ b/pallets/parachain-staking/src/lib.rs @@ -520,8 +520,13 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn inflation_distribution_info)] /// Parachain bond config info { account, percent_of_inflation } - pub(crate) type InflationDistributionInfo = - StorageValue<_, InflationDistributionConfig, ValueQuery>; + pub(crate) type InflationDistributionInfo = StorageMap< + _, + Blake2_128Concat, + InflationDistributionConfigId, + InflationDistributionConfig, + ValueQuery, + >; #[pallet::storage] #[pallet::getter(fn round)] @@ -787,7 +792,7 @@ pub mod pallet { // Set collator commission to default config >::put(self.collator_commission); // Set parachain bond config to default config - >::put(InflationDistributionConfig { + >::put(InflationDistributionConfigId::ParachainBondReserve,InflationDistributionConfig { // must be set soon; if not => due inflation will be sent to collators/delegators account: T::AccountId::decode(&mut sp_runtime::traits::TrailingZeroInput::zeroes()) .expect("infinite length input; no invalid inputs for type; qed"), diff --git a/pallets/parachain-staking/src/types.rs b/pallets/parachain-staking/src/types.rs index 7afa757c51..d3b0a149bd 100644 --- a/pallets/parachain-staking/src/types.rs +++ b/pallets/parachain-staking/src/types.rs @@ -1763,15 +1763,6 @@ pub struct InflationDistributionConfig { /// Percent of inflation set aside for parachain bond account pub percent: Percent, } -impl Default for InflationDistributionConfig { - fn default() -> InflationDistributionConfig { - InflationDistributionConfig { - account: A::decode(&mut sp_runtime::traits::TrailingZeroInput::zeroes()) - .expect("infinite length input; no invalid inputs for type; qed"), - percent: Percent::zero(), - } - } -} pub enum BondAdjust { Increase(Balance),