Skip to content

Commit

Permalink
Fix staking reward smoke test for old runtimes (<2801): always use ma…
Browse files Browse the repository at this point in the history
…x inflation (#2731)

* always use max inflation

* fix lint error

---------

Co-authored-by: Andrea Giacobino <no.andrea@gmail.com>
  • Loading branch information
librelois and noandrea authored Apr 4, 2024
1 parent d204b79 commit 8565649
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/suites/smoke/test-staking-rewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,6 @@ describeSuite({
// calculate reward amounts
const parachainBondInfo = await apiAtPriorRewarded.query.parachainStaking.parachainBondInfo();
const parachainBondPercent = new Percent(parachainBondInfo.percent);
const totalStaked = await apiAtPriorRewarded.query.parachainStaking.totalSelected();
const totalPoints = await apiAtPriorRewarded.query.parachainStaking.points(
originalRoundNumber
);
Expand Down Expand Up @@ -541,11 +540,10 @@ describeSuite({

totalRoundIssuance = roundDuration.mul(idealIssuance).div(idealDuration);
} else {
totalRoundIssuance = totalStaked.lt(inflation.expect.min)
? range.min
: totalStaked.gt(inflation.expect.max)
? range.max
: range.ideal;
// Always apply max inflation
// It work because the total staked amound is already 1000 times more than the max on
// production, so it's very unlikely to change before RT2801 deployment on moonbeam
totalRoundIssuance = range.max;
}

const totalCollatorCommissionReward = new Perbill(collatorCommissionRate).of(
Expand Down

0 comments on commit 8565649

Please sign in to comment.