From 67906766ef0a5eee402fa60e6d44ee518ae5a7c4 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 21 Jan 2026 16:00:49 +0100 Subject: [PATCH] fix: handle new error message for negative tx balance Update error handling in tests to recognize the new error message "The transaction balance is negative" in addition to the previous message. This ensures tests properly detect and respond to negative transaction balance errors across different cardano-cli versions. --- cardano_node_tests/tests/test_addr_registration.py | 9 +++++---- cardano_node_tests/tests/test_tx_basic.py | 6 +++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cardano_node_tests/tests/test_addr_registration.py b/cardano_node_tests/tests/test_addr_registration.py index da4e863e1..df700bae0 100644 --- a/cardano_node_tests/tests/test_addr_registration.py +++ b/cardano_node_tests/tests/test_addr_registration.py @@ -309,11 +309,12 @@ def test_addr_registration_certificate_order( deposit=deposit, ) except (clusterlib.CLIError, submit_api.SubmitApiError) as exc: - if "(ValueNotConservedUTxO" in str(exc) and VERSIONS.transaction_era >= VERSIONS.CONWAY: + str_exc = str(exc) + if "(ValueNotConservedUTxO" in str_exc and VERSIONS.transaction_era >= VERSIONS.CONWAY: issues.api_484.finish_test() - if ( - build_method == clusterlib_utils.BuildMethods.BUILD_EST - and "does not balance in its use of assets" in str(exc) + if build_method == clusterlib_utils.BuildMethods.BUILD_EST and ( + "The transaction balance is negative" in str_exc + or "does not balance in its use of assets" in str_exc ): issues.cli_1199.finish_test() raise diff --git a/cardano_node_tests/tests/test_tx_basic.py b/cardano_node_tests/tests/test_tx_basic.py index 417c0c656..015be12a9 100644 --- a/cardano_node_tests/tests/test_tx_basic.py +++ b/cardano_node_tests/tests/test_tx_basic.py @@ -508,7 +508,11 @@ def test_transfer_all_build_estimate( tx_files=tx_files, ) except clusterlib.CLIError as exc: - if "balance of the transaction is negative" in str(exc): + str_exc = str(exc) + if ( + "The transaction balance is negative" in str_exc + or "balance of the transaction is negative" in str_exc + ): issues.cli_1199.finish_test() raise