Skip to content

Commit 80886f6

Browse files
committed
feat(treasury_withdrawals): add version check for CLI error
- Added a version check for CLI error handling in the treasury withdrawals test. - Modified to use transaction build-raw command.
1 parent 17728c8 commit 80886f6

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import allure
77
import pytest
88
from cardano_clusterlib import clusterlib
9+
from packaging import version
910

1011
from cardano_node_tests.cluster_management import cluster_management
1112
from cardano_node_tests.tests import common
@@ -176,28 +177,43 @@ def test_enact_treasury_withdrawals(
176177
reqc.cip026_03.success()
177178
return
178179

180+
if VERSIONS.cli > version.parse("10.1.1.0"):
181+
with pytest.raises(clusterlib.CLIError) as excinfo:
182+
clusterlib_utils.build_and_submit_tx(
183+
cluster_obj=cluster,
184+
name_template=f"{temp_template}_action_build",
185+
src_address=pool_user_ug_treasury.payment.address,
186+
use_build_cmd=True,
187+
tx_files=tx_files_action,
188+
)
189+
err_str = str(excinfo.value)
190+
assert (
191+
"Stake credential specified in the proposal is not registered on-chain" in err_str
192+
), err_str
193+
179194
# Make sure we have enough time to submit the proposals in one epoch
180195
clusterlib_utils.wait_for_epoch_interval(
181196
cluster_obj=cluster, start=1, stop=common.EPOCH_STOP_SEC_BUFFER
182197
)
183198

199+
actions_deposit_combined = action_deposit_amt * actions_num
200+
184201
tx_output_action = clusterlib_utils.build_and_submit_tx(
185202
cluster_obj=cluster,
186-
name_template=f"{temp_template}_action",
203+
name_template=f"{temp_template}_action_build_raw",
187204
src_address=pool_user_ug_treasury.payment.address,
188205
submit_method=submit_utils.SubmitMethods.API
189206
if submit_utils.is_submit_api_available()
190207
else submit_utils.SubmitMethods.CLI,
191-
use_build_cmd=True,
208+
use_build_cmd=False,
192209
tx_files=tx_files_action,
210+
deposit=actions_deposit_combined + stake_deposit_amt,
193211
)
194212

195213
assert cluster.g_query.get_stake_addr_info(
196214
recv_stake_addr_rec.address
197215
).address, f"Stake address is not registered: {recv_stake_addr_rec.address}"
198216

199-
actions_deposit_combined = action_deposit_amt * actions_num
200-
201217
out_utxos_action = cluster.g_query.get_utxo(tx_raw_output=tx_output_action)
202218
assert (
203219
clusterlib.filter_utxos(

0 commit comments

Comments
 (0)