diff --git a/jmclient/jmclient/blockchaininterface.py b/jmclient/jmclient/blockchaininterface.py index bc0ccdb..67b8648 100644 --- a/jmclient/jmclient/blockchaininterface.py +++ b/jmclient/jmclient/blockchaininterface.py @@ -1,16 +1,10 @@ from __future__ import print_function -import BaseHTTPServer import abc import ast -import json -import os -import pprint import random -import re import sys import time -import traceback import binascii from decimal import Decimal from twisted.internet import reactor, task @@ -19,7 +13,7 @@ import btc from jmclient.jsonrpc import JsonRpcConnectionError, JsonRpcError from jmclient.configure import get_p2pk_vbyte, jm_single -from jmbase.support import get_log, chunks +from jmbase.support import get_log log = get_log() @@ -425,9 +419,6 @@ class BitcoinCoreInterface(BlockchainInterface): Bitcoin Core instance, in which case "fast" should have been specifically disabled by the user. """ - from jmclient.wallet import BitcoinCoreWallet - if isinstance(wallet, BitcoinCoreWallet): - return wallet_name = self.get_wallet_name(wallet) agd = self.rpc('listaddressgroupings', []) #flatten all groups into a single list; then, remove duplicates @@ -516,10 +507,6 @@ class BitcoinCoreInterface(BlockchainInterface): def sync_addresses(self, wallet, restart_cb=None): - from jmclient.wallet import BitcoinCoreWallet - - if isinstance(wallet, BitcoinCoreWallet): - return log.debug('requesting detailed wallet history') wallet_name = self.get_wallet_name(wallet) #TODO It is worth considering making this user configurable: @@ -653,10 +640,6 @@ class BitcoinCoreInterface(BlockchainInterface): self.unspent_monitoring_loop.stop() def sync_unspent(self, wallet): - from jmclient.wallet import BitcoinCoreWallet - - if isinstance(wallet, BitcoinCoreWallet): - return st = time.time() wallet_name = self.get_wallet_name(wallet) wallet.unspent = {} diff --git a/jmclient/test/test_wallets.py b/jmclient/test/test_wallets.py index 98d944a..d16147e 100644 --- a/jmclient/test/test_wallets.py +++ b/jmclient/test/test_wallets.py @@ -23,7 +23,7 @@ from jmclient import (load_program_config, jm_single, sync_wallet, AbstractWallet, get_p2pk_vbyte, get_log, Wallet, select, select_gradual, select_greedy, select_greediest, estimate_tx_fee, encryptData, get_network, WalletError, - BitcoinCoreWallet, BitcoinCoreInterface, SegwitWallet, + BitcoinCoreInterface, SegwitWallet, wallet_generate_recover_bip39, decryptData, encryptData) from jmbase.support import chunks from taker_test_data import t_obtained_tx, t_raw_signed_tx @@ -265,19 +265,6 @@ def test_index_ahead_cache(setup_wallets): assert is_index_ahead_of_cache(wallet, 3, 1) -def test_core_wallet_no_sync(setup_wallets): - """Ensure BitcoinCoreWallet sync attempt does nothing - """ - wallet = BitcoinCoreWallet("") - #this will not trigger sync due to absence of non-zero index_cache, usually. - wallet.index_cache = [[1, 1]] - jm_single().bc_interface.wallet_synced = False - jm_single().bc_interface.sync_wallet(wallet, fast=True) - assert not jm_single().bc_interface.wallet_synced - jm_single().bc_interface.sync_wallet(wallet) - assert not jm_single().bc_interface.wallet_synced - - def test_wrong_network_bci(setup_wallets): rpc = jm_single().bc_interface.jsonRpc with pytest.raises(Exception) as e_info: