Skip to content

Commit

Permalink
ensure ti is updated at reward
Browse files Browse the repository at this point in the history
  • Loading branch information
Ank4n committed Sep 19, 2024
1 parent f0d2d14 commit 3ca1081
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions substrate/frame/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,16 @@ fn rewards_should_work() {
remainder: maximum_payout - total_payout_0
}
);

// make note of total issuance before rewards.
let total_issuance_0 = asset::total_issuance::<Test>();

mock::make_all_reward_payment(0);

// total issuance should have increased
let total_issuance_1 = asset::total_issuance::<Test>();
assert_eq!(total_issuance_1, total_issuance_0 + total_payout_0);

assert_eq_error_rate!(
asset::total_balance::<Test>(&11),
init_balance_11 + part_for_11 * total_payout_0 * 2 / 3,
Expand Down Expand Up @@ -402,6 +410,7 @@ fn rewards_should_work() {
);
mock::make_all_reward_payment(1);

assert_eq!(asset::total_issuance::<Test>(), total_issuance_1 + total_payout_1);
assert_eq_error_rate!(
asset::total_balance::<Test>(&11),
init_balance_11 + part_for_11 * (total_payout_0 * 2 / 3 + total_payout_1),
Expand Down

0 comments on commit 3ca1081

Please sign in to comment.