Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gas limit to message struct #66

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix test
  • Loading branch information
hujw77 committed Oct 31, 2023
commit 3f3302aa2e055610d5c61e6e6a32eaac8b7c8887
4 changes: 2 additions & 2 deletions src/Channel.sol
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion src/eco/Relayer.sol
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ contract Relayer {
require(success, "!withdraw");
}

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

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