Replace error strings with custom errors (#4261)

This commit is contained in:
Francisco Giordano
2023-06-06 01:08:31 -03:00
parent 253bfa68c2
commit 99a4cfca17
133 changed files with 3157 additions and 1204 deletions

View File

@ -1,7 +1,8 @@
const { constants, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers');
const { constants, expectEvent, time } = require('@openzeppelin/test-helpers');
const { web3 } = require('@openzeppelin/test-helpers/src/setup');
const { expect } = require('chai');
const { BNmin } = require('../helpers/math');
const { expectRevertCustomError } = require('../helpers/customError');
const VestingWallet = artifacts.require('VestingWallet');
const ERC20 = artifacts.require('$ERC20');
@ -20,9 +21,10 @@ contract('VestingWallet', function (accounts) {
});
it('rejects zero address for beneficiary', async function () {
await expectRevert(
await expectRevertCustomError(
VestingWallet.new(constants.ZERO_ADDRESS, this.start, duration),
'VestingWallet: beneficiary is zero address',
'VestingWalletInvalidBeneficiary',
[constants.ZERO_ADDRESS],
);
});