Browse Source

remove BitcoinCoreWallet

master
undeath 8 years ago
parent
commit
2a0757c4bc
  1. 19
      jmclient/jmclient/blockchaininterface.py
  2. 15
      jmclient/test/test_wallets.py

19
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 = {}

15
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:

Loading…
Cancel
Save