Skip to content

Commit 05340f2

Browse files
This PR refactors test_conway.py align with the new build Method
1 parent 4413e22 commit 05340f2

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

cardano_node_tests/tests/tests_conway/conway_common.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ def cast_vote(
165165
drep_skip_votes: bool = False,
166166
spo_skip_votes: bool = False,
167167
use_build_cmd: bool = True,
168-
build_method: str | None = None,
169168
witness_count_add: int = 0,
170169
) -> governance_utils.VotedVotes:
171170
"""Cast a vote."""
@@ -176,12 +175,6 @@ def cast_vote(
176175
votes_spo = []
177176
anchor_data = governance_utils.get_default_anchor_data()
178177

179-
if build_method is None:
180-
if use_build_cmd:
181-
build_method = clusterlib_utils.BuildMethods.BUILD
182-
else:
183-
build_method = clusterlib_utils.BuildMethods.BUILD_RAW
184-
185178
if approve_cc is not None:
186179
_votes_cc = [
187180
None # This CC member doesn't vote, his votes count as "No"
@@ -290,7 +283,7 @@ def cast_vote(
290283
votes=votes_simple,
291284
keys=keys_all,
292285
script_votes=script_votes,
293-
build_method=build_method,
286+
use_build_cmd=use_build_cmd,
294287
witness_count_add=witness_count_add,
295288
)
296289

cardano_node_tests/tests/tests_conway/test_constitution.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _plutus_cert_rec(
144144
cluster_obj=cluster,
145145
name_template=name_template,
146146
src_address=pool_users[0].payment.address,
147-
build_method=clusterlib_utils.BuildMethods.BUILD,
147+
use_build_cmd=True,
148148
txouts=txouts,
149149
tx_files=tx_files,
150150
)
@@ -240,7 +240,7 @@ def _dereg_stake() -> None:
240240
cluster_obj=cluster,
241241
name_template=f"{temp_template}_dereg",
242242
src_address=pool_users[0].payment.address,
243-
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # Workaround for CLI issue 942
243+
use_build_cmd=False, # Workaround for CLI issue 942
244244
tx_files=tx_files,
245245
withdrawals=withdrawals,
246246
deposit=-sum(s.registration_deposit for __, s in pool_users_info),
@@ -281,7 +281,7 @@ def _retire_dreps() -> None:
281281
cluster_obj=cluster,
282282
name_template=f"{temp_template}_ret",
283283
src_address=pool_users[0].payment.address,
284-
build_method=clusterlib_utils.BuildMethods.BUILD,
284+
use_build_cmd=True,
285285
tx_files=tx_files,
286286
complex_certs=ret_certs,
287287
deposit=-sum(d.deposit for d in drep_script_data),
@@ -425,7 +425,7 @@ def test_change_constitution(
425425
approve_cc=False,
426426
approve_drep=False,
427427
approve_spo=False,
428-
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # cardano-cli issue #650
428+
use_build_cmd=False, # cardano-cli issue #650
429429
)
430430
err_str = str(excinfo.value)
431431
assert "StakePoolVoter" in err_str, err_str
@@ -440,7 +440,7 @@ def test_change_constitution(
440440
action_ix=action_ix,
441441
approve_cc=False,
442442
approve_drep=False,
443-
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # cardano-cli issue #650
443+
use_build_cmd=False, # cardano-cli issue #650
444444
)
445445

446446
# Vote & approve the action
@@ -454,7 +454,7 @@ def test_change_constitution(
454454
action_ix=action_ix,
455455
approve_cc=True,
456456
approve_drep=True,
457-
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # cardano-cli issue #650
457+
use_build_cmd=False, # cardano-cli issue #650
458458
)
459459

460460
assert cluster.g_query.get_epoch() == init_epoch, (
@@ -498,7 +498,7 @@ def _check_cli_query():
498498
action_ix=action_ix,
499499
approve_cc=False,
500500
approve_drep=False,
501-
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # cardano-cli issue #650
501+
use_build_cmd=False, # cardano-cli issue #650
502502
)
503503

504504
next_rat_state = rat_gov_state["nextRatifyState"]
@@ -566,7 +566,7 @@ def _check_cli_query():
566566
action_ix=action_ix,
567567
approve_cc=False,
568568
approve_drep=False,
569-
build_method=clusterlib_utils.BuildMethods.BUILD_RAW, # cardano-cli issue #650
569+
use_build_cmd=False, # cardano-cli issue #650
570570
)
571571
err_str = str(excinfo.value)
572572
assert "(GovActionsDoNotExist" in err_str, err_str

0 commit comments

Comments
 (0)