Skip to content

Commit

Permalink
chore: loupe cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
howydev committed Nov 19, 2023
1 parent 8f44ba5 commit 895cffb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/account/AccountLoupe.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ abstract contract AccountLoupe is IAccountLoupe, AccountStorageV1 {

/// @inheritdoc IAccountLoupe
function getExecutionHooks(bytes4 selector) external view returns (ExecutionHooks[] memory execHooks) {
SelectorData storage selectorData = _getAccountStorage().selectorData[selector];

execHooks = _getHooks(selectorData.executionHooks);
execHooks = _getHooks(_getAccountStorage().selectorData[selector];.executionHooks);
}

/// @inheritdoc IAccountLoupe
Expand All @@ -49,8 +47,7 @@ abstract contract AccountLoupe is IAccountLoupe, AccountStorageV1 {
view
returns (ExecutionHooks[] memory execHooks)
{
bytes24 key = _getPermittedCallKey(callingPlugin, selector);
PermittedCallData storage permittedCallData = _getAccountStorage().permittedCalls[key];
PermittedCallData storage permittedCallData = _getAccountStorage().permittedCalls[_getPermittedCallKey(callingPlugin, selector)];

execHooks = _getHooks(permittedCallData.permittedCallHooks);
}
Expand All @@ -64,11 +61,12 @@ abstract contract AccountLoupe is IAccountLoupe, AccountStorageV1 {
FunctionReference[] memory preRuntimeValidationHooks
)
{
SelectorData storage selectorData = _getAccountStorage().selectorData[selector];
preUserOpValidationHooks = CastLib.toFunctionReferenceArray(
_getAccountStorage().selectorData[selector].preUserOpValidationHooks.getAll()
selectorData.preUserOpValidationHooks.getAll()
);
preRuntimeValidationHooks = CastLib.toFunctionReferenceArray(
_getAccountStorage().selectorData[selector].preRuntimeValidationHooks.getAll()
selectorData.preRuntimeValidationHooks.getAll()
);
}

Expand Down

0 comments on commit 895cffb

Please sign in to comment.