Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cardano_node_tests/tests/tests_conway/conway_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def cast_vote(
drep_skip_votes: bool = False,
spo_skip_votes: bool = False,
use_build_cmd: bool = True,
build_method: str | None = None,
witness_count_add: int = 0,
) -> governance_utils.VotedVotes:
"""Cast a vote."""
Expand All @@ -175,6 +176,12 @@ def cast_vote(
votes_spo = []
anchor_data = governance_utils.get_default_anchor_data()

if build_method is None:
if use_build_cmd:
build_method = clusterlib_utils.BuildMethods.BUILD
else:
build_method = clusterlib_utils.BuildMethods.BUILD_RAW

if approve_cc is not None:
_votes_cc = [
None # This CC member doesn't vote, his votes count as "No"
Expand Down Expand Up @@ -283,7 +290,7 @@ def cast_vote(
votes=votes_simple,
keys=keys_all,
script_votes=script_votes,
use_build_cmd=use_build_cmd,
build_method=build_method,
witness_count_add=witness_count_add,
)

Expand Down
16 changes: 8 additions & 8 deletions cardano_node_tests/tests/tests_conway/test_constitution.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _plutus_cert_rec(
cluster_obj=cluster,
name_template=name_template,
src_address=pool_users[0].payment.address,
use_build_cmd=True,
build_method=clusterlib_utils.BuildMethods.BUILD,
txouts=txouts,
tx_files=tx_files,
)
Expand Down Expand Up @@ -240,7 +240,7 @@ def _dereg_stake() -> None:
cluster_obj=cluster,
name_template=f"{temp_template}_dereg",
src_address=pool_users[0].payment.address,
use_build_cmd=False, # Workaround for CLI issue 942
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # Workaround for CLI issue 942
tx_files=tx_files,
withdrawals=withdrawals,
deposit=-sum(s.registration_deposit for __, s in pool_users_info),
Expand Down Expand Up @@ -281,7 +281,7 @@ def _retire_dreps() -> None:
cluster_obj=cluster,
name_template=f"{temp_template}_ret",
src_address=pool_users[0].payment.address,
use_build_cmd=True,
build_method=clusterlib_utils.BuildMethods.BUILD,
tx_files=tx_files,
complex_certs=ret_certs,
deposit=-sum(d.deposit for d in drep_script_data),
Expand Down Expand Up @@ -425,7 +425,7 @@ def test_change_constitution(
approve_cc=False,
approve_drep=False,
approve_spo=False,
use_build_cmd=False, # cardano-cli issue #650
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # cardano-cli issue #650
)
err_str = str(excinfo.value)
assert "StakePoolVoter" in err_str, err_str
Expand All @@ -440,7 +440,7 @@ def test_change_constitution(
action_ix=action_ix,
approve_cc=False,
approve_drep=False,
use_build_cmd=False, # cardano-cli issue #650
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # cardano-cli issue #650
)

# Vote & approve the action
Expand All @@ -454,7 +454,7 @@ def test_change_constitution(
action_ix=action_ix,
approve_cc=True,
approve_drep=True,
use_build_cmd=False, # cardano-cli issue #650
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # cardano-cli issue #650
)

assert cluster.g_query.get_epoch() == init_epoch, (
Expand Down Expand Up @@ -498,7 +498,7 @@ def _check_cli_query():
action_ix=action_ix,
approve_cc=False,
approve_drep=False,
use_build_cmd=False, # cardano-cli issue #650
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # cardano-cli issue #650
)

next_rat_state = rat_gov_state["nextRatifyState"]
Expand Down Expand Up @@ -566,7 +566,7 @@ def _check_cli_query():
action_ix=action_ix,
approve_cc=False,
approve_drep=False,
use_build_cmd=False, # cardano-cli issue #650
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # cardano-cli issue #650
)
err_str = str(excinfo.value)
assert "(GovActionsDoNotExist" in err_str, err_str
Expand Down
Loading