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/rpc_generateblock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/rpc_generateblock.py') diff --git a/test/functional/rpc_generateblock.py b/test/functional/rpc_generateblock.py index 7aede0e947..7eeb745817 100755 --- a/test/functional/rpc_generateblock.py +++ b/test/functional/rpc_generateblock.py @@ -63,7 +63,7 @@ class GenerateBlockTest(BitcoinTestFramework): assert_equal(block['tx'][1], txid) self.log.info('Generate block with raw tx') - rawtx = miniwallet.create_self_transfer(from_node=node)['hex'] + rawtx = miniwallet.create_self_transfer()['hex'] hash = self.generateblock(node, address, [rawtx])['hash'] block = node.getblock(hash, 1) @@ -74,7 +74,7 @@ class GenerateBlockTest(BitcoinTestFramework): self.log.info('Fail to generate block with out of order txs') txid1 = miniwallet.send_self_transfer(from_node=node)['txid'] utxo1 = miniwallet.get_utxo(txid=txid1) - rawtx2 = miniwallet.create_self_transfer(from_node=node, utxo_to_spend=utxo1)['hex'] + rawtx2 = miniwallet.create_self_transfer(utxo_to_spend=utxo1)['hex'] assert_raises_rpc_error(-25, 'TestBlockValidity failed: bad-txns-inputs-missingorspent', self.generateblock, node, address, [rawtx2, txid1]) self.log.info('Fail to generate block with txid not in mempool') -- cgit v1.2.3