Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Sep 26, 2024
1 parent 243b7a8 commit 1bdcd03
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 11 additions & 3 deletions integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,16 @@ def staking_pool(self, bonded=True):
res = res.get("pool") or res
return int(res["bonded_tokens" if bonded else "not_bonded_tokens"])

def transfer(self, from_, to, coins, generate_only=False, fees=None, **kwargs):
def transfer(
self,
from_,
to,
coins,
generate_only=False,
event_query_tx=True,
fees=None,
**kwargs,
):
kwargs.setdefault("gas_prices", DEFAULT_GAS_PRICE)
rsp = json.loads(
self.raw(
Expand All @@ -382,7 +391,7 @@ def transfer(self, from_, to, coins, generate_only=False, fees=None, **kwargs):
**kwargs,
)
)
if rsp["code"] == 0:
if rsp["code"] == 0 and event_query_tx:
rsp = self.event_query_tx_for(rsp["txhash"])
return rsp

Expand Down Expand Up @@ -1837,7 +1846,6 @@ def event_query_tx_for(self, hash):
"event-query-tx-for",
hash,
home=self.data_dir,
stderr=subprocess.DEVNULL,
)
)

Expand Down
8 changes: 4 additions & 4 deletions integration_tests/test_e2ee.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ def test_block_list(cronos):
with pytest.raises(AssertionError) as exc:

Check failure on line 97 in integration_tests/test_e2ee.py

View workflow job for this annotation

GitHub Actions / integration_tests (unmarked)

test_block_list[True] Failed: DID NOT RAISE <class 'AssertionError'>
cli.event_query_tx_for(txhash)
assert "timed out waiting" in str(exc.value)
nonce = int(cli.query_account(user)["base_account"]["sequence"])
nonce = int(cli.query_account(user)["account"]["value"]["sequence"])

# clear blocklist
encrypt_to_validators(cli, {})

# the blocked tx should be unblocked now
wait_for_new_blocks(cli, 1)
assert nonce + 1 == int(cli.query_account(user)["base_account"]["sequence"])
assert nonce + 1 == int(cli.query_account(user)["account"]["value"]["sequence"])


def test_block_list_evm(cronos):
Expand All @@ -125,7 +125,7 @@ def test_block_list_evm(cronos):
assert flt.get_new_entries() == []

txhash = w3.eth.send_transaction(tx).hex()
nonce = int(cli.query_account(user)["base_account"]["sequence"])
nonce = int(cli.query_account(user)["account"]["value"]["sequence"])
# check tx in mempool
assert HexBytes(txhash) in w3.eth.get_filter_changes(flt.filter_id)

Expand All @@ -134,7 +134,7 @@ def test_block_list_evm(cronos):

# the blocked tx should be unblocked now
wait_for_new_blocks(cli, 1)
assert nonce + 1 == int(cli.query_account(user)["base_account"]["sequence"])
assert nonce + 1 == int(cli.query_account(user)["account"]["value"]["sequence"])
assert w3.eth.get_filter_changes(flt.filter_id) == []


Expand Down

0 comments on commit 1bdcd03

Please sign in to comment.