Skip to content

Commit

Permalink
Prefer EIP1271Verifier.isValidSignature.selector to static constant
Browse files Browse the repository at this point in the history
  • Loading branch information
fedgiac committed Aug 15, 2024
1 parent 16d5d65 commit 6e97dce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion test/GPv2Signing/RecoverOrderSigner.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ contract RecoverOrderSigner is Helper {
bytes memory eip1271SignatureData = hex"";

assertEq(evilVerifier.state(), 0);
assertEq(evilVerifier.isValidSignature(hash, eip1271SignatureData), Sign.EIP1271_MAGIC_VALUE);
assertEq(evilVerifier.isValidSignature(hash, eip1271SignatureData), EIP1271Verifier.isValidSignature.selector);
assertEq(evilVerifier.state(), 1);
vm.expectRevert();
executor.recoverOrderSignerTest(
Expand Down
2 changes: 0 additions & 2 deletions test/libraries/Sign.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ library Sign {

// Copied from GPv2Signing.sol
uint256 internal constant PRE_SIGNED = uint256(keccak256("GPv2Signing.Scheme.PreSign"));
// As prescribed by EIP-1271
bytes4 internal constant EIP1271_MAGIC_VALUE = bytes4(keccak256("isValidSignature(bytes32,bytes)"));

/// @dev A struct combining the signing scheme and the scheme's specific-encoded data
struct Signature {
Expand Down

0 comments on commit 6e97dce

Please sign in to comment.