diff --git a/test/src/concrete/Flow.signedContext.t.sol b/test/src/concrete/Flow.signedContext.t.sol index 2fb7e6e4..e0bd481b 100644 --- a/test/src/concrete/Flow.signedContext.t.sol +++ b/test/src/concrete/Flow.signedContext.t.sol @@ -22,11 +22,15 @@ contract FlowSignedContextTest is FlowTest { uint256 fuzzedKeyAlice, uint256 fuzzedKeyBob ) public { - vm.assume(fuzzedKeyBob != fuzzedKeyAlice); (IFlowV5 flow, EvaluableV2 memory evaluable) = deployFlow(); uint256 aliceKey = boundPrivateKey(fuzzedKeyAlice); uint256 bobKey = boundPrivateKey(fuzzedKeyBob); + // `boundPrivateKey` is not injective over the full uint256 domain, so + // distinct fuzz inputs can fold onto the same key. The bad-signature + // assertion below only holds when the two keys actually differ, so + // constrain the bounded keys (not the raw inputs). + vm.assume(aliceKey != bobKey); SignedContextV1[] memory signedContexts = new SignedContextV1[](2); @@ -55,11 +59,15 @@ contract FlowSignedContextTest is FlowTest { uint256 fuzzedKeyAlice, uint256 fuzzedKeyBob ) public { - vm.assume(fuzzedKeyBob != fuzzedKeyAlice); (IFlowV5 flow, EvaluableV2 memory evaluable) = deployFlow(); uint256 aliceKey = boundPrivateKey(fuzzedKeyAlice); uint256 bobKey = boundPrivateKey(fuzzedKeyBob); + // `boundPrivateKey` is not injective over the full uint256 domain, so + // distinct fuzz inputs can fold onto the same key. The bad-signature + // assertion below only holds when the two keys actually differ, so + // constrain the bounded keys (not the raw inputs). + vm.assume(aliceKey != bobKey); SignedContextV1[] memory signedContext = new SignedContextV1[](1); signedContext[0] = vm.signContext(aliceKey, aliceKey, context0);