Skip to content

Commit

Permalink
chore: remove permission hooks from manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
howydev committed Jun 17, 2024
1 parent dbcf555 commit 7d9f003
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 264 deletions.
25 changes: 0 additions & 25 deletions src/account/PluginManagerInternals.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {FunctionReferenceLib} from "../helpers/FunctionReferenceLib.sol";
import {
IPlugin,
ManifestExecutionHook,
ManifestPermissionHook,
ManifestFunction,
ManifestAssociatedFunctionType,
ManifestAssociatedFunction,
Expand Down Expand Up @@ -224,18 +223,6 @@ abstract contract PluginManagerInternals is IPluginManager {
_addExecHooks(execHooks, hookFunction, mh.isPreHook, mh.isPostHook, mh.requireUOContext);
}

length = manifest.permissionHooks.length;
for (uint256 i = 0; i < length; ++i) {
ManifestPermissionHook memory mh = manifest.permissionHooks[i];
EnumerableSet.Bytes32Set storage permissionHooks =
_storage.validationData[mh.validationFunction].permissionHooks;
FunctionReference hookFunction = FunctionReferenceLib.pack(plugin, mh.functionId);
_addExecHooks(permissionHooks, hookFunction, mh.isPreHook, mh.isPostHook, mh.requireUOContext);
if (mh.requireUOContext) {
_storage.validationData[mh.validationFunction].requireUOHookCount += 1;
}
}

length = manifest.interfaceIds.length;
for (uint256 i = 0; i < length; ++i) {
_storage.supportedIfaces[manifest.interfaceIds[i]] += 1;
Expand Down Expand Up @@ -292,18 +279,6 @@ abstract contract PluginManagerInternals is IPluginManager {
_removeExecHooks(execHooks, hookFunction, mh.isPreHook, mh.isPostHook, mh.requireUOContext);
}

length = manifest.permissionHooks.length;
for (uint256 i = 0; i < length; ++i) {
ManifestPermissionHook memory mh = manifest.permissionHooks[i];
FunctionReference hookFunction = FunctionReferenceLib.pack(plugin, mh.functionId);
EnumerableSet.Bytes32Set storage permissionHooks =
_storage.validationData[mh.validationFunction].permissionHooks;
_removeExecHooks(permissionHooks, hookFunction, mh.isPreHook, mh.isPostHook, mh.requireUOContext);
if (mh.requireUOContext) {
_storage.validationData[mh.validationFunction].requireUOHookCount -= 1;
}
}

length = manifest.signatureValidationFunctions.length;
for (uint256 i = 0; i < length; ++i) {
FunctionReference signatureValidationFunction =
Expand Down
2 changes: 0 additions & 2 deletions src/interfaces/IPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ struct PluginManifest {
ManifestAssociatedFunction[] validationFunctions;
// Execution hooks are associated with a selector
ManifestExecutionHook[] executionHooks;
// Permission hooks are execution hooks associated with a validator instead of a selector
ManifestPermissionHook[] permissionHooks;
uint8[] signatureValidationFunctions;
// List of ERC-165 interface IDs to add to account to support introspection checks. This MUST NOT include
// IPlugin's interface ID.
Expand Down
237 changes: 0 additions & 237 deletions test/account/AccountPermissionHooks.t.sol

This file was deleted.

0 comments on commit 7d9f003

Please sign in to comment.