Skip to content

Commit

Permalink
chore: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-aitlahcen committed Jan 16, 2023
1 parent ae0b10d commit 7d91248
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions code/parachain/frame/staking-rewards/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1629,20 +1629,23 @@ fn accumulate_pool_rewards<T: Config>(
Weight::from_ref_time(match reward_pool.start_block.cmp(&current_block) {
// start block < current -> accumulate normally
Ordering::Less =>
(&mut reward_pool.rewards).into_iter().fold(0u64, |mut acc, (asset_id, reward)| {
reward_accumulation_hook_reward_update_calculation::<T>(
pool_id,
*asset_id,
reward,
now_seconds,
);
(&mut reward_pool.rewards)
.into_iter()
.fold(0u64, |mut acc, (asset_id, reward)| {
reward_accumulation_hook_reward_update_calculation::<T>(
pool_id,
*asset_id,
reward,
now_seconds,
);

acc = acc.defensive_saturating_add(
T::WeightInfo::reward_accumulation_hook_reward_update_calculation().ref_time(),
);
acc = acc.defensive_saturating_add(
T::WeightInfo::reward_accumulation_hook_reward_update_calculation()
.ref_time(),
);

acc
}),
acc
}),
// start block == current -> accumulation starts now, but the effects won't be seen until
// the next block; set all of the reward's last updated timestamp to `now` so that reward
// accumulation starts from this point in time, not when the pool was created. Also notify
Expand Down

0 comments on commit 7d91248

Please sign in to comment.