From 9e7acbc15ab17146a8198a9d0944045412c41605 Mon Sep 17 00:00:00 2001 From: echo Date: Sun, 4 Feb 2024 16:43:40 +0800 Subject: [PATCH] revert test --- test/Channel.t.sol | 4 ++-- test/ORMP.t.sol | 2 +- test/Verifier.t.sol | 2 +- test/bench/ORMP.b.sol | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/Channel.t.sol b/test/Channel.t.sol index 80fbb42..d21ac3a 100644 --- a/test/Channel.t.sol +++ b/test/Channel.t.sol @@ -68,7 +68,7 @@ contract ChannelTest is Test, Verifier { encoded: "" }); assertEq(msgHash, hash(message)); - Proof memory proof = Proof({messageIndex: 0, messageProof: channel.prove()}); + Proof memory proof = Proof({blockNumber: block.number, messageIndex: 0, messageProof: channel.prove()}); vm.chainId(2); channel.recvMessage(message, abi.encode(proof)); } @@ -89,7 +89,7 @@ contract ChannelTest is Test, Verifier { encoded: "" }); assertEq(msgHash, hash(message)); - Proof memory proof = Proof({messageIndex: index, messageProof: channel.prove()}); + Proof memory proof = Proof({blockNumber: block.number, messageIndex: index, messageProof: channel.prove()}); vm.chainId(2); channel.recvMessage(message, abi.encode(proof)); } diff --git a/test/ORMP.t.sol b/test/ORMP.t.sol index da3d8e3..63edee3 100644 --- a/test/ORMP.t.sol +++ b/test/ORMP.t.sol @@ -50,7 +50,7 @@ contract ORMPTest is Test, Verifier { function perform_send() public { uint256 f = ormp.fee(2, self, 0, "", ""); ormp.send{value: f}(2, self, 0, "", self, ""); - proof = Proof({messageIndex: ormp.messageCount() - 1, messageProof: ormp.prove()}); + proof = Proof({blockNumber: block.number, messageIndex: ormp.messageCount() - 1, messageProof: ormp.prove()}); vm.chainId(2); } diff --git a/test/Verifier.t.sol b/test/Verifier.t.sol index af4c27c..caff3e9 100644 --- a/test/Verifier.t.sol +++ b/test/Verifier.t.sol @@ -36,7 +36,7 @@ contract VerifierTest is Test, Verifier { function test_verifyMessageProof() public { bytes32 msgHash = bytes32(uint256(1)); imt.insert(msgHash); - Proof memory proof = Proof({messageIndex: 0, messageProof: zeroHashes}); + Proof memory proof = Proof({blockNumber: block.number, messageIndex: 0, messageProof: zeroHashes}); bool r = this.verifyMessageProof(1, msgHash, abi.encode(proof)); assertEq(r, true); } diff --git a/test/bench/ORMP.b.sol b/test/bench/ORMP.b.sol index ba6d1f6..fad756e 100644 --- a/test/bench/ORMP.b.sol +++ b/test/bench/ORMP.b.sol @@ -70,7 +70,8 @@ contract ORMPBenchmarkTest is Test { function perform_recv(Message memory message) public { root = ormp.root(); - Verifier.Proof memory proof = Verifier.Proof({messageIndex: message.index, messageProof: ormp.prove()}); + Verifier.Proof memory proof = + Verifier.Proof({blockNumber: block.number, messageIndex: message.index, messageProof: ormp.prove()}); vm.createSelectFork(message.toChainId.toChainName()); // TODO: setDefaltOracle