Skip to content

Commit

Permalink
Merge pull request #1211 from mkoura/log_utxos_on_err
Browse files Browse the repository at this point in the history
Log vote UTxOs on error
  • Loading branch information
mkoura committed Jun 29, 2022
2 parents db305b8 + 9a76bee commit ae6c70e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cardano_node_tests/tests/test_plutus_lobster.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,22 @@ def test_lobster_name(
vote_utxos = cluster.get_utxo(txin=f"{txid_vote}#1")

# check expected balances
utxos_lovelace = [u for u in vote_utxos if u.coin == clusterlib.DEFAULT_COIN][0]
try:
utxos_lovelace = [u for u in vote_utxos if u.coin == clusterlib.DEFAULT_COIN][0]
utxo_votes_token = [u for u in vote_utxos if u.coin == votes_token][0]
utxo_counter_token = [u for u in vote_utxos if u.coin == counter_token][0]
except IndexError:
LOGGER.error(f"Unexpected vote UTxOs: {vote_utxos}")
raise

assert (
utxos_lovelace.amount == lovelace_vote_amount
), f"Incorrect Lovelace balance for script address `{script_address}`"

utxo_votes_token = [u for u in vote_utxos if u.coin == votes_token][0]
assert (
utxo_votes_token.amount == vote_num
), f"Incorrect LobsterVotes token balance for script address `{script_address}`"

utxo_counter_token = [u for u in vote_utxos if u.coin == counter_token][0]
assert (
utxo_counter_token.amount == vote_counter
), f"Incorrect LobsterCounter token balance for script address `{script_address}`"
Expand Down

0 comments on commit ae6c70e

Please sign in to comment.