From a8780c937f730f4fa2ef2045458e3908bb2176e4 Mon Sep 17 00:00:00 2001 From: ismaelsadeeq Date: Sat, 22 Jun 2024 14:13:54 +0100 Subject: [PATCH] test: raise an error if output value is <= 0 in `create_self_transfer` --- test/functional/test_framework/wallet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py index 1cef7147056..32045e2332b 100644 --- a/test/functional/test_framework/wallet.py +++ b/test/functional/test_framework/wallet.py @@ -378,7 +378,8 @@ class MiniWallet: if target_vsize and not fee: # respect fee_rate if target vsize is passed fee = get_fee(target_vsize, fee_rate) send_value = utxo_to_spend["value"] - (fee or (fee_rate * vsize / 1000)) - + if send_value <= 0: + raise RuntimeError(f"UTXO value {utxo_to_spend['value']} is too small to cover fees {(fee or (fee_rate * vsize / 1000))}") # create tx tx = self.create_self_transfer_multi( utxos_to_spend=[utxo_to_spend],