Skip to content

Commit

Permalink
Fix issue 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Moliholy committed Dec 6, 2024
1 parent 85b4aca commit ae72b53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1667,8 +1667,8 @@ pub mod pallet {
log::warn!("Cannot reward collator {:?} for producing more blocks than rewardable ones", collator);
break;
}
let rewards_all: BalanceOf<T> =
total_rewards.saturating_mul(blocks.into()) / rewardable_blocks.into();
let ratio = Perbill::from_rational(blocks, rewardable_blocks);
let rewards_all = ratio * total_rewards;
let collator_only_reward = collator_percentage.mul_floor(rewards_all);
// Reward collator. Note these rewards are not autocompounded.
if let Err(error) = Self::do_reward_single(&collator, collator_only_reward)
Expand Down

0 comments on commit ae72b53

Please sign in to comment.