aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_nulldummy.py
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-04-06 18:13:46 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-11-01 17:54:19 -0500
commit3457679870e8eff2a7d14fe59a479692738c48b6 (patch)
tree8c4bfcc8f83a2f3b0cf2c2e264e8cd81781eae2e /test/functional/feature_nulldummy.py
parenta42652ec10c733a5bf37e418e45d4841f54331b4 (diff)
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/feature_nulldummy.py')
-rwxr-xr-xtest/functional/feature_nulldummy.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/functional/feature_nulldummy.py b/test/functional/feature_nulldummy.py
index d1196a4bbd..b0eac7056b 100755
--- a/test/functional/feature_nulldummy.py
+++ b/test/functional/feature_nulldummy.py
@@ -51,10 +51,18 @@ class NULLDUMMYTest(BitcoinTestFramework):
self.skip_if_no_wallet()
def run_test(self):
- self.address = self.nodes[0].getnewaddress()
- self.ms_address = self.nodes[0].addmultisigaddress(1, [self.address])['address']
- self.wit_address = self.nodes[0].getnewaddress(address_type='p2sh-segwit')
- self.wit_ms_address = self.nodes[0].addmultisigaddress(1, [self.address], '', 'p2sh-segwit')['address']
+ self.nodes[0].createwallet(wallet_name='wmulti', disable_private_keys=True)
+ wmulti = self.nodes[0].get_wallet_rpc('wmulti')
+ w0 = self.nodes[0].get_wallet_rpc(self.default_wallet_name)
+ self.address = w0.getnewaddress()
+ self.pubkey = w0.getaddressinfo(self.address)['pubkey']
+ self.ms_address = wmulti.addmultisigaddress(1, [self.pubkey])['address']
+ self.wit_address = w0.getnewaddress(address_type='p2sh-segwit')
+ self.wit_ms_address = wmulti.addmultisigaddress(1, [self.pubkey], '', 'p2sh-segwit')['address']
+ if not self.options.descriptors:
+ # Legacy wallets need to import these so that they are watched by the wallet. This is unnecssary (and does not need to be tested) for descriptor wallets
+ wmulti.importaddress(self.ms_address)
+ wmulti.importaddress(self.wit_ms_address)
self.coinbase_blocks = self.nodes[0].generate(2) # Block 2
coinbase_txid = []