Skip to content

Commit 3d76f83

Browse files
committed
fix balance change in timeout test
1 parent 13b06c8 commit 3d76f83

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

integration_tests/cosmoscli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ def transfer_tokens(self, from_, to, amount, **kwargs):
12501250
"gas": "auto",
12511251
"gas_adjustment": "1.5",
12521252
}
1253-
return json.loads(
1253+
rsp = json.loads(
12541254
self.raw(
12551255
"tx",
12561256
"cronos",
@@ -1264,6 +1264,9 @@ def transfer_tokens(self, from_, to, amount, **kwargs):
12641264
**(default_kwargs | kwargs),
12651265
)
12661266
)
1267+
if rsp["code"] == 0:
1268+
rsp = self.event_query_tx_for(rsp["txhash"])
1269+
return rsp
12671270

12681271
def icaauth_register_account(self, connid, **kwargs):
12691272
"execute on host chain to attach an account to the connection"

integration_tests/test_ibc_timeout.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,18 @@ def test_cronos_transfer_timeout(ibc):
6060
)
6161
assert rsp["code"] == 0, rsp["raw_log"]
6262

63-
new_src_balance = 0
64-
6563
def check_balance_change():
66-
nonlocal new_src_balance
64+
new_src_balance = get_balance(ibc.cronos, src_addr, src_denom)
65+
get_balance(ibc.chainmain, dst_addr, dst_denom)
66+
return old_src_balance != new_src_balance
67+
68+
wait_for_fn("balance has change", check_balance_change)
69+
70+
def check_no_change():
6771
new_src_balance = get_balance(ibc.cronos, src_addr, src_denom)
6872
get_balance(ibc.chainmain, dst_addr, dst_denom)
6973
return old_src_balance == new_src_balance
7074

71-
wait_for_fn("balance no change", check_balance_change)
75+
wait_for_fn("balance no change", check_no_change)
7276
new_dst_balance = get_balance(ibc.chainmain, dst_addr, dst_denom)
7377
assert old_dst_balance == new_dst_balance

0 commit comments

Comments
 (0)