Skip to content

Commit

Permalink
[test]: raise exception if output value is <= 0 in `create_self_trans…
Browse files Browse the repository at this point in the history
…fer`
  • Loading branch information
ismaelsadeeq committed Jun 25, 2024
1 parent d3b8b5a commit e26399d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/functional/test_framework/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ def create_self_transfer(
max_actual_weight = target_weight + BULK_TX_PADDING_OFFSET
fee = get_fee(math.ceil(max_actual_weight / WITNESS_SCALE_FACTOR), fee_rate)
send_value = utxo_to_spend["value"] - (fee or (fee_rate * vsize / 1000))

if send_value <= 0:
raise Exception(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],
Expand Down

0 comments on commit e26399d

Please sign in to comment.