Skip to content

Commit

Permalink
refactor: refactored casts, fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
The-3D committed Feb 28, 2022
1 parent 57e6906 commit eb76389
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions contracts/rewards/RewardsDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ abstract contract RewardsDistributor is IRewardsDistributor {

//optimization: storing one after another saves one SSTORE
rewardData.index = uint104(newIndex);
rewardData.lastUpdateTimestamp = uint32(block.timestamp);
rewardData.lastUpdateTimestamp = block.timestamp.toUint32();
} else {
rewardData.lastUpdateTimestamp = uint32(block.timestamp);
rewardData.lastUpdateTimestamp = block.timestamp.toUint32();
}

return (newIndex, indexUpdated);
Expand Down
2 changes: 1 addition & 1 deletion test/rewards/misc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ makeSuite('AaveIncentivesController misc tests', (testEnv) => {

await expect(
aDaiMockV2.doubleHandleActionOnAic(users[1].address, '2000', '100')
).to.be.revertedWith('Index overflow');
).to.be.revertedWith('INDEX_OVERFLOW');
});

it('Should claimRewards revert if to argument is ZERO_ADDRESS', async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/rewards/set-emission-per-second.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ makeSuite('AaveIncentivesController V2 setEmissionPerSecond', async (testEnv: Te
// Not existent Asset incentivization
await expect(
rewardsController.setEmissionPerSecond(ONE_ADDRESS, [ONE_ADDRESS], [2])
).to.be.revertedWith('DISTRIBUTION_NOT_EXISTS');
).to.be.revertedWith('DISTRIBUTION_DOES_NOT_EXIST');

// Not existent Reward distribution
await expect(
rewardsController.setEmissionPerSecond(aDaiMockV2.address, [ONE_ADDRESS], [2])
).to.be.revertedWith('DISTRIBUTION_NOT_EXISTS');
).to.be.revertedWith('DISTRIBUTION_DOES_NOT_EXIST');
});

it('EmissionManager updates the emission per second of distributions', async () => {
Expand Down

0 comments on commit eb76389

Please sign in to comment.