mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-09 01:40:27 +02: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:
@ -20,6 +20,7 @@ from test_framework.test_framework import BitcoinTestFramework
|
|||||||
from test_framework.util import (
|
from test_framework.util import (
|
||||||
assert_equal,
|
assert_equal,
|
||||||
assert_raises_rpc_error,
|
assert_raises_rpc_error,
|
||||||
|
find_vout_for_address,
|
||||||
hex_str_to_bytes,
|
hex_str_to_bytes,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -242,6 +243,9 @@ class RawTransactionsTest(BitcoinTestFramework):
|
|||||||
self.nodes[0].reconsiderblock(block1)
|
self.nodes[0].reconsiderblock(block1)
|
||||||
assert_equal(self.nodes[0].getbestblockhash(), block2)
|
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 #
|
# RAW TX MULTISIG TESTS #
|
||||||
#########################
|
#########################
|
||||||
@ -369,9 +373,20 @@ class RawTransactionsTest(BitcoinTestFramework):
|
|||||||
decrawtx = self.nodes[0].decoderawtransaction(encrawtx, False) # decode as non-witness transaction
|
decrawtx = self.nodes[0].decoderawtransaction(encrawtx, False) # decode as non-witness transaction
|
||||||
assert_equal(decrawtx['vout'][0]['value'], Decimal('1.00000000'))
|
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
|
# getrawtransaction tests
|
||||||
# 1. valid parameters - only supply txid
|
# 1. valid parameters - only supply txid
|
||||||
txId = rawTx["txid"]
|
|
||||||
assert_equal(self.nodes[0].getrawtransaction(txId), rawTxSigned['hex'])
|
assert_equal(self.nodes[0].getrawtransaction(txId), rawTxSigned['hex'])
|
||||||
|
|
||||||
# 2. valid parameters - supply txid and 0 for non-verbose
|
# 2. valid parameters - supply txid and 0 for non-verbose
|
||||||
|
Reference in New Issue
Block a user