Skip to content

Commit

Permalink
Merge pull request #2473 from IntersectMBO/minor_test_changes
Browse files Browse the repository at this point in the history
Minor tests changes
  • Loading branch information
mkoura committed Jul 11, 2024
2 parents 4b2c0e9 + 8db0dc5 commit b8c075d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 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,
)
17 changes: 9 additions & 8 deletions cardano_node_tests/tests/tests_conway/test_pparam_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,14 +1249,9 @@ 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
[r.start(url=helpers.get_vcs_link()) for r in (reqc.cip034ex, reqc.cip034en)]
_url = helpers.get_vcs_link()
[r.start(url=_url) for r in (reqc.cip034ex, reqc.cip034en)]

# First wait to ensure that all proposals are expired/enacted for deposit to be retuned
_cur_epoch = cluster.g_query.get_epoch()
Expand All @@ -1268,13 +1263,19 @@ def _check_state(state: dict):
total_deposit_return = cluster.g_query.get_stake_addr_info(
pool_user_lg.stake.address
).reward_account_balance
# Check total deposit return accounting for both expired and enaacted actions
# Check total deposit return accounting for both expired and enacted actions
assert (
total_deposit_return
== init_return_account_balance + deposit_amt * submitted_proposal_count
), "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 b8c075d

Please sign in to comment.