From ff75e7914b51202f71eeb1f12b603df7e4bc0922 Mon Sep 17 00:00:00 2001 From: Karel Moravec Date: Mon, 28 Oct 2024 15:35:22 +0100 Subject: [PATCH] feat: update from comments --- contracts/contracts/lib/CrossMsgHelper.sol | 1 + contracts/test/integration/L2PlusSubnet.t.sol | 9 ++------- contracts/test/unit/LibGateway.t.sol | 12 ++++++++++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/contracts/contracts/lib/CrossMsgHelper.sol b/contracts/contracts/lib/CrossMsgHelper.sol index 723c6e7fc..9d42ba169 100644 --- a/contracts/contracts/lib/CrossMsgHelper.sol +++ b/contracts/contracts/lib/CrossMsgHelper.sol @@ -139,6 +139,7 @@ library CrossMsgHelper { /// because it doesn't include the network-specific nonce. function toDeterministicHash(IpcEnvelope memory crossMsg) internal pure returns (bytes32) { return keccak256( + // solhint-disable-next-line func-named-parameters abi.encode( crossMsg.kind, crossMsg.to, diff --git a/contracts/test/integration/L2PlusSubnet.t.sol b/contracts/test/integration/L2PlusSubnet.t.sol index ae25c820c..43581c373 100644 --- a/contracts/test/integration/L2PlusSubnet.t.sol +++ b/contracts/test/integration/L2PlusSubnet.t.sol @@ -73,12 +73,8 @@ contract L2PlusSubnetTest is Test, IntegrationTestBase { token = new ERC20PresetFixedSupply("TestToken", "TEST", 1_000_000, address(this)); tokenL2Subnet = createTokenSubnet(address(token), rootNetwork.gatewayAddr, rootNetworkName); - nativeL3SubnetsWithTokenParent.push( - createNativeSubnet(tokenL2Subnet.gatewayAddr, tokenL2Subnet.id) - ); - nativeL3SubnetsWithTokenParent.push( - createNativeSubnet(tokenL2Subnet.gatewayAddr, tokenL2Subnet.id) - ); + nativeL3SubnetsWithTokenParent.push(createNativeSubnet(tokenL2Subnet.gatewayAddr, tokenL2Subnet.id)); + nativeL3SubnetsWithTokenParent.push(createNativeSubnet(tokenL2Subnet.gatewayAddr, tokenL2Subnet.id)); tokenL3 = new ERC20PresetFixedSupply("TestL3Token", "TEST3", 1_000_000, address(this)); @@ -100,7 +96,6 @@ contract L2PlusSubnetTest is Test, IntegrationTestBase { defaultSubnetActorParamsWith(parentGatewayAddress, parentNetworkName) ); - return createSubnet(parentNetworkName.route, subnetActor); } diff --git a/contracts/test/unit/LibGateway.t.sol b/contracts/test/unit/LibGateway.t.sol index cab91ff11..7fe4c3ec2 100644 --- a/contracts/test/unit/LibGateway.t.sol +++ b/contracts/test/unit/LibGateway.t.sol @@ -266,7 +266,11 @@ contract LibGatewayTest is Test { }); crossMsg.nonce = 0; - ResultMsg memory message = ResultMsg({outcome: OutcomeType.ActorErr, id: crossMsg.toDeterministicHash(), ret: new bytes(0)}); + ResultMsg memory message = ResultMsg({ + outcome: OutcomeType.ActorErr, + id: crossMsg.toDeterministicHash(), + ret: new bytes(0) + }); IpcEnvelope memory expected = IpcEnvelope({ kind: IpcMsgKind.Result, from: crossMsg.to, @@ -373,7 +377,11 @@ contract LibGatewayTest is Test { }); crossMsg.nonce = 0; - ResultMsg memory message = ResultMsg({outcome: OutcomeType.ActorErr, id: crossMsg.toDeterministicHash(), ret: new bytes(0)}); + ResultMsg memory message = ResultMsg({ + outcome: OutcomeType.ActorErr, + id: crossMsg.toDeterministicHash(), + ret: new bytes(0) + }); IpcEnvelope memory expected = IpcEnvelope({ kind: IpcMsgKind.Result, from: crossMsg.to,