aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2022-01-11 15:39:57 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2022-01-11 16:22:33 +0100
commitb24f6c6855bdd09bf445faeebe9d54c3d07a46d9 (patch)
treeb7645a31b535818d56e7724dd39204a319535555 /test/functional/test_framework
parentf30041c9143d0added18105c9f0c4ae3f340efbc (diff)
downloadbitcoin-b24f6c6855bdd09bf445faeebe9d54c3d07a46d9.tar.xz
test: MiniWallet: support default `from_node` for creating txs
If no `from_node` parameter is passed explicitely to the `create_self_transfer` method, the test node passed in the course of creating the MiniWallet instance is used. This seems to be the main use-case in most of the current functional tests, i.e. in many instances the calls can be shortened.
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r--test/functional/test_framework/wallet.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py
index 9158dd0942..fc0a7eb2e4 100644
--- a/test/functional/test_framework/wallet.py
+++ b/test/functional/test_framework/wallet.py
@@ -179,8 +179,9 @@ class MiniWallet:
txid = self.sendrawtransaction(from_node=from_node, tx_hex=tx.serialize().hex())
return txid, 1
- def create_self_transfer(self, *, fee_rate=Decimal("0.003"), from_node, utxo_to_spend=None, mempool_valid=True, locktime=0, sequence=0):
+ def create_self_transfer(self, *, fee_rate=Decimal("0.003"), from_node=None, utxo_to_spend=None, mempool_valid=True, locktime=0, sequence=0):
"""Create and return a tx with the specified fee_rate. Fee may be exact or at most one satoshi higher than needed."""
+ from_node = from_node or self._test_node
utxo_to_spend = utxo_to_spend or self.get_utxo()
if self._priv_key is None:
vsize = Decimal(104) # anyone-can-spend