Skip to content

Commit 6681a2b

Browse files
authored
Fix/posthook 0xff (#113)
* v3.1 rc1 * fix : do propor posthook routing if hook is 0xff and check testcase works properly
1 parent e18c700 commit 6681a2b

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

src/Kernel.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ contract Kernel is IAccount, IAccountExecute, IERC7579Account, ValidationManager
170170
} else {
171171
revert NotSupportedCallType();
172172
}
173-
if (address(config.hook) != address(1)) {
173+
if (
174+
address(config.hook) != address(1) && address(config.hook) != 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF
175+
) {
174176
_doPostHook(config.hook, context);
175177
}
176178
}

src/sdk/KernelTestBase.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,8 @@ abstract contract KernelTestBase is Test {
705705
);
706706
PackedUserOperation[] memory ops = new PackedUserOperation[](1);
707707
ops[0] = op;
708+
vm.expectEmit(address(kernel));
709+
emit MockAction.MockActionEvent(address(kernel));
708710
entrypoint.handleOps(ops, payable(address(0xdeadbeef)));
709711
}
710712

src/validator/ECDSAValidator.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ contract ECDSAValidator is IValidator, IHook {
2424
mapping(address => ECDSAValidatorStorage) public ecdsaValidatorStorage;
2525

2626
function onInstall(bytes calldata _data) external payable override {
27-
if (_isInitialized(msg.sender)) revert AlreadyInitialized(msg.sender);
2827
address owner = address(bytes20(_data[0:20]));
2928
ecdsaValidatorStorage[msg.sender].owner = owner;
3029
emit OwnerRegistered(msg.sender, owner);

src/validator/MultiSignatureECDSAValidator.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ contract MultiSignatureECDSAValidator is IValidator, IHook {
2525
mapping(address => ECDSAValidatorStorage) public ecdsaValidatorStorage;
2626

2727
function onInstall(bytes calldata _data) external payable override {
28-
if (_isInitialized(msg.sender)) revert AlreadyInitialized(msg.sender);
2928
address owner = address(bytes20(_data[0:20]));
3029
ecdsaValidatorStorage[msg.sender].owner = owner;
3130
emit OwnerRegistered(msg.sender, owner);

0 commit comments

Comments
 (0)