diff --git a/test/Channel.t.sol b/test/Channel.t.sol index 104c9e1..4ca9e7a 100644 --- a/test/Channel.t.sol +++ b/test/Channel.t.sol @@ -9,15 +9,12 @@ contract ChannelTest is Test, Verifier { ChannelWrapper channel; address immutable self = address(this); - bytes32[32] zeroHashes; + bytes32 msgHash; function setUp() public { vm.chainId(1); channel = new ChannelWrapper(self); channel.setDefaultConfig(self, self); - for (uint256 height = 0; height < 31; height++) { - zeroHashes[height + 1] = keccak256(abi.encodePacked(zeroHashes[height], zeroHashes[height])); - } } function test_constructorArgs() public { @@ -34,7 +31,7 @@ contract ChannelTest is Test, Verifier { } function test_recvMessage() public { - bytes32 msgHash = channel.sendMessage(self, 2, self, 0, ""); + msgHash = channel.sendMessage(self, 2, self, 0, ""); Message memory message = Message({ channel: address(channel), @@ -55,7 +52,7 @@ contract ChannelTest is Test, Verifier { for (uint256 i = 0; i < 100; i++) { vm.chainId(1); uint256 index = channel.count(); - bytes32 msgHash = channel.sendMessage(self, 2, self, 0, ""); + msgHash = channel.sendMessage(self, 2, self, 0, ""); Message memory message = Message({ channel: address(channel), index: index, @@ -73,7 +70,7 @@ contract ChannelTest is Test, Verifier { } function hashOf(uint256, address, uint256) public view override returns (bytes32) { - return bytes32(0); + return msgHash; } } diff --git a/test/ORMP.t.sol b/test/ORMP.t.sol index 46a7654..c89cb0d 100644 --- a/test/ORMP.t.sol +++ b/test/ORMP.t.sol @@ -38,7 +38,7 @@ contract ORMPTest is Test, Verifier { vm.chainId(2); } - function test_Refunds() public { + function test_refunds() public { uint256 f = ormp.fee(2, self, 0, "", ""); ormp.send{value: f + 5}(2, self, 0, "", address(5), ""); assertEq(address(5).balance, 5); @@ -55,7 +55,7 @@ contract ORMPTest is Test, Verifier { assertEq(msgHash1, msgHash2); } - function testFail_SendWithZeroNativeFee() public { + function testFail_sendWithZeroNativeFee() public { ormp.send{value: 0}(2, self, 0, "", address(5), ""); vm.chainId(2); } @@ -90,11 +90,11 @@ contract ORMPTest is Test, Verifier { return 2; } - function fee(uint256, address, uint256, bytes calldata) external pure returns (uint256) { + function fee(uint256, address, uint256, bytes calldata, bytes calldata) external pure returns (uint256) { return 1; } function hashOf(uint256, address, uint256) public view override returns (bytes32) { - return bytes32(0); + return hash(message); } } diff --git a/test/eco/Oracle.t.sol b/test/eco/Oracle.t.sol index 7745cfb..75ba168 100644 --- a/test/eco/Oracle.t.sol +++ b/test/eco/Oracle.t.sol @@ -55,7 +55,7 @@ contract OracleTest is Test { assertEq(r, bytes32(uint256(1))); } - function hashLookup(address, uint256, bytes32) external pure returns (bytes32) { + function hashLookup(address, bytes32) external pure returns (bytes32) { return bytes32(uint256(1)); } }