diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-04-06 18:13:46 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-11-01 17:54:19 -0500 |
commit | 3457679870e8eff2a7d14fe59a479692738c48b6 (patch) | |
tree | 8c4bfcc8f83a2f3b0cf2c2e264e8cd81781eae2e /test/functional/test_framework/blocktools.py | |
parent | a42652ec10c733a5bf37e418e45d4841f54331b4 (diff) | |
download | bitcoin-3457679870e8eff2a7d14fe59a479692738c48b6.tar.xz |
Use separate watchonly wallet for multisig in feature_nulldummy.py
Create and import the multisig into a separate watchonly wallet so that
feature_nulldummy.py works with descriptor wallets.
blocktools.create_raw_transaction is also updated to use multiple nodes
and wallets and to use PSBT so that this test passes.
Diffstat (limited to 'test/functional/test_framework/blocktools.py')
-rw-r--r-- | test/functional/test_framework/blocktools.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py index 0859380d06..64bc7e0485 100644 --- a/test/functional/test_framework/blocktools.py +++ b/test/functional/test_framework/blocktools.py @@ -162,9 +162,8 @@ def create_tx_with_script(prevtx, n, script_sig=b"", *, amount, script_pub_key=C def create_transaction(node, txid, to_address, *, amount): """ Return signed transaction spending the first output of the - input txid. Note that the node must be able to sign for the - output that is being spent, and the node must not be running - multiple wallets. + input txid. Note that the node must have a wallet that can + sign for the output that is being spent. """ raw_tx = create_raw_transaction(node, txid, to_address, amount=amount) tx = CTransaction() @@ -173,14 +172,18 @@ def create_transaction(node, txid, to_address, *, amount): def create_raw_transaction(node, txid, to_address, *, amount): """ Return raw signed transaction spending the first output of the - input txid. Note that the node must be able to sign for the - output that is being spent, and the node must not be running - multiple wallets. + input txid. Note that the node must have a wallet that can sign + for the output that is being spent. """ - rawtx = node.createrawtransaction(inputs=[{"txid": txid, "vout": 0}], outputs={to_address: amount}) - signresult = node.signrawtransactionwithwallet(rawtx) - assert_equal(signresult["complete"], True) - return signresult['hex'] + psbt = node.createpsbt(inputs=[{"txid": txid, "vout": 0}], outputs={to_address: amount}) + for _ in range(2): + for w in node.listwallets(): + wrpc = node.get_wallet_rpc(w) + signed_psbt = wrpc.walletprocesspsbt(psbt) + psbt = signed_psbt['psbt'] + final_psbt = node.finalizepsbt(psbt) + assert_equal(final_psbt["complete"], True) + return final_psbt['hex'] def get_legacy_sigopcount_block(block, accurate=True): count = 0 |