Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekkMA committed Sep 19, 2024
1 parent ecb2684 commit fff0c7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
11 changes: 8 additions & 3 deletions pallets/parachain-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: Config> =
StorageValue<_, InflationDistributionConfig<T::AccountId>, ValueQuery>;
pub(crate) type InflationDistributionInfo<T: Config> = StorageMap<
_,
Blake2_128Concat,
InflationDistributionConfigId,
InflationDistributionConfig<T::AccountId>,
ValueQuery,
>;

#[pallet::storage]
#[pallet::getter(fn round)]
Expand Down Expand Up @@ -787,7 +792,7 @@ pub mod pallet {
// Set collator commission to default config
<CollatorCommission<T>>::put(self.collator_commission);
// Set parachain bond config to default config
<InflationDistributionInfo<T>>::put(InflationDistributionConfig {
<InflationDistributionInfo<T>>::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"),
Expand Down
9 changes: 0 additions & 9 deletions pallets/parachain-staking/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1763,15 +1763,6 @@ pub struct InflationDistributionConfig<AccountId> {
/// Percent of inflation set aside for parachain bond account
pub percent: Percent,
}
impl<A: Decode> Default for InflationDistributionConfig<A> {
fn default() -> InflationDistributionConfig<A> {
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<Balance> {
Increase(Balance),
Expand Down

0 comments on commit fff0c7b

Please sign in to comment.