From aecb25e4933b2cbbb352b0879b06d96e9ca26022 Mon Sep 17 00:00:00 2001 From: highskore Date: Fri, 6 Dec 2024 17:37:11 +0100 Subject: [PATCH] fix: revert if validator is installed and non-zero --- src/test/helpers/SafeHelpers.sol | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/test/helpers/SafeHelpers.sol b/src/test/helpers/SafeHelpers.sol index 9885677a..adb82917 100644 --- a/src/test/helpers/SafeHelpers.sol +++ b/src/test/helpers/SafeHelpers.sol @@ -330,7 +330,7 @@ contract SafeHelpers is HelperBase { /// @return bytes32 the formatted hash function formatERC1271Hash( AccountInstance memory instance, - address, + address validator, bytes32 hash ) public @@ -339,6 +339,13 @@ contract SafeHelpers is HelperBase { deployAccountForAction(instance) returns (bytes32) { + // Revert if validator is not 0x0 or the validator is installed + if ( + validator != address(0x0) + && isModuleInstalled(instance, MODULE_TYPE_VALIDATOR, validator, "") + ) { + revert("formatERC1271Hash: validator is installed"); + } bytes memory messageData = abi.encodePacked( bytes1(0x19), bytes1(0x01),