Skip to content

Commit dd08535

Browse files
committed
Add totalStake to the MintedReward event
1 parent c2ed8ce commit dd08535

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

packages/pool/contracts/RewardUtils.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ abstract contract RewardUtils is GetterUtils, IRewardUtils {
3636
emit MintedReward(
3737
currentEpoch,
3838
rewardAmount,
39-
apr
39+
apr,
40+
totalStake
4041
);
4142
}
4243
epochIndexOfLastReward = currentEpoch;

packages/pool/contracts/interfaces/IRewardUtils.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ interface IRewardUtils is IGetterUtils {
77
event MintedReward(
88
uint256 indexed epochIndex,
99
uint256 amount,
10-
uint256 newApr
10+
uint256 newApr,
11+
uint256 totalStake
1112
);
1213

1314
function mintReward()

packages/pool/test/RewardUtils.sol.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe("mintReward", function () {
8989
.div(HUNDRED_PERCENT);
9090
await expect(api3Pool.connect(roles.randomPerson).mintReward())
9191
.to.emit(api3Pool, "MintedReward")
92-
.withArgs(nextEpoch, rewardAmount, newApr);
92+
.withArgs(nextEpoch, rewardAmount, newApr, totalStake.add(rewardAmount));
9393
expect(await api3Pool.totalStake()).to.equal(
9494
totalStake.add(rewardAmount)
9595
);
@@ -153,7 +153,7 @@ describe("mintReward", function () {
153153
.div(HUNDRED_PERCENT);
154154
await expect(api3Pool.connect(roles.randomPerson).mintReward())
155155
.to.emit(api3Pool, "MintedReward")
156-
.withArgs(nextEpoch, rewardAmount, newApr);
156+
.withArgs(nextEpoch, rewardAmount, newApr, totalStake.add(rewardAmount));
157157
expect(await api3Pool.totalStake()).to.equal(
158158
totalStake.add(rewardAmount)
159159
);
@@ -254,7 +254,7 @@ describe("mintReward", function () {
254254
.div(HUNDRED_PERCENT);
255255
await expect(api3Pool.connect(roles.randomPerson).mintReward())
256256
.to.emit(api3Pool, "MintedReward")
257-
.withArgs(genesisEpochPlusFive, rewardAmount, newApr);
257+
.withArgs(genesisEpochPlusFive, rewardAmount, newApr, totalStake.add(rewardAmount));
258258
expect(await api3Pool.totalStake()).to.equal(
259259
totalStake.add(rewardAmount)
260260
);

0 commit comments

Comments
 (0)