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:
Ernesto García
2023-06-12 17:41:52 -06:00
committed by GitHub
parent 08fd777f6d
commit b425a72240
138 changed files with 3220 additions and 1287 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],
);
});