From 18e83534ace7aa2d26bc7dfa521b1d591b66edfa Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 4 Mar 2025 16:29:43 +0000 Subject: [PATCH] wallet: Replace "non-0" with "non-zero" in translatable error message Transifex interprets the "-0" substring as a number in translatable strings. Since not all translations preserve "-0," this triggers a corresponding warning. While this warning could be disabled globally, it is more reasonable to adjust the original string instead. --- src/wallet/spend.cpp | 2 +- test/functional/rpc_psbt.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index f45db1c16f3..7b26cf15bd3 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -1138,7 +1138,7 @@ static util::Result CreateTransactionInternal( // This can only happen if feerate is 0, and requested destinations are value of 0 (e.g. OP_RETURN) // and no pre-selected inputs. This will result in 0-input transaction, which is consensus-invalid anyways if (selection_target == 0 && !coin_control.HasSelected()) { - return util::Error{_("Transaction requires one destination of non-0 value, a non-0 feerate, or a pre-selected input")}; + return util::Error{_("Transaction requires one destination of non-zero value, a non-zero feerate, or a pre-selected input")}; } // Fetch manually selected coins diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index 8042bdf0715..04e68a97af7 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -999,7 +999,7 @@ class PSBTTest(BitcoinTestFramework): {'hex': '0200000001dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd0000000000000000000100000000000000000000000000', 'complete': True}) self.log.info("Test we don't crash when making a 0-value funded transaction at 0 fee without forcing an input selection") - assert_raises_rpc_error(-4, "Transaction requires one destination of non-0 value, a non-0 feerate, or a pre-selected input", self.nodes[0].walletcreatefundedpsbt, [], [{"data": "deadbeef"}], 0, {"fee_rate": "0"}) + assert_raises_rpc_error(-4, "Transaction requires one destination of non-zero value, a non-zero feerate, or a pre-selected input", self.nodes[0].walletcreatefundedpsbt, [], [{"data": "deadbeef"}], 0, {"fee_rate": "0"}) self.log.info("Test descriptorprocesspsbt updates and signs a psbt with descriptors")