Browse Source

fix: enable addr status in regtest

master
theborakompanioni 4 years ago
parent
commit
36bf36bd65
No known key found for this signature in database
GPG Key ID: E8070AF0053AAC0D
  1. 10
      jmclient/jmclient/wallet_utils.py
  2. 2
      jmclient/test/test_wallet_rpc.py

10
jmclient/jmclient/wallet_utils.py

@ -10,10 +10,12 @@ from numbers import Integral
from collections import Counter from collections import Counter
from itertools import islice, chain from itertools import islice, chain
from jmclient import (get_network, WALLET_IMPLEMENTATIONS, Storage, podle, from jmclient import (get_network, WALLET_IMPLEMENTATIONS, Storage, podle,
jm_single, BitcoinCoreInterface, WalletError, BaseWallet, jm_single, WalletError, BaseWallet, VolatileStorage,
VolatileStorage, StoragePasswordError, is_segwit_mode, SegwitLegacyWallet, StoragePasswordError, is_segwit_mode, SegwitLegacyWallet, LegacyWallet,
LegacyWallet, SegwitWallet, FidelityBondMixin, FidelityBondWatchonlyWallet, SegwitWallet, FidelityBondMixin, FidelityBondWatchonlyWallet,
is_native_segwit_mode, load_program_config, add_base_options, check_regtest) is_native_segwit_mode, load_program_config, add_base_options, check_regtest)
from jmclient.blockchaininterface import (BitcoinCoreInterface,
BitcoinCoreNoHistoryInterface)
from jmclient.wallet_service import WalletService from jmclient.wallet_service import WalletService
from jmbase.support import (get_password, jmprint, EXIT_FAILURE, from jmbase.support import (get_password, jmprint, EXIT_FAILURE,
EXIT_ARGERROR, utxo_to_utxostr, hextobin, bintohex, EXIT_ARGERROR, utxo_to_utxostr, hextobin, bintohex,
@ -506,7 +508,7 @@ def wallet_display(wallet_service, showprivkey, displayall=False,
#the function should either be removed or added to bci #the function should either be removed or added to bci
#or possibly add some kind of `gettransaction` function #or possibly add some kind of `gettransaction` function
# to bci # to bci
if jm_single().bc_interface.__class__ == BitcoinCoreInterface: if not isinstance(jm_single().bc_interface, BitcoinCoreNoHistoryInterface):
is_coinjoin, cj_amount, cj_n = \ is_coinjoin, cj_amount, cj_n = \
get_tx_info(utxo[0])[:3] get_tx_info(utxo[0])[:3]
if is_coinjoin and utxodata['value'] == cj_amount: if is_coinjoin and utxodata['value'] == cj_amount:

2
jmclient/test/test_wallet_rpc.py

@ -340,7 +340,7 @@ class TrialTestWRPC_DisplayWallet(WalletRPCTestBase, unittest.TestCase):
# and the direct-send tx above: # and the direct-send tx above:
assert wia[0]["branches"][0]["entries"][0]["label"] == "test-wallet-rpc-label" assert wia[0]["branches"][0]["entries"][0]["label"] == "test-wallet-rpc-label"
assert wia[0]["branches"][0]["entries"][0]["hd_path"] == "m/84'/1'/0'/0/0" assert wia[0]["branches"][0]["entries"][0]["hd_path"] == "m/84'/1'/0'/0/0"
assert wia[1]["branches"][0]["entries"][1]["status"] == "used" assert wia[1]["branches"][0]["entries"][1]["status"] == "deposit"
assert wia[1]["branches"][0]["entries"][1]["extradata"] == "" assert wia[1]["branches"][0]["entries"][1]["extradata"] == ""
# currently this test only produces output with available_balance = balance, # currently this test only produces output with available_balance = balance,
# at every level in the tree (no freeze here), but could add TODO # at every level in the tree (no freeze here), but could add TODO

Loading…
Cancel
Save