Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Add TODO for ED QoL at reward pool creation
Browse files Browse the repository at this point in the history
  • Loading branch information
emostov committed Mar 16, 2022
1 parent bde07d5 commit d739887
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frame/nomination-pools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,11 @@ pub mod pallet {
/// * `root` - The account to set as [`BondedPool::root`].
/// * `nominator` - The account to set as the [`BondedPool::nominator`].
/// * `state_toggler` - The account to set as the [`BondedPool::state_toggler`].
// TODO: The creator needs to transfer ED to the pool account and then have their delegators
// `reward_pool_total_earnings` ever set to the balance of the reward pool. This will make
// an invariant that the reward pool account will always have ED until destroyed.
// The reward pool balance and total earnings ever will also need to be updated to reflect
// that it has ED so the payout calculations work
#[pallet::weight(T::WeightInfo::create())]
#[frame_support::transactional]
pub fn create(
Expand All @@ -1391,6 +1396,7 @@ pub mod pallet {
);
ensure!(!Delegators::<T>::contains_key(&who), Error::<T>::AccountBelongsToOtherPool);

// TODO: transfer ED to reward pool and update reward pool total earnings and balance.
let pool_id = LastPoolId::<T>::mutate(|id| {
*id += 1;
*id
Expand Down

0 comments on commit d739887

Please sign in to comment.