Skip to content

Commit

Permalink
fix: revert if validator is installed and non-zero
Browse files Browse the repository at this point in the history
  • Loading branch information
highskore committed Dec 6, 2024
1 parent 82f7348 commit aecb25e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/helpers/SafeHelpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ contract SafeHelpers is HelperBase {
/// @return bytes32 the formatted hash
function formatERC1271Hash(
AccountInstance memory instance,
address,
address validator,
bytes32 hash
)
public
Expand All @@ -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),
Expand Down

0 comments on commit aecb25e

Please sign in to comment.