From b24f6c6855bdd09bf445faeebe9d54c3d07a46d9 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Tue, 11 Jan 2022 15:39:57 +0100 Subject: 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. --- test/functional/test_framework/wallet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/functional/test_framework') 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 -- cgit v1.2.3