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,9 @@
const { expectRevert } = require('@openzeppelin/test-helpers');
require('@openzeppelin/test-helpers');
const { expect } = require('chai');
const { VALUE_SIZES } = require('../../../scripts/generate/templates/Checkpoints.opts.js');
const { expectRevertCustomError } = require('../../helpers/customError.js');
const $Checkpoints = artifacts.require('$Checkpoints');
@ -77,7 +79,11 @@ contract('Checkpoints', function () {
});
it('cannot push values in the past', async function () {
await expectRevert(this.methods.push(last(this.checkpoints).key - 1, '0'), 'Checkpoint: decreasing keys');
await expectRevertCustomError(
this.methods.push(last(this.checkpoints).key - 1, '0'),
'CheckpointUnorderedInsertion',
[],
);
});
it('can update last value', async function () {