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,9 +1,10 @@
const { expectEvent, expectRevert } = require('@openzeppelin/test-helpers');
const { expectEvent } = require('@openzeppelin/test-helpers');
const { expect } = require('chai');
const Enums = require('../../helpers/enums');
const { GovernorHelper } = require('../../helpers/governance');
const { clockFromReceipt } = require('../../helpers/time');
const { expectRevertCustomError } = require('../../helpers/customError');
const Governor = artifacts.require('$GovernorPreventLateQuorumMock');
const CallReceiver = artifacts.require('CallReceiverMock');
@ -158,7 +159,11 @@ contract('GovernorPreventLateQuorum', function (accounts) {
describe('onlyGovernance updates', function () {
it('setLateQuorumVoteExtension is protected', async function () {
await expectRevert(this.mock.setLateQuorumVoteExtension(0), 'Governor: onlyGovernance');
await expectRevertCustomError(
this.mock.setLateQuorumVoteExtension(0, { from: owner }),
'GovernorOnlyExecutor',
[owner],
);
});
it('can setLateQuorumVoteExtension through governance', async function () {