mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-26 15:36:19 +01:00
test: Replace importpubkey
This commit is contained in:
@@ -27,7 +27,6 @@ from .authproxy import (
|
||||
JSONRPCException,
|
||||
serialization_fallback,
|
||||
)
|
||||
from .descriptors import descsum_create
|
||||
from .messages import NODE_P2P_V2
|
||||
from .p2p import P2P_SERVICES, P2P_SUBVERSION
|
||||
from .util import (
|
||||
@@ -930,17 +929,3 @@ class RPCOverloadWrapper():
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(self.rpc, name)
|
||||
|
||||
def importpubkey(self, pubkey, *, label=None, rescan=None):
|
||||
wallet_info = self.getwalletinfo()
|
||||
if 'descriptors' not in wallet_info or ('descriptors' in wallet_info and not wallet_info['descriptors']):
|
||||
return self.__getattr__('importpubkey')(pubkey, label, rescan)
|
||||
desc = descsum_create('combo(' + pubkey + ')')
|
||||
req = [{
|
||||
'desc': desc,
|
||||
'timestamp': 0 if rescan else 'now',
|
||||
'label': label if label else '',
|
||||
}]
|
||||
import_res = self.importdescriptors(req)
|
||||
if not import_res[0]['success']:
|
||||
raise JSONRPCException(import_res[0]['error'])
|
||||
|
||||
Reference in New Issue
Block a user