From 3f3302aa2e055610d5c61e6e6a32eaac8b7c8887 Mon Sep 17 00:00:00 2001 From: echo Date: Tue, 31 Oct 2023 12:10:49 +0800 Subject: [PATCH] fix test --- src/Channel.sol | 4 ++-- src/eco/Relayer.sol | 2 +- test/Channel.t.sol | 8 ++++---- test/Common.t.sol | 14 +++++++------- test/ORMP.t.sol | 4 ++-- test/bench/ORMP.b.sol | 4 ++-- test/eco/Relayer.t.sol | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Channel.sol b/src/Channel.sol index 7b0f416..b7a8fef 100644 --- a/src/Channel.sol +++ b/src/Channel.sol @@ -88,8 +88,8 @@ contract Channel is UserConfig { from: from, toChainId: toChainId, to: to, - encoded: encoded, - gasLimit: gasLimit + gasLimit: gasLimit, + encoded: encoded }); // hash the message. bytes32 msgHash = hash(message); diff --git a/src/eco/Relayer.sol b/src/eco/Relayer.sol index 04a3baf..83391d3 100644 --- a/src/eco/Relayer.sol +++ b/src/eco/Relayer.sol @@ -88,7 +88,7 @@ contract Relayer { require(success, "!withdraw"); } - // params = [extraGas] + // extraGas = gasLimit function fee( uint256 toChainId, address, /*ua*/ diff --git a/test/Channel.t.sol b/test/Channel.t.sol index f4a43b6..d21ac3a 100644 --- a/test/Channel.t.sol +++ b/test/Channel.t.sol @@ -64,8 +64,8 @@ contract ChannelTest is Test, Verifier { from: self, toChainId: 2, to: self, - encoded: "", - gasLimit: 0 + gasLimit: 0, + encoded: "" }); assertEq(msgHash, hash(message)); Proof memory proof = Proof({blockNumber: block.number, messageIndex: 0, messageProof: channel.prove()}); @@ -85,8 +85,8 @@ contract ChannelTest is Test, Verifier { from: self, toChainId: 2, to: self, - encoded: "", - gasLimit: 0 + gasLimit: 0, + encoded: "" }); assertEq(msgHash, hash(message)); Proof memory proof = Proof({blockNumber: block.number, messageIndex: index, messageProof: channel.prove()}); diff --git a/test/Common.t.sol b/test/Common.t.sol index f70948e..b50cd3a 100644 --- a/test/Common.t.sol +++ b/test/Common.t.sol @@ -29,14 +29,14 @@ contract CommonTest is Test { from: address(0x0), toChainId: 2, to: address(0x0), - encoded: "", - gasLimit: 0 + gasLimit: 0, + encoded: "" }); assertEq0( - hex"0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000", + hex"0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000", abi.encode(message) ); - assertEq(bytes32(0xb641a5a085fd1455a66efb94dbabf6af79dccb25bdee35bb9cccf535925e0a19), hash(message)); + assertEq(bytes32(0x71fb3c3f4e014e5f86a232c7c14dc843164c056fd16a026cfea4fe4f814236e7), hash(message)); } function test_hashMessage_real() public { @@ -47,9 +47,9 @@ contract CommonTest is Test { from: 0x0f14341A7f464320319025540E8Fe48Ad0fe5aec, toChainId: 43, to: 0x000000fbfBc6954C8CBba3130b5Aee7f3Ea5108e, - encoded: "", - gasLimit: 0 + gasLimit: 0, + encoded: "" }); - assertEq(bytes32(0xec824c8e8f1f19fadc3b4532bc2925af53fdad9162eecc17342909ac8ab787f7), hash(message)); + assertEq(bytes32(0x16ef90052810b57bc4e8e2af6c78a9160259b8b754fe2b2cb943adeb716dd024), hash(message)); } } diff --git a/test/ORMP.t.sol b/test/ORMP.t.sol index f9818d9..63edee3 100644 --- a/test/ORMP.t.sol +++ b/test/ORMP.t.sol @@ -38,8 +38,8 @@ contract ORMPTest is Test, Verifier { from: self, toChainId: 2, to: self, - encoded: "", - gasLimit: 0 + gasLimit: 0, + encoded: "" }); } diff --git a/test/bench/ORMP.b.sol b/test/bench/ORMP.b.sol index f6108d1..54e76cc 100644 --- a/test/bench/ORMP.b.sol +++ b/test/bench/ORMP.b.sol @@ -54,8 +54,8 @@ contract ORMPBenchmarkTest is Test { from: self, toChainId: toChainId, to: self, - encoded: encoded, - gasLimit: 0 + gasLimit: 0, + encoded: encoded }); perform_recv(message); } diff --git a/test/eco/Relayer.t.sol b/test/eco/Relayer.t.sol index f38912b..607e328 100644 --- a/test/eco/Relayer.t.sol +++ b/test/eco/Relayer.t.sol @@ -98,8 +98,8 @@ contract RelayerTest is Test { from: self, toChainId: 2, to: self, - encoded: "", - gasLimit: 0 + gasLimit: 0, + encoded: "" }); relayer.relay(message, ""); }