diff --git a/test/GasBenchmark.t.sol b/test/GasBenchmark.t.sol index 5b9b162..081ca3e 100644 --- a/test/GasBenchmark.t.sol +++ b/test/GasBenchmark.t.sol @@ -25,8 +25,8 @@ contract GasBenchmarkTest is ReflexConstants { // Constants // ========= - uint32 internal constant _MODULE_ID_SINGLE = 2; - uint32 internal constant _MODULE_ID_BATCH = 3; + uint32 internal constant _MODULE_ID_BATCH = 2; + uint32 internal constant _MODULE_ID_SINGLE = 100; // ======= // Storage diff --git a/test/ImplementationERC20.t.sol b/test/ImplementationERC20.t.sol index 68dc97b..0ff04d7 100644 --- a/test/ImplementationERC20.t.sol +++ b/test/ImplementationERC20.t.sol @@ -24,7 +24,6 @@ contract ImplementationERC20Test is ImplementationFixture { // ========= uint32 internal constant _MODULE_ID_TOKEN_HUB = 100; - uint32 internal constant _MODULE_ID_TOKEN = 101; string internal constant _MODULE_NAME_TOKEN = "TOKEN A"; diff --git a/test/ImplementationState.t.sol b/test/ImplementationState.t.sol index 84c2988..6f45477 100644 --- a/test/ImplementationState.t.sol +++ b/test/ImplementationState.t.sol @@ -21,14 +21,14 @@ contract ImplementationStateTest is ImplementationFixture { // Constants // ========= - uint32 internal constant _MODULE_ID_EXAMPLE = 2; + uint32 internal constant _MODULE_ID_SINGLE = 100; // ======= // Storage // ======= - MockImplementationModule public exampleModuleImplementation; - MockImplementationModule public exampleModuleEndpoint; + MockImplementationModule public singleModuleImplementation; + MockImplementationModule public singleModuleEndpoint; // solhint-disable-next-line var-name-mixedcase bytes32 public REFLEX_STORAGE_SLOT; @@ -42,15 +42,15 @@ contract ImplementationStateTest is ImplementationFixture { function setUp() public virtual override { super.setUp(); - exampleModuleImplementation = new MockImplementationModule( - IReflexModule.ModuleSettings({moduleId: _MODULE_ID_EXAMPLE, moduleType: _MODULE_TYPE_SINGLE_ENDPOINT}) + singleModuleImplementation = new MockImplementationModule( + IReflexModule.ModuleSettings({moduleId: _MODULE_ID_SINGLE, moduleType: _MODULE_TYPE_SINGLE_ENDPOINT}) ); address[] memory moduleAddresses = new address[](1); - moduleAddresses[0] = address(exampleModuleImplementation); + moduleAddresses[0] = address(singleModuleImplementation); installerEndpoint.addModules(moduleAddresses); - exampleModuleEndpoint = MockImplementationModule(dispatcher.getEndpoint(_MODULE_ID_EXAMPLE)); + singleModuleEndpoint = MockImplementationModule(dispatcher.getEndpoint(_MODULE_ID_SINGLE)); REFLEX_STORAGE_SLOT = dispatcher.REFLEX_STORAGE_SLOT(); IMPLEMENTATION_STORAGE_SLOT = dispatcher.IMPLEMENTATION_STORAGE_SLOT(); @@ -115,11 +115,11 @@ contract ImplementationStateTest is ImplementationFixture { * | ReflexState.modules | address | REFLEX_STORAGE_SLOT + 3 | 0 | 32 | */ vm.record(); - dispatcher.getReflexState3(_MODULE_ID_EXAMPLE); + dispatcher.getReflexState3(_MODULE_ID_SINGLE); (reads, ) = vm.accesses(address(dispatcher)); - assertEq((reads[0]), keccak256(abi.encode(_MODULE_ID_EXAMPLE, uint256(REFLEX_STORAGE_SLOT) + 3))); + assertEq((reads[0]), keccak256(abi.encode(_MODULE_ID_SINGLE, uint256(REFLEX_STORAGE_SLOT) + 3))); current = vm.load(address(dispatcher), bytes32(reads[0])); - assertEq(address(uint160(uint256(current))), address(exampleModuleImplementation)); + assertEq(address(uint160(uint256(current))), address(singleModuleImplementation)); /** * | Name | Type | Slot | Offset | Bytes | @@ -127,11 +127,11 @@ contract ImplementationStateTest is ImplementationFixture { * | ReflexState.endpoints | address | REFLEX_STORAGE_SLOT + 4 | 0 | 32 | */ vm.record(); - dispatcher.getReflexState4(_MODULE_ID_EXAMPLE); + dispatcher.getReflexState4(_MODULE_ID_SINGLE); (reads, ) = vm.accesses(address(dispatcher)); - assertEq((reads[0]), keccak256(abi.encode(_MODULE_ID_EXAMPLE, uint256(REFLEX_STORAGE_SLOT) + 4))); + assertEq((reads[0]), keccak256(abi.encode(_MODULE_ID_SINGLE, uint256(REFLEX_STORAGE_SLOT) + 4))); current = vm.load(address(dispatcher), bytes32(reads[0])); - assertEq(address(uint160(uint256(current))), address(exampleModuleEndpoint)); + assertEq(address(uint160(uint256(current))), address(singleModuleEndpoint)); /** * | Name | Type | Slot | Offset | Bytes | @@ -139,12 +139,12 @@ contract ImplementationStateTest is ImplementationFixture { * | ReflexState.relations | address | REFLEX_STORAGE_SLOT + 5 | 0 | 32 | */ vm.record(); - dispatcher.getReflexState5(address(exampleModuleEndpoint)); + dispatcher.getReflexState5(address(singleModuleEndpoint)); (reads, ) = vm.accesses(address(dispatcher)); - assertEq((reads[0]), keccak256(abi.encode(address(exampleModuleEndpoint), uint256(REFLEX_STORAGE_SLOT) + 5))); + assertEq((reads[0]), keccak256(abi.encode(address(singleModuleEndpoint), uint256(REFLEX_STORAGE_SLOT) + 5))); current = vm.load(address(dispatcher), bytes32(reads[0])); - assertEq(uint32(uint256(current)), exampleModuleImplementation.moduleId()); - assertEq(address(uint160(uint256(current) >> 32)), address(exampleModuleImplementation)); + assertEq(uint32(uint256(current)), singleModuleImplementation.moduleId()); + assertEq(address(uint160(uint256(current) >> 32)), address(singleModuleImplementation)); } function testFuzzStorageImplementationStorageLayout( diff --git a/test/ReflexModule.t.sol b/test/ReflexModule.t.sol index 9b9efc3..266a55e 100644 --- a/test/ReflexModule.t.sol +++ b/test/ReflexModule.t.sol @@ -21,7 +21,7 @@ contract ReflexModuleTest is ReflexFixture { // Constants // ========= - uint32 internal constant _MODULE_ID_VALID = 5; + uint32 internal constant _MODULE_ID_VALID = 777; uint16 internal constant _MODULE_TYPE_VALID = _MODULE_TYPE_SINGLE_ENDPOINT; uint32 internal constant _MODULE_ID_INVALID = 0;