diff --git a/contracts/staking/contracts/src/staking_pools/MixinCumulativeRewards.sol b/contracts/staking/contracts/src/staking_pools/MixinCumulativeRewards.sol index 755f706ced..21368fc093 100644 --- a/contracts/staking/contracts/src/staking_pools/MixinCumulativeRewards.sol +++ b/contracts/staking/contracts/src/staking_pools/MixinCumulativeRewards.sol @@ -76,29 +76,8 @@ contract MixinCumulativeRewards is } // Update state to reflect the most recent cumulative reward - _forceSetMostRecentCumulativeRewardEpoch( - poolId, - currentMostRecentEpoch, - currentEpoch_ - ); - } - - /// @dev Forcefully sets the epoch of the most recent cumulative reward. - /// @param poolId Unique Id of pool. - /// @param currentMostRecentEpoch Epoch of the most recent cumulative - /// reward. - /// @param newMostRecentEpoch Epoch of the new most recent cumulative - /// reward. - function _forceSetMostRecentCumulativeRewardEpoch( - bytes32 poolId, - uint256 currentMostRecentEpoch, - uint256 newMostRecentEpoch - ) - internal - { - // Sanity check that we're not trying to go back in time - assert(newMostRecentEpoch >= currentMostRecentEpoch); - _cumulativeRewardsByPoolLastStored[poolId] = newMostRecentEpoch; + assert(currentEpoch_ > currentMostRecentEpoch); + _cumulativeRewardsByPoolLastStored[poolId] = currentEpoch_; } /// @dev Computes a member's reward over a given epoch interval. diff --git a/contracts/staking/contracts/test/TestCumulativeRewardTracking.sol b/contracts/staking/contracts/test/TestCumulativeRewardTracking.sol index a57f6c329e..8e74842989 100644 --- a/contracts/staking/contracts/test/TestCumulativeRewardTracking.sol +++ b/contracts/staking/contracts/test/TestCumulativeRewardTracking.sol @@ -30,11 +30,6 @@ contract TestCumulativeRewardTracking is uint256 epoch ); - event SetMostRecentCumulativeReward( - bytes32 poolId, - uint256 epoch - ); - constructor( address wethAddress, address zrxVaultAddress @@ -61,19 +56,4 @@ contract TestCumulativeRewardTracking is value ); } - - function _forceSetMostRecentCumulativeRewardEpoch( - bytes32 poolId, - uint256 currentMostRecentEpoch, - uint256 newMostRecentEpoch - ) - internal - { - emit SetMostRecentCumulativeReward(poolId, newMostRecentEpoch); - MixinCumulativeRewards._forceSetMostRecentCumulativeRewardEpoch( - poolId, - currentMostRecentEpoch, - newMostRecentEpoch - ); - } } diff --git a/contracts/staking/test/utils/cumulative_reward_tracking_simulation.ts b/contracts/staking/test/utils/cumulative_reward_tracking_simulation.ts index 516c0ffd31..675f079f25 100644 --- a/contracts/staking/test/utils/cumulative_reward_tracking_simulation.ts +++ b/contracts/staking/test/utils/cumulative_reward_tracking_simulation.ts @@ -36,12 +36,7 @@ export class CumulativeRewardTrackingSimulation { private static _extractTestLogs(txReceiptLogs: DecodedLogs): TestLog[] { const logs = []; for (const log of txReceiptLogs) { - if (log.event === TestCumulativeRewardTrackingEvents.SetMostRecentCumulativeReward) { - logs.push({ - event: log.event, - epoch: log.args.epoch.toNumber(), - }); - } else if (log.event === TestCumulativeRewardTrackingEvents.SetCumulativeReward) { + if (log.event === TestCumulativeRewardTrackingEvents.SetCumulativeReward) { logs.push({ event: log.event, epoch: log.args.epoch.toNumber(),