MultiSignerERC7913: prevent setting the threshold to zero (#5772)

This commit is contained in:
Hadrien Croubois
2025-06-27 13:29:40 +02:00
committed by GitHub
parent 1a87de9326
commit cc94ea4930
2 changed files with 11 additions and 2 deletions

View File

@ -176,9 +176,14 @@ describe('AccountMultiSigner', function () {
await expect(this.mock.$_setThreshold(2)).to.emit(this.mock, 'ERC7913ThresholdSet');
// Unreachable threshold reverts
await expect(this.mock.$_setThreshold(3)).to.revertedWithCustomError(
await expect(this.mock.$_setThreshold(3))
.to.revertedWithCustomError(this.mock, 'MultiSignerERC7913UnreachableThreshold')
.withArgs(2, 3);
// Zero threshold reverts
await expect(this.mock.$_setThreshold(0)).to.revertedWithCustomError(
this.mock,
'MultiSignerERC7913UnreachableThreshold',
'MultiSignerERC7913ZeroThreshold',
);
});