From 0636473c8b0bcb72384048c3b1b0579b2b795048 Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 1 Aug 2024 13:41:42 -0400 Subject: [PATCH] feat: update install execution events --- src/account/ModuleManagerInternals.sol | 4 ++-- src/interfaces/IModuleManager.sol | 4 ++-- test/account/AccountExecHooks.t.sol | 8 ++++---- test/account/UpgradeableModularAccount.t.sol | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/account/ModuleManagerInternals.sol b/src/account/ModuleManagerInternals.sol index c064d1a9..1dfedb6c 100644 --- a/src/account/ModuleManagerInternals.sol +++ b/src/account/ModuleManagerInternals.sol @@ -174,7 +174,7 @@ abstract contract ModuleManagerInternals is IModuleManager { revert ModuleInstallCallbackFailed(module, revertReason); } - emit ModuleInstalled(module); + emit ExecutionInstalled(module, manifest); } function _uninstallExecution(address module, ExecutionManifest calldata manifest, bytes memory uninstallData) @@ -216,7 +216,7 @@ abstract contract ModuleManagerInternals is IModuleManager { onUninstallSuccess = false; } - emit ModuleUninstalled(module, onUninstallSuccess); + emit ExecutionUninstalled(module, onUninstallSuccess, manifest); } function _onInstall(address module, bytes calldata data) internal { diff --git a/src/interfaces/IModuleManager.sol b/src/interfaces/IModuleManager.sol index 74e3a338..60d2f5f4 100644 --- a/src/interfaces/IModuleManager.sol +++ b/src/interfaces/IModuleManager.sol @@ -10,9 +10,9 @@ type ValidationConfig is bytes26; type HookConfig is bytes26; interface IModuleManager { - event ModuleInstalled(address indexed module); + event ExecutionInstalled(address indexed module, ExecutionManifest manifest); - event ModuleUninstalled(address indexed module, bool indexed onUninstallSucceeded); + event ExecutionUninstalled(address indexed module, bool onUninstallSucceeded, ExecutionManifest manifest); /// @notice Install a module to the modular account. /// @param module The module to install. diff --git a/test/account/AccountExecHooks.t.sol b/test/account/AccountExecHooks.t.sol index 2e0a90bc..347724f6 100644 --- a/test/account/AccountExecHooks.t.sol +++ b/test/account/AccountExecHooks.t.sol @@ -22,8 +22,8 @@ contract AccountExecHooksTest is AccountTestBase { ExecutionManifest internal _m1; - event ModuleInstalled(address indexed module); - event ModuleUninstalled(address indexed module, bool indexed callbacksSucceeded); + event ExecutionInstalled(address indexed module, ExecutionManifest manifest); + event ExecutionUninstalled(address indexed module, bool onUninstallSucceeded, ExecutionManifest manifest); // emitted by MockModule event ReceivedCall(bytes msgData, uint256 msgValue); @@ -164,7 +164,7 @@ contract AccountExecHooksTest is AccountTestBase { vm.expectEmit(true, true, true, true); emit ReceivedCall(abi.encodeCall(IModule.onInstall, (bytes(""))), 0); vm.expectEmit(true, true, true, true); - emit ModuleInstalled(address(mockModule1)); + emit ExecutionInstalled(address(mockModule1), _m1); vm.startPrank(address(entryPoint)); account1.installExecution({ @@ -179,7 +179,7 @@ contract AccountExecHooksTest is AccountTestBase { vm.expectEmit(true, true, true, true); emit ReceivedCall(abi.encodeCall(IModule.onUninstall, (bytes(""))), 0); vm.expectEmit(true, true, true, true); - emit ModuleUninstalled(address(module), true); + emit ExecutionUninstalled(address(module), true, module.executionManifest()); vm.startPrank(address(entryPoint)); account1.uninstallExecution(address(module), module.executionManifest(), bytes("")); diff --git a/test/account/UpgradeableModularAccount.t.sol b/test/account/UpgradeableModularAccount.t.sol index 0bb281a2..990a7008 100644 --- a/test/account/UpgradeableModularAccount.t.sol +++ b/test/account/UpgradeableModularAccount.t.sol @@ -42,8 +42,8 @@ contract UpgradeableModularAccountTest is AccountTestBase { Counter public counter; ExecutionManifest internal _manifest; - event ModuleInstalled(address indexed module); - event ModuleUninstalled(address indexed module, bool indexed callbacksSucceeded); + event ExecutionInstalled(address indexed module, ExecutionManifest manifest); + event ExecutionUninstalled(address indexed module, bool onUninstallSucceeded, ExecutionManifest manifest); event ReceivedCall(bytes msgData, uint256 msgValue); function setUp() public { @@ -240,7 +240,7 @@ contract UpgradeableModularAccountTest is AccountTestBase { vm.startPrank(address(entryPoint)); vm.expectEmit(true, true, true, true); - emit ModuleInstalled(address(tokenReceiverModule)); + emit ExecutionInstalled(address(tokenReceiverModule), tokenReceiverModule.executionManifest()); IModuleManager(account1).installExecution({ module: address(tokenReceiverModule), manifest: tokenReceiverModule.executionManifest(), @@ -314,7 +314,7 @@ contract UpgradeableModularAccountTest is AccountTestBase { }); vm.expectEmit(true, true, true, true); - emit ModuleUninstalled(address(module), true); + emit ExecutionUninstalled(address(module), true, module.executionManifest()); IModuleManager(account1).uninstallExecution({ module: address(module), manifest: module.executionManifest(),