Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanzhelyazkov committed Aug 23, 2024
1 parent 4f24fce commit d119ac2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deploy/tests/network/0002-voucher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describeDeployment(__filename, () => {

it('cannot call postUpgrade on voucher', async () => {
// hardcoding gas limit to avoid gas estimation attempts (which get rejected instead of reverted)
const tx = await voucher.postUpgrade('0x', { gasLimit: 6000000 });
const tx = await voucher.postUpgrade(false, '0x', { gasLimit: 6000000 });
await expect(tx.wait()).to.be.reverted;
});
});
2 changes: 1 addition & 1 deletion deploy/tests/network/0003-carbon-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describeDeployment(__filename, () => {

it('cannot call postUpgrade on carbon controller', async () => {
// hardcoding gas limit to avoid gas estimation attempts (which get rejected instead of reverted)
const tx = await carbonController.postUpgrade('0x', { gasLimit: 6000000 });
const tx = await carbonController.postUpgrade(false, '0x', { gasLimit: 6000000 });
await expect(tx.wait()).to.be.reverted;
});
});
10 changes: 5 additions & 5 deletions test/utility/Upgradeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ describe('Upgradeable', () => {
});

it('should allow executing the post-upgrade callback', async () => {
await expect(upgradeable.postUpgrade([])).not.to.be.reverted;
await expect(upgradeable.postUpgrade(true, [])).not.to.be.reverted;

await upgradeable.setVersion((await upgradeable.version()) + 1);

await expect(upgradeable.postUpgrade([])).not.to.be.reverted;
await expect(upgradeable.postUpgrade(true, [])).not.to.be.reverted;
});

it('should not allow executing the post-upgrade callback twice per-version', async () => {
await expect(upgradeable.postUpgrade([])).not.to.be.reverted;
await expect(upgradeable.postUpgrade([])).to.be.revertedWithError('AlreadyInitialized');
await expect(upgradeable.postUpgrade(true, [])).not.to.be.reverted;
await expect(upgradeable.postUpgrade(true, [])).to.be.revertedWithError('AlreadyInitialized');
});
});

Expand All @@ -73,7 +73,7 @@ describe('Upgradeable', () => {
});

it('should revert when attempting to execute the post-upgrade callback', async () => {
await expect(upgradeable.postUpgrade([])).to.be.revertedWithError('AlreadyInitialized');
await expect(upgradeable.postUpgrade(true, [])).to.be.revertedWithError('AlreadyInitialized');
});
}
});
Expand Down

0 comments on commit d119ac2

Please sign in to comment.