Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 committed Oct 31, 2023
1 parent 3ac93d3 commit 3f3302a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/Channel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/eco/Relayer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ contract Relayer {
require(success, "!withdraw");
}

// params = [extraGas]
// extraGas = gasLimit
function fee(
uint256 toChainId,
address, /*ua*/
Expand Down
8 changes: 4 additions & 4 deletions test/Channel.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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()});
Expand All @@ -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()});
Expand Down
14 changes: 7 additions & 7 deletions test/Common.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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));
}
}
4 changes: 2 additions & 2 deletions test/ORMP.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ contract ORMPTest is Test, Verifier {
from: self,
toChainId: 2,
to: self,
encoded: "",
gasLimit: 0
gasLimit: 0,
encoded: ""
});
}

Expand Down
4 changes: 2 additions & 2 deletions test/bench/ORMP.b.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions test/eco/Relayer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ contract RelayerTest is Test {
from: self,
toChainId: 2,
to: self,
encoded: "",
gasLimit: 0
gasLimit: 0,
encoded: ""
});
relayer.relay(message, "");
}
Expand Down

0 comments on commit 3f3302a

Please sign in to comment.