Skip to content

Commit 103a372

Browse files
authored
staking: when a rebate is claimed from a rebate pool also emit the number of outstanding settlements available (#185)
1 parent 29ffe15 commit 103a372

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

contracts/Staking.sol

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,16 @@ contract Staking is Governed {
124124
/**
125125
* @dev Emitted when `indexNode` claimed a rebate on `subgraphID` during `epoch`
126126
* related to the `forEpoch` rebate pool.
127-
* The rebate is equivalent to `tokens` amount.
127+
* The rebate is for `tokens` amount and an outstanding `settlements` count are
128+
* left for claim in the rebate pool.
128129
*/
129130
event RebateClaimed(
130131
address indexed indexNode,
131132
bytes32 indexed subgraphID,
132133
uint256 epoch,
133134
uint256 forEpoch,
134-
uint256 tokens
135+
uint256 tokens,
136+
uint256 settlements
135137
);
136138

137139
/**
@@ -419,7 +421,6 @@ contract Staking is Governed {
419421
// All settlements processed then prune rebate pool
420422
if (pool.settlementsCount == 0) {
421423
delete rebates[_epoch];
422-
// TODO: emit that a rebate pool was pruned (PoolSettled)
423424
}
424425

425426
// Assign claimed tokens
@@ -431,7 +432,14 @@ contract Staking is Governed {
431432
require(token.transfer(indexNode, tokensToClaim), "Rebate: cannot transfer tokens");
432433
}
433434

434-
emit RebateClaimed(indexNode, _subgraphID, currentEpoch, _epoch, tokensToClaim);
435+
emit RebateClaimed(
436+
indexNode,
437+
_subgraphID,
438+
currentEpoch,
439+
_epoch,
440+
tokensToClaim,
441+
pool.settlementsCount
442+
);
435443
}
436444

437445
/**

0 commit comments

Comments
 (0)