test: Replace importprivkey with wallet_importprivkey
importprivkey was a legacy wallet only RPC which had a helper for descriptor wallets in tests. Add wallet_importprivkey helper and use it wherever importprivkey is used (other than backward compatibility tests)
This commit is contained in:
1 parent
94c87bbbd0
commit
fcc457573f
10 files changed
+33
-26
No files matched your search
@@ -13,6 +13,7 @@ from test_framework.util import (
|
||||
assert_array_result,
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
wallet_importprivkey,
|
||||
)
|
||||
from test_framework.wallet_util import generate_keypair
|
||||
|
||||
@@ -227,10 +228,10 @@ class ListSinceBlockTest(BitcoinTestFramework):
|
||||
address = key_to_p2wpkh(pubkey)
|
||||
self.nodes[2].sendtoaddress(address, 10)
|
||||
self.generate(self.nodes[2], 6)
|
||||
self.nodes[2].importprivkey(privkey)
|
||||
wallet_importprivkey(self.nodes[2], privkey, "now")
|
||||
utxos = self.nodes[2].listunspent()
|
||||
utxo = [u for u in utxos if u["address"] == address][0]
|
||||
self.nodes[1].importprivkey(privkey)
|
||||
wallet_importprivkey(self.nodes[1], privkey, "now")
|
||||
|
||||
# Split network into two
|
||||
self.split_network()
|
||||
|
||||
Reference in new issue
Block a user