test: Replace importpubkey

This commit is contained in:
Ava Chow committed 2025-05-09 12:31:53 -07:00
1 parent fe838dd391
commit 4d32c19516
5 files changed
+8 -21

No files matched your search

+2 -2
View File
@@ -190,9 +190,9 @@ class RawTransactionsTest(BitcoinTestFramework):
self.nodes[3].createwallet(wallet_name="wwatch", disable_private_keys=True)
wwatch = self.nodes[3].get_wallet_rpc('wwatch')
watchonly_address = self.nodes[0].getnewaddress()
watchonly_pubkey = self.nodes[0].getaddressinfo(watchonly_address)["pubkey"]
self.watchonly_amount = Decimal(200)
wwatch.importpubkey(watchonly_pubkey, label="", rescan=True)
import_res = wwatch.importdescriptors([{"desc": self.nodes[0].getaddressinfo(watchonly_address)["desc"], "timestamp": "now"}])
assert_equal(import_res[0]["success"], True)
self.watchonly_utxo = self.create_outpoints(self.nodes[0], outputs=[{watchonly_address: self.watchonly_amount}])[0]
# Lock UTXO so nodes[0] doesn't accidentally spend it