Skip to content

Commit

Permalink
feat: update from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
karlem committed Oct 28, 2024
1 parent 95af650 commit ff75e79
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions contracts/contracts/lib/CrossMsgHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 2 additions & 7 deletions contracts/test/integration/L2PlusSubnet.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -100,7 +96,6 @@ contract L2PlusSubnetTest is Test, IntegrationTestBase {
defaultSubnetActorParamsWith(parentGatewayAddress, parentNetworkName)
);


return createSubnet(parentNetworkName.route, subnetActor);
}

Expand Down
12 changes: 10 additions & 2 deletions contracts/test/unit/LibGateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ff75e79

Please sign in to comment.