-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
frame/staking/src/tests.rs
Outdated
@@ -3363,10 +3378,13 @@ fn test_payout_stakers() { | |||
Staking::reward_by_ids(vec![(11, 1)]); | |||
|
|||
// compute and ensure the reward amount is greater than zero. | |||
let _ = current_total_payout_for_duration(reward_time_per_era()); | |||
let payout = current_total_payout_for_duration(reward_time_per_era()); | |||
let actual_paid_out = payout_exposure_part.mul_ceil(payout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why only .mul_ceil
worked here; .mul
ends up being 1 less which I don't understand because we use normal multiplication here:
substrate/frame/staking/src/pallet/impls.rs
Lines 186 to 187 in f72fe05
let nominator_reward: BalanceOf<T> = | |
nominator_exposure_part * validator_leftover_payout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel we should figure this out before we merge :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me as long as the default behavior can be preserved.
ping. |
bot rebase |
Rebasing |
bot merge |
Waiting for commit status. |
Merge cancelled due to error. Error: Statuses failed for c07685a |
bot merge |
* staking: Fix `Reward` usage * Some small fixes * Check on_unbalanced was called * Improve tests * Add not for Reward; FMT * 🤦 Co-authored-by: parity-processbot <>
* staking: Fix `Reward` usage * Some small fixes * Check on_unbalanced was called * Improve tests * Add not for Reward; FMT * 🤦 Co-authored-by: parity-processbot <>
* staking: Fix `Reward` usage * Some small fixes * Check on_unbalanced was called * Improve tests * Add not for Reward; FMT * 🤦 Co-authored-by: parity-processbot <>
Supersedes: #10885