From 62937f424ff65ec8b461fd2509d283fd5e5faf5d Mon Sep 17 00:00:00 2001 From: Builddddder Date: Tue, 24 Oct 2023 02:20:13 +0800 Subject: [PATCH] add test case --- contracts/test/example/ERC1271Module.t.sol | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/contracts/test/example/ERC1271Module.t.sol b/contracts/test/example/ERC1271Module.t.sol index 0783447c..60161c9b 100644 --- a/contracts/test/example/ERC1271Module.t.sol +++ b/contracts/test/example/ERC1271Module.t.sol @@ -56,6 +56,19 @@ contract ERC1271ModuleTest is Test { erc1271Module.run(attestationPayload, signature, signerAddress, 0); } + function test_ERC1271Module_WrongSender() public { + address user = makeAddr("NotASigner"); + AttestationPayload memory attestationPayload = AttestationPayload( + bytes32(uint256(1234)), + 0, + bytes("subject"), + new bytes(1) + ); + + vm.expectRevert(ERC1271Module.WrongSender.selector); + erc1271Module.run(attestationPayload, bytes("0"), user, 0); + } + function test_EcRecoverModule_supportsInterface() public { bool isAbstractModuleSupported = erc1271Module.supportsInterface(type(AbstractModule).interfaceId); assertEq(isAbstractModuleSupported, true);