wallet, rpc: Remove watchonly from RPCs
Descriptor wallets don't have a conception of watchonly within a wallet, so remove all of these options and results from the RPCs
This commit is contained in:
1 parent
e81d95d435
commit
1337c72198
14 files changed
+135
-242
No files matched your search
@@ -52,15 +52,12 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
|
||||
|
||||
# Address Test - before import
|
||||
address_info = self.nodes[1].getaddressinfo(address1)
|
||||
assert_equal(address_info['iswatchonly'], False)
|
||||
assert_equal(address_info['ismine'], False)
|
||||
|
||||
address_info = self.nodes[1].getaddressinfo(address2)
|
||||
assert_equal(address_info['iswatchonly'], False)
|
||||
assert_equal(address_info['ismine'], False)
|
||||
|
||||
address_info = self.nodes[1].getaddressinfo(address3)
|
||||
assert_equal(address_info['iswatchonly'], False)
|
||||
assert_equal(address_info['ismine'], False)
|
||||
|
||||
# Send funds to self
|
||||
@@ -92,7 +89,7 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
|
||||
wwatch = self.nodes[1].get_wallet_rpc('wwatch')
|
||||
wwatch.importdescriptors([{"desc": self.nodes[0].getaddressinfo(address2)["desc"], "timestamp": "now"}])
|
||||
wwatch.importprunedfunds(rawtransaction=rawtxn2, txoutproof=proof2)
|
||||
assert [tx for tx in wwatch.listtransactions(include_watchonly=True) if tx['txid'] == txnid2]
|
||||
assert [tx for tx in wwatch.listtransactions() if tx['txid'] == txnid2]
|
||||
|
||||
# Import with private key with no rescan
|
||||
w1 = self.nodes[1].get_wallet_rpc(self.default_wallet_name)
|
||||
@@ -104,24 +101,21 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
|
||||
|
||||
# Addresses Test - after import
|
||||
address_info = w1.getaddressinfo(address1)
|
||||
assert_equal(address_info['iswatchonly'], False)
|
||||
assert_equal(address_info['ismine'], False)
|
||||
address_info = wwatch.getaddressinfo(address2)
|
||||
assert_equal(address_info['iswatchonly'], False)
|
||||
assert_equal(address_info['ismine'], True)
|
||||
address_info = w1.getaddressinfo(address3)
|
||||
assert_equal(address_info['iswatchonly'], False)
|
||||
assert_equal(address_info['ismine'], True)
|
||||
|
||||
# Remove transactions
|
||||
assert_raises_rpc_error(-4, f'Transaction {txnid1} does not belong to this wallet', w1.removeprunedfunds, txnid1)
|
||||
assert not [tx for tx in w1.listtransactions(include_watchonly=True) if tx['txid'] == txnid1]
|
||||
assert not [tx for tx in w1.listtransactions() if tx['txid'] == txnid1]
|
||||
|
||||
wwatch.removeprunedfunds(txnid2)
|
||||
assert not [tx for tx in wwatch.listtransactions(include_watchonly=True) if tx['txid'] == txnid2]
|
||||
assert not [tx for tx in wwatch.listtransactions() if tx['txid'] == txnid2]
|
||||
|
||||
w1.removeprunedfunds(txnid3)
|
||||
assert not [tx for tx in w1.listtransactions(include_watchonly=True) if tx['txid'] == txnid3]
|
||||
assert not [tx for tx in w1.listtransactions() if tx['txid'] == txnid3]
|
||||
|
||||
# Check various RPC parameter validation errors
|
||||
assert_raises_rpc_error(-22, "TX decode failed", w1.importprunedfunds, b'invalid tx'.hex(), proof1)
|
||||
|
||||
Reference in new issue
Block a user