diff --git a/contracts/src/helpers/PBHExternalNullifier.sol b/contracts/src/helpers/PBHExternalNullifier.sol index f39b27c4..5a1d942e 100644 --- a/contracts/src/helpers/PBHExternalNullifier.sol +++ b/contracts/src/helpers/PBHExternalNullifier.sol @@ -15,7 +15,6 @@ import "@BokkyPooBahsDateTimeLibrary/BokkyPooBahsDateTimeLibrary.sol"; /// - Bits 0-7: Version //TODO: move this to a lib dir -// TODO: library PBHExternalNullifier { /// @notice Thrown when the provided external nullifier doesn't /// contain the correct leading zeros diff --git a/contracts/test/PBHExternalNullifier.t.sol b/contracts/test/PBHExternalNullifier.t.sol index 995fe90e..b257df80 100644 --- a/contracts/test/PBHExternalNullifier.t.sol +++ b/contracts/test/PBHExternalNullifier.t.sol @@ -43,8 +43,11 @@ contract PBHExternalNullifierTest is Test { PBHExternalNullifier.verify(encoded, maxPbh); } - // TODO: - function testFuzz_verify_RevertIf_InvalidNullifierLeadingZeros() public {} + function testFuzz_verify_RevertIf_InvalidNullifierLeadingZeros(uint256 encoded) public { + vm.assume(encoded > type(uint40).max); + vm.expectRevert(PBHExternalNullifier.InvalidExternalNullifierLeadingZeros.selector); + PBHExternalNullifier.verify(encoded, 30); + } function testFuzz_verify_RevertIf_InvalidExternalNullifierVersion(uint8 pbhVersion) public { vm.assume(pbhVersion != PBHExternalNullifier.V1);