Skip to content

Commit d551cd7

Browse files
committed
improve tests
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
1 parent e6b4faa commit d551cd7

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.gas-snapshot

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ IBCBenchmarks:testRecvPacket() (gas: 154889)
55
IBCBenchmarks:testSendPacket() (gas: 94843)
66
IBCBenchmarks:testUpdateMockClientDirectly() (gas: 64879)
77
IBCBenchmarks:testUpdateMockClientViaHandler() (gas: 148239)
8-
IBCMockAppFactoryTest:testHandshake() (gas: 8675737)
9-
IBCMockAppFactoryTest:testPacketRelay() (gas: 15995797)
8+
IBCMockAppFactoryTest:testHandshake() (gas: 8710771)
9+
IBCMockAppFactoryTest:testPacketRelay() (gas: 15995791)
1010
IBCMockAppTest:testHandshake() (gas: 4183963)
1111
IBCMockAppTest:testHandshakeBetweenDifferentPorts() (gas: 3130978)
1212
IBCMockAppTest:testPacketRelay() (gas: 11493798)
@@ -52,24 +52,24 @@ TestICS04Packet:testRecvPacketTimeoutTimestamp() (gas: 3107997)
5252
TestICS04Packet:testSendPacket() (gas: 4425319)
5353
TestICS04Packet:testTimeoutOnClose() (gas: 3335905)
5454
TestICS04Upgrade:testCrossingHelloInconsistentVersions() (gas: 9761065)
55-
TestICS04Upgrade:testUpgradeAuthorityCancel() (gas: 45179910)
55+
TestICS04Upgrade:testUpgradeAuthorityCancel() (gas: 45179742)
5656
TestICS04Upgrade:testUpgradeCannotCancelWithOldErrorReceipt() (gas: 3309916)
57-
TestICS04Upgrade:testUpgradeCannotRecvNextUpgradePacket() (gas: 5142540)
58-
TestICS04Upgrade:testUpgradeCounterpartyAdvanceNextSequenceBeforeOpen() (gas: 5101912)
57+
TestICS04Upgrade:testUpgradeCannotRecvNextUpgradePacket() (gas: 5142516)
58+
TestICS04Upgrade:testUpgradeCounterpartyAdvanceNextSequenceBeforeOpen() (gas: 5101888)
5959
TestICS04Upgrade:testUpgradeCrossingHelloIncompatibleProposals() (gas: 4859793)
60-
TestICS04Upgrade:testUpgradeFull() (gas: 55736704)
60+
TestICS04Upgrade:testUpgradeFull() (gas: 55736320)
6161
TestICS04Upgrade:testUpgradeInit() (gas: 2937759)
6262
TestICS04Upgrade:testUpgradeNoChanges() (gas: 2354426)
6363
TestICS04Upgrade:testUpgradeNotUpgradableModule() (gas: 3470809)
6464
TestICS04Upgrade:testUpgradeOutOfSync() (gas: 3741133)
65-
TestICS04Upgrade:testUpgradeRelaySuccessAtCounterpartyFlushComplete() (gas: 5115138)
66-
TestICS04Upgrade:testUpgradeRelaySuccessAtFlushing() (gas: 5487371)
67-
TestICS04Upgrade:testUpgradeSendPacketFailAtFlushingOrFlushComplete() (gas: 3920282)
65+
TestICS04Upgrade:testUpgradeRelaySuccessAtCounterpartyFlushComplete() (gas: 5115114)
66+
TestICS04Upgrade:testUpgradeRelaySuccessAtFlushing() (gas: 5487347)
67+
TestICS04Upgrade:testUpgradeSendPacketFailAtFlushingOrFlushComplete() (gas: 3920258)
6868
TestICS04Upgrade:testUpgradeTimeoutAbortAck() (gas: 17345060)
6969
TestICS04Upgrade:testUpgradeTimeoutAbortConfirm() (gas: 20945649)
70-
TestICS04Upgrade:testUpgradeTimeoutUpgrade() (gas: 69105638)
71-
TestICS04Upgrade:testUpgradeToOrdered() (gas: 53030999)
72-
TestICS04Upgrade:testUpgradeToUnordered() (gas: 42323384)
70+
TestICS04Upgrade:testUpgradeTimeoutUpgrade() (gas: 69105350)
71+
TestICS04Upgrade:testUpgradeToOrdered() (gas: 53030759)
72+
TestICS04Upgrade:testUpgradeToUnordered() (gas: 42323192)
7373
TestICS04UpgradeApp:testUpgradeAuthorizationChanneNotFound() (gas: 62062)
7474
TestICS04UpgradeApp:testUpgradeAuthorizationRePropose() (gas: 2376902)
7575
TestICS04UpgradeApp:testUpgradeAuthorizationRemove() (gas: 2357348)

tests/foundry/src/IBCMockAppFactory.t.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ contract IBCMockAppFactoryTest is IBCTestHelper, ICS04PacketEventTestHelper {
3636
function testHandshake() public {
3737
Channel.Order[2] memory orders = [Channel.Order.ORDER_UNORDERED, Channel.Order.ORDER_ORDERED];
3838
for (uint256 i = 0; i < orders.length; i++) {
39-
createMockAppChannel(orders[i]);
39+
(ChannelInfo memory channel0, ChannelInfo memory channel1) = createMockAppChannel(orders[i]);
40+
assertEq(address(ibcHandler.getIBCModuleByPort(channel0.portId)), address(mockAppFactory));
41+
assertEq(address(ibcHandler.getIBCModuleByChannel(channel0.portId, channel0.channelId)), address(mockAppFactory.lookupApp(channel0.channelId)));
42+
assertEq(address(ibcHandler.getIBCModuleByPort(channel1.portId)), address(mockAppFactory));
43+
assertEq(address(ibcHandler.getIBCModuleByChannel(channel1.portId, channel1.channelId)), address(mockAppFactory.lookupApp(channel1.channelId)));
4044
}
4145
}
4246

0 commit comments

Comments
 (0)