Replace revert strings with custom errors (#4261)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
const { BN, expectRevert } = require('@openzeppelin/test-helpers');
|
||||
const { BN } = require('@openzeppelin/test-helpers');
|
||||
const { expectRevertCustomError } = require('../helpers/customError');
|
||||
|
||||
const ERC20MulticallMock = artifacts.require('$ERC20MulticallMock');
|
||||
|
||||
@ -50,7 +51,7 @@ contract('Multicall', function (accounts) {
|
||||
{ from: deployer },
|
||||
);
|
||||
|
||||
await expectRevert(call, 'ERC20: transfer amount exceeds balance');
|
||||
await expectRevertCustomError(call, 'ERC20InsufficientBalance', [deployer, 0, amount]);
|
||||
expect(await this.multicallToken.balanceOf(alice)).to.be.bignumber.equal(new BN('0'));
|
||||
});
|
||||
|
||||
@ -63,6 +64,6 @@ contract('Multicall', function (accounts) {
|
||||
{ from: deployer },
|
||||
);
|
||||
|
||||
await expectRevert(call, 'ERC20: transfer amount exceeds balance');
|
||||
await expectRevertCustomError(call, 'ERC20InsufficientBalance', [deployer, 0, amount]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user