Skip to content

Commit

Permalink
Fix script to catch the packets not cleared on start
Browse files Browse the repository at this point in the history
  • Loading branch information
ancazamfir committed Jul 14, 2021
1 parent a0c9a78 commit 5bab89b
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions e2e/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,35 @@ def passive_packets(
sleep(10.0)

# 6. verify that there are no pending packets
# hermes query packet unreceived-packets ibc-1 transfer channel-1
unreceived = packet.query_unreceived_packets(
c, chain=ibc1, port=port_id, channel=ibc1_channel_id)

assert (len(unreceived) == 0), (unreceived,
"unreceived packets mismatch (expected 0)")

# hermes query packet unreceived-acks ibc-1 transfer channel-1
unreceived = packet.query_unreceived_acks(
c, chain=ibc1, port=port_id, channel=ibc1_channel_id)

assert (len(unreceived) == 0), (unreceived,
"unreceived acks mismatch (expected 0)")

# hermes query packet unreceived-packets ibc-0 transfer channel-0
unreceived = packet.query_unreceived_packets(
c, chain=ibc0 , port=port_id, channel=ibc0_channel_id)

assert (len(unreceived) == 0), (unreceived,
"unreceived packets mismatch (expected 0)")

# hermes query packet unreceived-acks ibc-0 transfer channel-0
unreceived = packet.query_unreceived_acks(
c, chain=ibc0 , port=port_id, channel=ibc0_channel_id)

assert (len(unreceived) == 0), (unreceived,
"unreceived acks mismatch (expected 0)")

# 7. send some packets
# hermes tx raw ft-transfer ibc-0 ibc-1 transfer channel-1 10000 1000 -n 3
packet.packet_send(c, src=ibc1, dst=ibc0 , src_port=port_id,
src_channel=ibc1_channel_id, amount=10000, height_offset=1000, number_msgs=3)
Expand All @@ -93,7 +122,7 @@ def passive_packets(
src_channel=ibc0_channel_id, amount=10000, height_offset=1000, number_msgs=4)

sleep(10.0)

# 8. verify that there are no pending packets
# hermes query packet unreceived-packets ibc-1 transfer channel-1
unreceived = packet.query_unreceived_packets(
c, chain=ibc1, port=port_id, channel=ibc1_channel_id)
Expand Down Expand Up @@ -121,8 +150,7 @@ def passive_packets(

assert (len(unreceived) == 0), (unreceived,
"unreceived acks mismatch (expected 0)")

# 7.Stop the relayer
# 9.Stop the relayer
proc.kill()


Expand Down Expand Up @@ -216,7 +244,6 @@ def main():
passive_packets(config, ibc0, ibc1, port_id, ibc0_chan_id, ibc1_chan_id)
sleep(2.0)


connection.passive_connection_init_then_start(config, ibc1, ibc0, ibc1_client_id, ibc0_client_id)
sleep(2.0)

Expand Down

0 comments on commit 5bab89b

Please sign in to comment.