From 83901dcdd01749cd381922d0f8111517c00dee17 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 21 Jun 2024 22:55:43 +0200 Subject: [PATCH] Xfail on CLI issue 800 https://github.com/IntersectMBO/cardano-cli/issues/800 --- cardano_node_tests/tests/issues.py | 6 ++++++ .../tests_plutus/test_spend_datum_build.py | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/cardano_node_tests/tests/issues.py b/cardano_node_tests/tests/issues.py index c1ae4b7e2..960050e24 100644 --- a/cardano_node_tests/tests/issues.py +++ b/cardano_node_tests/tests/issues.py @@ -57,6 +57,12 @@ fixed_in="8.24.0.1", # Fixed in a release after 8.24.0.0 message="Conway era fields shown in Babbage Tx.", ) +cli_800 = blockers.GH( + issue=800, + repo="IntersectMBO/cardano-cli", + fixed_in="8.24.0.1", # Fixed in a release after 8.24.0.0 + message="Datum not checked for PlutusV1 and PlutusV2 spending scripts.", +) consensus_973 = blockers.GH( issue=973, diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_datum_build.py b/cardano_node_tests/tests/tests_plutus/test_spend_datum_build.py index 327eef5d7..97458825b 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_datum_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_datum_build.py @@ -236,7 +236,7 @@ def test_no_datum_txout( ) txouts = [ - clusterlib.TxOut(address=redeem_address, amount=amount + redeem_cost.fee), + clusterlib.TxOut(address=redeem_address, amount=amount + redeem_cost.fee + 5_000_000), clusterlib.TxOut(address=payment_addr.address, amount=redeem_cost.collateral), ] tx_files = clusterlib.TxFiles(signing_key_files=[payment_addr.skey_file]) @@ -259,7 +259,8 @@ def test_no_datum_txout( script_utxos = clusterlib.filter_utxos(utxos=out_utxos, utxo_ix=utxo_ix_offset) collateral_utxos = clusterlib.filter_utxos(utxos=out_utxos, utxo_ix=utxo_ix_offset + 1) - with pytest.raises(clusterlib.CLIError) as excinfo: + err_str = "" + try: spend_build._build_spend_locked_txin( temp_template=temp_template, cluster_obj=cluster, @@ -271,7 +272,10 @@ def test_no_datum_txout( amount=amount, submit_tx=False, ) - err_str = str(excinfo.value) + except clusterlib.CLIError as exc: + err_str = str(exc) + else: + issues.cli_800.finish_test() if address_type == "script_address": assert "txin does not have a script datum" in err_str, err_str @@ -362,7 +366,8 @@ def test_unlock_tx_wrong_datum( execution_cost=plutus_common.ALWAYS_SUCCEEDS[plutus_version].execution_cost, ) - with pytest.raises(clusterlib.CLIError) as excinfo: + err_str = "" + try: spend_build._build_spend_locked_txin( temp_template=temp_template, cluster_obj=cluster, @@ -374,8 +379,11 @@ def test_unlock_tx_wrong_datum( amount=2_000_000, submit_tx=False, ) + except clusterlib.CLIError as exc: + err_str = str(exc) + else: + issues.cli_800.finish_test() - err_str = str(excinfo.value) assert ( "The Plutus script witness has the wrong datum (according to the UTxO)." in err_str ), err_str