Skip to content

Commit

Permalink
fix: update constant name for MAX_PRE_VALIDATION_HOOKS (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypaik authored Oct 15, 2024
1 parent 91a2016 commit 8135729
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/account/ModuleManagerInternals.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165C
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

import {collectReturnData} from "../helpers/CollectReturnData.sol";
import {MAX_PRE_VALIDATION_HOOKS} from "../helpers/Constants.sol";
import {MAX_VALIDATION_ASSOC_HOOKS} from "../helpers/Constants.sol";
import {IExecutionHookModule} from "../interfaces/IExecutionHookModule.sol";
import {ExecutionManifest, ManifestExecutionHook} from "../interfaces/IExecutionModule.sol";
import {HookConfig, IModularAccount, ModuleEntity, ValidationConfig} from "../interfaces/IModularAccount.sol";
Expand Down Expand Up @@ -236,7 +236,7 @@ abstract contract ModuleManagerInternals is IModularAccount {
_validationStorage.validationHooks.push(hookConfig);

// Avoid collision between reserved index and actual indices
if (_validationStorage.validationHooks.length > MAX_PRE_VALIDATION_HOOKS) {
if (_validationStorage.validationHooks.length > MAX_VALIDATION_ASSOC_HOOKS) {
revert PreValidationHookLimitExceeded();
}

Expand Down
4 changes: 2 additions & 2 deletions src/helpers/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity ^0.8.20;
// Index marking the start of the data for the validation function.
uint8 constant RESERVED_VALIDATION_DATA_INDEX = type(uint8).max;

// Maximum number of pre validation hooks that can be registered.
uint8 constant MAX_PRE_VALIDATION_HOOKS = type(uint8).max;
// Maximum number of validation-associated hooks that can be registered.
uint8 constant MAX_VALIDATION_ASSOC_HOOKS = type(uint8).max;

// Magic value for the Entity ID of direct call validation.
uint32 constant DIRECT_CALL_VALIDATION_ENTITYID = type(uint32).max;

0 comments on commit 8135729

Please sign in to comment.