Fix Checkpoints fuzz overflow (#4184)
Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
@ -86,10 +86,12 @@ function testPush(
|
||||
|
||||
if (keys.length > 0) {
|
||||
${opts.keyTypeName} lastKey = keys[keys.length - 1];
|
||||
pastKey = _bound${capitalize(opts.keyTypeName)}(pastKey, 0, lastKey - 1);
|
||||
|
||||
vm.expectRevert();
|
||||
this.push(pastKey, values[keys.length % values.length]);
|
||||
if (lastKey > 0) {
|
||||
pastKey = _bound${capitalize(opts.keyTypeName)}(pastKey, 0, lastKey - 1);
|
||||
|
||||
vm.expectRevert();
|
||||
this.push(pastKey, values[keys.length % values.length]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,11 +175,13 @@ function testPush(
|
||||
// Can't push any key in the past
|
||||
if (keys.length > 0) {
|
||||
${opts.keyTypeName} lastKey = keys[keys.length - 1];
|
||||
pastKey = _bound${capitalize(opts.keyTypeName)}(pastKey, 0, lastKey - 1);
|
||||
|
||||
vm.roll(pastKey);
|
||||
vm.expectRevert();
|
||||
this.push(values[keys.length % values.length]);
|
||||
if (lastKey > 0) {
|
||||
pastKey = _bound${capitalize(opts.keyTypeName)}(pastKey, 0, lastKey - 1);
|
||||
|
||||
vm.roll(pastKey);
|
||||
vm.expectRevert();
|
||||
this.push(values[keys.length % values.length]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user