Skip to content

Commit

Permalink
Move the least important checks to the end of test
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoura committed Jul 11, 2024
1 parent 2564185 commit 8db0dc5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
34 changes: 17 additions & 17 deletions cardano_node_tests/tests/tests_conway/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,23 +233,6 @@ def test_info(
], "Ratification is delayed unexpectedly"
reqc.cip038_05.success()

# Check action view
governance_utils.check_action_view(cluster_obj=cluster, action_data=info_action)

# Check vote view
reqc.cli022.start(url=helpers.get_vcs_link())
if votes_cc:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_cc[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_drep[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_spo[0])
reqc.cli022.success()

# Check dbsync
dbsync_utils.check_votes(
votes=governance_utils.VotedVotes(cc=votes_cc, drep=votes_drep, spo=votes_spo),
txhash=vote_txid,
)

# Check deposit is returned
reqc.cip034ex.start(url=helpers.get_vcs_link())

Expand All @@ -267,3 +250,20 @@ def test_info(
deposit_returned == init_return_account_balance + action_deposit_amt
), "Incorrect return account balance"
reqc.cip034ex.success()

# Check action view
governance_utils.check_action_view(cluster_obj=cluster, action_data=info_action)

# Check vote view
reqc.cli022.start(url=helpers.get_vcs_link())
if votes_cc:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_cc[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_drep[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_spo[0])
reqc.cli022.success()

# Check dbsync
dbsync_utils.check_votes(
votes=governance_utils.VotedVotes(cc=votes_cc, drep=votes_drep, spo=votes_spo),
txhash=vote_txid,
)
12 changes: 6 additions & 6 deletions cardano_node_tests/tests/tests_conway/test_pparam_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,12 +1249,6 @@ def _check_state(state: dict):
err_str = str(excinfo.value)
assert "(GovActionsDoNotExist" in err_str, err_str

# Check vote view
if fin_voted_votes.cc:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.cc[0])
if fin_voted_votes.drep:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.drep[0])

# Check deposit return for both after enactment and expiration
_url = helpers.get_vcs_link()
[r.start(url=_url) for r in (reqc.cip034ex, reqc.cip034en)]
Expand All @@ -1276,6 +1270,12 @@ def _check_state(state: dict):
), "Incorrect return account balance"
[r.success() for r in (reqc.cip034ex, reqc.cip034en)]

# Check vote view
if fin_voted_votes.cc:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.cc[0])
if fin_voted_votes.drep:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.drep[0])

if db_errors_final:
raise AssertionError("\n".join(db_errors_final))
[r.success() for r in (reqc.cip080, reqc.cip081, reqc.cip082, reqc.cip083)]
Expand Down

0 comments on commit 8db0dc5

Please sign in to comment.