mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 12:55:02 +02:00
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:
@@ -35,6 +35,7 @@ from .util import (
|
||||
initialize_datadir,
|
||||
p2p_port,
|
||||
wait_until_helper_internal,
|
||||
wallet_importprivkey,
|
||||
)
|
||||
|
||||
|
||||
@@ -485,7 +486,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
n = self.nodes[node]
|
||||
if wallet_name is not None:
|
||||
n.createwallet(wallet_name=wallet_name, load_on_startup=True)
|
||||
n.importprivkey(privkey=n.get_deterministic_priv_key().key, label='coinbase', rescan=True)
|
||||
wallet_importprivkey(n.get_wallet_rpc(wallet_name), n.get_deterministic_priv_key().key, 0, label="coinbase")
|
||||
|
||||
def run_test(self):
|
||||
"""Tests must override this method to define test logic"""
|
||||
|
||||
Reference in New Issue
Block a user