Skip to content

Commit 6cdcfa6

Browse files
authored
chore: rename constant (#204)
1 parent e5f55ab commit 6cdcfa6

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/account/ReferenceModularAccount.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
1212
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
1313

1414
import {collectReturnData} from "../helpers/CollectReturnData.sol";
15-
import {DIRECT_CALL_VALIDATION_ENTITYID} from "../helpers/Constants.sol";
15+
import {DIRECT_CALL_VALIDATION_ENTITY_ID} from "../helpers/Constants.sol";
1616
import {_coalescePreValidation, _coalesceValidation} from "../helpers/ValidationResHelpers.sol";
1717
import {IExecutionHookModule} from "../interfaces/IExecutionHookModule.sol";
1818
import {ExecutionManifest} from "../interfaces/IExecutionModule.sol";
@@ -562,7 +562,7 @@ contract ReferenceModularAccount is
562562
&& !_storage.executionStorage[msg.sig].skipRuntimeValidation
563563
) {
564564
ModuleEntity directCallValidationKey =
565-
ModuleEntityLib.pack(msg.sender, DIRECT_CALL_VALIDATION_ENTITYID);
565+
ModuleEntityLib.pack(msg.sender, DIRECT_CALL_VALIDATION_ENTITY_ID);
566566

567567
_checkIfValidationAppliesCallData(msg.data, directCallValidationKey, ValidationCheckingType.EITHER);
568568

src/helpers/Constants.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ uint8 constant RESERVED_VALIDATION_DATA_INDEX = type(uint8).max;
88
uint8 constant MAX_VALIDATION_ASSOC_HOOKS = type(uint8).max;
99

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

test/account/AccountReturnData.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-3.0
22
pragma solidity ^0.8.20;
33

4-
import {DIRECT_CALL_VALIDATION_ENTITYID} from "../../src/helpers/Constants.sol";
4+
import {DIRECT_CALL_VALIDATION_ENTITY_ID} from "../../src/helpers/Constants.sol";
55
import {Call} from "../../src/interfaces/IModularAccount.sol";
66
import {IModularAccount} from "../../src/interfaces/IModularAccount.sol";
77
import {ValidationConfigLib} from "../../src/libraries/ValidationConfigLib.sol";
@@ -44,7 +44,7 @@ contract AccountReturnDataTest is AccountTestBase {
4444
selectors[0] = IModularAccount.execute.selector;
4545
account1.installValidation(
4646
ValidationConfigLib.pack(
47-
address(resultConsumerModule), DIRECT_CALL_VALIDATION_ENTITYID, false, false, true
47+
address(resultConsumerModule), DIRECT_CALL_VALIDATION_ENTITY_ID, false, false, true
4848
), // todo: does this need UO validation permission?
4949
selectors,
5050
"",

test/account/DirectCallsFromModule.t.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {DirectCallModule} from "../mocks/modules/DirectCallModule.sol";
1111

1212
import {AccountTestBase} from "../utils/AccountTestBase.sol";
1313

14-
import {DIRECT_CALL_VALIDATION_ENTITYID} from "../../src/helpers/Constants.sol";
14+
import {DIRECT_CALL_VALIDATION_ENTITY_ID} from "../../src/helpers/Constants.sol";
1515

1616
contract DirectCallsFromModuleTest is AccountTestBase {
1717
using ValidationConfigLib for ValidationConfig;
@@ -34,7 +34,7 @@ contract DirectCallsFromModuleTest is AccountTestBase {
3434
_module = new DirectCallModule();
3535
assertFalse(_module.preHookRan());
3636
assertFalse(_module.postHookRan());
37-
_moduleEntity = ModuleEntityLib.pack(address(_module), DIRECT_CALL_VALIDATION_ENTITYID);
37+
_moduleEntity = ModuleEntityLib.pack(address(_module), DIRECT_CALL_VALIDATION_ENTITY_ID);
3838
}
3939

4040
/* -------------------------------------------------------------------------- */
@@ -128,7 +128,7 @@ contract DirectCallsFromModuleTest is AccountTestBase {
128128
vm.prank(address(entryPoint));
129129

130130
account1.installValidation(
131-
ValidationConfigLib.pack(extraOwner, DIRECT_CALL_VALIDATION_ENTITYID, false, false, false),
131+
ValidationConfigLib.pack(extraOwner, DIRECT_CALL_VALIDATION_ENTITY_ID, false, false, false),
132132
selectors,
133133
"",
134134
new bytes[](0)

test/mocks/modules/ReturnDataModuleMocks.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.20;
33

44
import {PackedUserOperation} from "@eth-infinitism/account-abstraction/interfaces/PackedUserOperation.sol";
55

6-
import {DIRECT_CALL_VALIDATION_ENTITYID} from "../../../src/helpers/Constants.sol";
6+
import {DIRECT_CALL_VALIDATION_ENTITY_ID} from "../../../src/helpers/Constants.sol";
77
import {
88
ExecutionManifest,
99
IExecutionModule,
@@ -106,7 +106,7 @@ contract ResultConsumerModule is IExecutionModule, BaseModule, IValidationModule
106106
// This result should be allowed based on the manifest permission request
107107
bytes memory returnData = IModularAccount(msg.sender).executeWithRuntimeValidation(
108108
abi.encodeCall(IModularAccount.execute, (target, 0, abi.encodeCall(RegularResultContract.foo, ()))),
109-
_encodeSignature(ModuleEntityLib.pack(address(this), DIRECT_CALL_VALIDATION_ENTITYID), uint8(0), "")
109+
_encodeSignature(ModuleEntityLib.pack(address(this), DIRECT_CALL_VALIDATION_ENTITY_ID), uint8(0), "")
110110
);
111111

112112
bytes32 actual = abi.decode(abi.decode(returnData, (bytes)), (bytes32));

0 commit comments

Comments
 (0)