Skip to content

Commit

Permalink
feat: fix tests, remove unused initialize parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
kartojal committed Nov 16, 2021
1 parent 13b78bb commit fc0b5fd
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions contracts/incentives/StakedTokenIncentivesController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ contract StakedTokenIncentivesController is BaseIncentivesController {

/**
* @dev Initialize IStakedTokenIncentivesController
* @param addressesProvider the address of the corresponding addresses provider
**/
function initialize(address addressesProvider) external initializer {
function initialize() external initializer {
//approves the safety module to allow staking
IERC20(STAKE_TOKEN.STAKED_TOKEN()).safeApprove(address(STAKE_TOKEN), type(uint256).max);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const getRewardsBalanceScenarios: ScenarioAction[] = [
{
caseName: 'Accrued rewards are not 0',
emissionPerSecond: '2432424',
amountToClaim: '10',
amountToClaim: MAX_UINT_AMOUNT,
},
{
caseName: 'Should allow -1',
Expand Down
2 changes: 1 addition & 1 deletion test/PullRewardsIncentivesController/claim-rewards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const getRewardsBalanceScenarios: ScenarioAction[] = [
{
caseName: 'Accrued rewards are not 0',
emissionPerSecond: '2432424',
amountToClaim: '10',
amountToClaim: MAX_UINT_AMOUNT,
},
{
caseName: 'Should allow -1',
Expand Down
2 changes: 1 addition & 1 deletion test/PullRewardsIncentivesController/misc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ makeSuite('pullRewardsIncentivesController misc tests', (testEnv) => {

await expect(
pullRewardsIncentivesController.configureAssets([aDaiBaseMock.address], [MAX_UINT_AMOUNT])
).to.be.revertedWith('INVALID_CONFIGURATION');
).to.be.revertedWith('Index overflow at emissionsPerSecond');
});

it('Should REWARD_TOKEN getter returns the stake token address to keep old interface compatibility', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const getRewardsBalanceScenarios: ScenarioAction[] = [
{
caseName: 'Accrued rewards are not 0',
emissionPerSecond: '2432424',
amountToClaim: '10',
amountToClaim: MAX_UINT_AMOUNT,
},
{
caseName: 'Should allow -1',
Expand Down
2 changes: 1 addition & 1 deletion test/StakedIncentivesController/claim-rewards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const getRewardsBalanceScenarios: ScenarioAction[] = [
{
caseName: 'Accrued rewards are not 0',
emissionPerSecond: '2432424',
amountToClaim: '10',
amountToClaim: MAX_UINT_AMOUNT,
},
{
caseName: 'Should allow -1',
Expand Down
2 changes: 1 addition & 1 deletion test/StakedIncentivesController/initialize.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ makeSuite('AaveIncentivesController initialize', (testEnv: TestEnv) => {
// TODO: useless or not?
it('Tries to call initialize second time, should be reverted', async () => {
const { aaveIncentivesController } = testEnv;
await expect(aaveIncentivesController.initialize(ZERO_ADDRESS)).to.be.reverted;
await expect(aaveIncentivesController.initialize()).to.be.reverted;
});
it('allowance on aave token should be granted to psm contract for pei', async () => {
const { aaveIncentivesController, stakedAave, aaveToken } = testEnv;
Expand Down
2 changes: 1 addition & 1 deletion test/StakedIncentivesController/misc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ makeSuite('AaveIncentivesController misc tests', (testEnv) => {

await expect(
aaveIncentivesController.configureAssets([aDaiMock.address], [MAX_UINT_AMOUNT])
).to.be.revertedWith('INVALID_CONFIGURATION');
).to.be.revertedWith('Index overflow at emissionsPerSecond');
});

it('Should REWARD_TOKEN getter returns the stake token address to keep old interface compatibility', async () => {
Expand Down
4 changes: 1 addition & 3 deletions test/helpers/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ export const testDeployIncentivesController = async (
'18',
]
);
const incentivesInit = incentivesImplementation.interface.encodeFunctionData('initialize', [
ZERO_ADDRESS,
]);
const incentivesInit = incentivesImplementation.interface.encodeFunctionData('initialize');

await (
await stakeProxy['initialize(address,address,bytes)'](
Expand Down

0 comments on commit fc0b5fd

Please sign in to comment.