Skip to content

Commit

Permalink
Modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Jan 5, 2024
1 parent 310b3b5 commit f85a646
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions pallets/dapp-staking-v3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ use astar_primitives::{
Balance, BlockNumber,
};

// TODO: remove this after rebase
use sp_std::collections::btree_map::BTreeMap;

pub use pallet::*;

#[cfg(test)]
Expand Down Expand Up @@ -1640,8 +1637,7 @@ pub mod pallet {
T::CycleConfiguration::blocks_per_era().saturating_mul(T::UnlockingPeriod::get().into())
}

// TODO: finish this after rebase/merge with latest pending updates
// Maybe define an interface for this.
/// Returns the dApp tier assignment for the current era, based on the current stake amounts.
pub fn get_dapp_tier_assignment() -> BTreeMap<DAppId, TierId> {
let protocol_state = ActiveProtocolState::<T>::get();

Expand All @@ -1651,17 +1647,7 @@ pub mod pallet {
Balance::zero(),
);

dapp_tiers
.dapps
.into_iter()
.filter_map(|dapp_tier| {
if let Some(tier_id) = dapp_tier.tier_id {
Some((dapp_tier.dapp_id, tier_id))
} else {
None
}
})
.collect()
dapp_tiers.dapps.into_inner()
}

/// Assign eligible dApps into appropriate tiers, and calculate reward for each tier.
Expand Down

0 comments on commit f85a646

Please sign in to comment.