mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 03:47:29 -03:00
Make raw multisig tests legacy wallet only in rpc_rawtransaction.py
The traditional multisig workflow doesn't work with descriptor wallets so make these tests legacy wallet only.
This commit is contained in:
parent
59d3da5bce
commit
47d3243160
1 changed files with 109 additions and 94 deletions
|
@ -20,6 +20,7 @@ from test_framework.test_framework import BitcoinTestFramework
|
|||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
find_vout_for_address,
|
||||
hex_str_to_bytes,
|
||||
)
|
||||
|
||||
|
@ -242,6 +243,9 @@ class RawTransactionsTest(BitcoinTestFramework):
|
|||
self.nodes[0].reconsiderblock(block1)
|
||||
assert_equal(self.nodes[0].getbestblockhash(), block2)
|
||||
|
||||
if not self.options.descriptors:
|
||||
# The traditional multisig workflow does not work with descriptor wallets so these are legacy only.
|
||||
# The multisig workflow with descriptor wallets uses PSBTs and is tested elsewhere, no need to do them here.
|
||||
#########################
|
||||
# RAW TX MULTISIG TESTS #
|
||||
#########################
|
||||
|
@ -369,9 +373,20 @@ class RawTransactionsTest(BitcoinTestFramework):
|
|||
decrawtx = self.nodes[0].decoderawtransaction(encrawtx, False) # decode as non-witness transaction
|
||||
assert_equal(decrawtx['vout'][0]['value'], Decimal('1.00000000'))
|
||||
|
||||
# Basic signrawtransaction test
|
||||
addr = self.nodes[1].getnewaddress()
|
||||
txid = self.nodes[0].sendtoaddress(addr, 10)
|
||||
self.nodes[0].generate(1)
|
||||
self.sync_all()
|
||||
vout = find_vout_for_address(self.nodes[1], txid, addr)
|
||||
rawTx = self.nodes[1].createrawtransaction([{'txid': txid, 'vout': vout}], {self.nodes[1].getnewaddress(): 9.999})
|
||||
rawTxSigned = self.nodes[1].signrawtransactionwithwallet(rawTx)
|
||||
txId = self.nodes[1].sendrawtransaction(rawTxSigned['hex'])
|
||||
self.nodes[0].generate(1)
|
||||
self.sync_all()
|
||||
|
||||
# getrawtransaction tests
|
||||
# 1. valid parameters - only supply txid
|
||||
txId = rawTx["txid"]
|
||||
assert_equal(self.nodes[0].getrawtransaction(txId), rawTxSigned['hex'])
|
||||
|
||||
# 2. valid parameters - supply txid and 0 for non-verbose
|
||||
|
|
Loading…
Reference in a new issue