Skip to content

getExecutionData() to Also Include Execution Hooks for Native Account Selectors #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/account/ModularAccountView.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ abstract contract ModularAccountView is IERC6900AccountView {

/// @inheritdoc IERC6900AccountView
function getExecutionData(bytes4 selector) external view override returns (ExecutionDataView memory data) {
ExecutionStorage storage executionStorage = getAccountStorage().executionStorage[selector];
if (
selector == IERC6900Account.execute.selector || selector == IERC6900Account.executeBatch.selector
|| selector == UUPSUpgradeable.upgradeToAndCall.selector
Expand All @@ -26,16 +27,14 @@ abstract contract ModularAccountView is IERC6900AccountView {
data.module = address(this);
data.allowGlobalValidation = true;
} else {
ExecutionStorage storage executionStorage = getAccountStorage().executionStorage[selector];
data.module = executionStorage.module;
data.skipRuntimeValidation = executionStorage.skipRuntimeValidation;
data.allowGlobalValidation = executionStorage.allowGlobalValidation;

uint256 executionHooksLen = executionStorage.executionHooks.length();
data.executionHooks = new HookConfig[](executionHooksLen);
for (uint256 i = 0; i < executionHooksLen; ++i) {
data.executionHooks[i] = toHookConfig(executionStorage.executionHooks.at(i));
}
}
uint256 executionHooksLen = executionStorage.executionHooks.length();
data.executionHooks = new HookConfig[](executionHooksLen);
for (uint256 i = 0; i < executionHooksLen; ++i) {
data.executionHooks[i] = toHookConfig(executionStorage.executionHooks.at(i));
}
}

Expand Down