Disable v23 descriptor wallets.
Missing sethdseed, signmessage doesn't work and dumprivkey is missing (preventing a workaround).
This commit is contained in:
parent
093a36c8d2
commit
bbe7556d18
@ -723,6 +723,10 @@ class BasicSwap(BaseApp):
|
|||||||
yield c
|
yield c
|
||||||
|
|
||||||
def changeWalletPasswords(self, old_password, new_password):
|
def changeWalletPasswords(self, old_password, new_password):
|
||||||
|
|
||||||
|
if len(self.swaps_in_progress) > 0:
|
||||||
|
raise ValueError('Can\'t change passwords while swaps are in progress')
|
||||||
|
|
||||||
# Unlock all wallets to ensure they all have the same password.
|
# Unlock all wallets to ensure they all have the same password.
|
||||||
for c in self.activeCoins():
|
for c in self.activeCoins():
|
||||||
ci = self.ci(c)
|
ci = self.ci(c)
|
||||||
|
@ -1261,6 +1261,7 @@ class BTCInterface(CoinInterface):
|
|||||||
ensure(sign_for_addr is not None, 'Could not find address with enough funds for proof')
|
ensure(sign_for_addr is not None, 'Could not find address with enough funds for proof')
|
||||||
|
|
||||||
self._log.debug('sign_for_addr %s', sign_for_addr)
|
self._log.debug('sign_for_addr %s', sign_for_addr)
|
||||||
|
|
||||||
if self._use_segwit: # TODO: Use isSegwitAddress when scantxoutset can use combo
|
if self._use_segwit: # TODO: Use isSegwitAddress when scantxoutset can use combo
|
||||||
# 'Address does not refer to key' for non p2pkh
|
# 'Address does not refer to key' for non p2pkh
|
||||||
pkh = self.decodeAddress(sign_for_addr)
|
pkh = self.decodeAddress(sign_for_addr)
|
||||||
@ -1291,6 +1292,7 @@ class BTCInterface(CoinInterface):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def changeWalletPassword(self, old_password, new_password):
|
def changeWalletPassword(self, old_password, new_password):
|
||||||
|
self._log.info('changeWalletPassword - {}'.format(self.ticker()))
|
||||||
if old_password == '':
|
if old_password == '':
|
||||||
return self.rpc_callback('encryptwallet', [new_password])
|
return self.rpc_callback('encryptwallet', [new_password])
|
||||||
self.rpc_callback('walletpassphrasechange', [old_password, new_password])
|
self.rpc_callback('walletpassphrasechange', [old_password, new_password])
|
||||||
@ -1298,10 +1300,12 @@ class BTCInterface(CoinInterface):
|
|||||||
def unlockWallet(self, password):
|
def unlockWallet(self, password):
|
||||||
if password == '':
|
if password == '':
|
||||||
return
|
return
|
||||||
|
self._log.info('unlockWallet - {}'.format(self.ticker()))
|
||||||
# Max timeout value, ~3 years
|
# Max timeout value, ~3 years
|
||||||
self.rpc_callback('walletpassphrase', [password, 100000000])
|
self.rpc_callback('walletpassphrase', [password, 100000000])
|
||||||
|
|
||||||
def lockWallet(self):
|
def lockWallet(self):
|
||||||
|
self._log.info('lockWallet - {}'.format(self.ticker()))
|
||||||
self.rpc_callback('walletlock')
|
self.rpc_callback('walletlock')
|
||||||
|
|
||||||
|
|
||||||
|
@ -295,7 +295,6 @@ class XMRInterface(CoinInterface):
|
|||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rv = self.rpc_wallet_cb('open_wallet', {'filename': address_b58})
|
|
||||||
self.openWallet(address_b58)
|
self.openWallet(address_b58)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.createWallet(params)
|
self.createWallet(params)
|
||||||
@ -520,6 +519,7 @@ class XMRInterface(CoinInterface):
|
|||||||
return balance_info['unlocked_balance']
|
return balance_info['unlocked_balance']
|
||||||
|
|
||||||
def changeWalletPassword(self, old_password, new_password):
|
def changeWalletPassword(self, old_password, new_password):
|
||||||
|
self._log.info('changeWalletPassword - {}'.format(self.ticker()))
|
||||||
orig_password = self._wallet_password
|
orig_password = self._wallet_password
|
||||||
if old_password != '':
|
if old_password != '':
|
||||||
self._wallet_password = old_password
|
self._wallet_password = old_password
|
||||||
@ -531,7 +531,9 @@ class XMRInterface(CoinInterface):
|
|||||||
raise e
|
raise e
|
||||||
|
|
||||||
def unlockWallet(self, password):
|
def unlockWallet(self, password):
|
||||||
|
self._log.info('unlockWallet - {}'.format(self.ticker()))
|
||||||
self._wallet_password = password
|
self._wallet_password = password
|
||||||
|
|
||||||
def lockWallet(self):
|
def lockWallet(self):
|
||||||
|
self._log.info('lockWallet - {}'.format(self.ticker()))
|
||||||
self._wallet_password = None
|
self._wallet_password = None
|
||||||
|
@ -973,7 +973,12 @@ def initialise_wallets(particl_wallet_mnemonic, with_coins, data_dir, settings,
|
|||||||
wallets = swap_client.callcoinrpc(c, 'listwallets')
|
wallets = swap_client.callcoinrpc(c, 'listwallets')
|
||||||
if len(wallets) < 1:
|
if len(wallets) < 1:
|
||||||
logger.info('Creating wallet.dat for {}.'.format(getCoinName(c)))
|
logger.info('Creating wallet.dat for {}.'.format(getCoinName(c)))
|
||||||
swap_client.callcoinrpc(c, 'createwallet', ['wallet.dat'])
|
|
||||||
|
if c == Coins.BTC:
|
||||||
|
# wallet_name, wallet_name, blank, passphrase, avoid_reuse, descriptors
|
||||||
|
swap_client.callcoinrpc(c, 'createwallet', ['wallet.dat', False, True, '', False, False])
|
||||||
|
else:
|
||||||
|
swap_client.callcoinrpc(c, 'createwallet', ['wallet.dat'])
|
||||||
|
|
||||||
if 'particl' in with_coins and c == Coins.PART:
|
if 'particl' in with_coins and c == Coins.PART:
|
||||||
logger.info('Loading Particl mnemonic')
|
logger.info('Loading Particl mnemonic')
|
||||||
|
@ -93,12 +93,15 @@ def prepareDataDir(datadir, node_id, conf_file, dir_prefix, base_p2p_port=BASE_P
|
|||||||
|
|
||||||
|
|
||||||
def checkForks(ro):
|
def checkForks(ro):
|
||||||
if 'bip9_softforks' in ro:
|
try:
|
||||||
assert (ro['bip9_softforks']['csv']['status'] == 'active')
|
if 'bip9_softforks' in ro:
|
||||||
assert (ro['bip9_softforks']['segwit']['status'] == 'active')
|
assert (ro['bip9_softforks']['csv']['status'] == 'active')
|
||||||
else:
|
assert (ro['bip9_softforks']['segwit']['status'] == 'active')
|
||||||
assert (ro['softforks']['csv']['active'])
|
else:
|
||||||
assert (ro['softforks']['segwit']['active'])
|
assert (ro['softforks']['csv']['active'])
|
||||||
|
assert (ro['softforks']['segwit']['active'])
|
||||||
|
except Exception as e:
|
||||||
|
logging.warning('Could not parse deployment info')
|
||||||
|
|
||||||
|
|
||||||
def stopDaemons(daemons):
|
def stopDaemons(daemons):
|
||||||
|
@ -273,7 +273,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
btc_data_dir = os.path.join(cfg.TEST_DATADIRS, str(BTC_NODE))
|
btc_data_dir = os.path.join(cfg.TEST_DATADIRS, str(BTC_NODE))
|
||||||
if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')):
|
if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')):
|
||||||
callrpc_cli(cfg.BITCOIN_BINDIR, btc_data_dir, 'regtest', '-wallet=wallet.dat create', 'bitcoin-wallet')
|
callrpc_cli(cfg.BITCOIN_BINDIR, btc_data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'bitcoin-wallet')
|
||||||
cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
||||||
logging.info('Started %s %d', cfg.BITCOIND, cls.daemons[-1].pid)
|
logging.info('Started %s %d', cfg.BITCOIND, cls.daemons[-1].pid)
|
||||||
cls.daemons.append(startDaemon(os.path.join(cfg.TEST_DATADIRS, str(DASH_NODE)), cfg.DASH_BINDIR, cfg.DASHD))
|
cls.daemons.append(startDaemon(os.path.join(cfg.TEST_DATADIRS, str(DASH_NODE)), cfg.DASH_BINDIR, cfg.DASHD))
|
||||||
@ -282,7 +282,7 @@ class Test(unittest.TestCase):
|
|||||||
for i in range(NUM_NODES):
|
for i in range(NUM_NODES):
|
||||||
data_dir = os.path.join(cfg.TEST_DATADIRS, str(i))
|
data_dir = os.path.join(cfg.TEST_DATADIRS, str(i))
|
||||||
if os.path.exists(os.path.join(cfg.PARTICL_BINDIR, 'particl-wallet')):
|
if os.path.exists(os.path.join(cfg.PARTICL_BINDIR, 'particl-wallet')):
|
||||||
callrpc_cli(cfg.PARTICL_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat create', 'particl-wallet')
|
callrpc_cli(cfg.PARTICL_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'particl-wallet')
|
||||||
cls.daemons.append(startDaemon(data_dir, cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
cls.daemons.append(startDaemon(data_dir, cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
||||||
logging.info('Started %s %d', cfg.PARTICLD, cls.daemons[-1].pid)
|
logging.info('Started %s %d', cfg.PARTICLD, cls.daemons[-1].pid)
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ class Test(unittest.TestCase):
|
|||||||
logging.info('Mining %d Bitcoin blocks to %s', num_blocks, cls.btc_addr)
|
logging.info('Mining %d Bitcoin blocks to %s', num_blocks, cls.btc_addr)
|
||||||
btcRpc('generatetoaddress {} {}'.format(num_blocks, cls.btc_addr))
|
btcRpc('generatetoaddress {} {}'.format(num_blocks, cls.btc_addr))
|
||||||
|
|
||||||
ro = btcRpc('getblockchaininfo')
|
ro = btcRpc('getdeploymentinfo')
|
||||||
checkForks(ro)
|
checkForks(ro)
|
||||||
|
|
||||||
ro = dashRpc('getwalletinfo')
|
ro = dashRpc('getwalletinfo')
|
||||||
|
@ -200,7 +200,7 @@ class Test(unittest.TestCase):
|
|||||||
for i in range(NUM_NODES):
|
for i in range(NUM_NODES):
|
||||||
data_dir = prepareDataDir(TEST_DIR, i, 'particl.conf', 'part_')
|
data_dir = prepareDataDir(TEST_DIR, i, 'particl.conf', 'part_')
|
||||||
if os.path.exists(os.path.join(cfg.PARTICL_BINDIR, 'particl-wallet')):
|
if os.path.exists(os.path.join(cfg.PARTICL_BINDIR, 'particl-wallet')):
|
||||||
callrpc_cli(cfg.PARTICL_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat create', 'particl-wallet')
|
callrpc_cli(cfg.PARTICL_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'particl-wallet')
|
||||||
|
|
||||||
cls.part_daemons.append(startDaemon(os.path.join(TEST_DIR, 'part_' + str(i)), cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
cls.part_daemons.append(startDaemon(os.path.join(TEST_DIR, 'part_' + str(i)), cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
||||||
logging.info('Started %s %d', cfg.PARTICLD, cls.part_daemons[-1].pid)
|
logging.info('Started %s %d', cfg.PARTICLD, cls.part_daemons[-1].pid)
|
||||||
@ -223,7 +223,7 @@ class Test(unittest.TestCase):
|
|||||||
for i in range(NUM_BTC_NODES):
|
for i in range(NUM_BTC_NODES):
|
||||||
data_dir = prepareDataDir(TEST_DIR, i, 'bitcoin.conf', 'btc_', base_p2p_port=BTC_BASE_PORT, base_rpc_port=BTC_BASE_RPC_PORT)
|
data_dir = prepareDataDir(TEST_DIR, i, 'bitcoin.conf', 'btc_', base_p2p_port=BTC_BASE_PORT, base_rpc_port=BTC_BASE_RPC_PORT)
|
||||||
if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')):
|
if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')):
|
||||||
callrpc_cli(cfg.BITCOIN_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat create', 'bitcoin-wallet')
|
callrpc_cli(cfg.BITCOIN_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'bitcoin-wallet')
|
||||||
|
|
||||||
cls.btc_daemons.append(startDaemon(os.path.join(TEST_DIR, 'btc_' + str(i)), cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
cls.btc_daemons.append(startDaemon(os.path.join(TEST_DIR, 'btc_' + str(i)), cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
||||||
logging.info('Started %s %d', cfg.BITCOIND, cls.part_daemons[-1].pid)
|
logging.info('Started %s %d', cfg.BITCOIND, cls.part_daemons[-1].pid)
|
||||||
|
@ -271,7 +271,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
btc_data_dir = os.path.join(cfg.TEST_DATADIRS, str(BTC_NODE))
|
btc_data_dir = os.path.join(cfg.TEST_DATADIRS, str(BTC_NODE))
|
||||||
if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')):
|
if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')):
|
||||||
callrpc_cli(cfg.BITCOIN_BINDIR, btc_data_dir, 'regtest', '-wallet=wallet.dat create', 'bitcoin-wallet')
|
callrpc_cli(cfg.BITCOIN_BINDIR, btc_data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'bitcoin-wallet')
|
||||||
cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
||||||
logging.info('Started %s %d', cfg.BITCOIND, cls.daemons[-1].pid)
|
logging.info('Started %s %d', cfg.BITCOIND, cls.daemons[-1].pid)
|
||||||
cls.daemons.append(startDaemon(os.path.join(cfg.TEST_DATADIRS, str(NMC_NODE)), cfg.NAMECOIN_BINDIR, cfg.NAMECOIND))
|
cls.daemons.append(startDaemon(os.path.join(cfg.TEST_DATADIRS, str(NMC_NODE)), cfg.NAMECOIN_BINDIR, cfg.NAMECOIND))
|
||||||
@ -280,7 +280,7 @@ class Test(unittest.TestCase):
|
|||||||
for i in range(NUM_NODES):
|
for i in range(NUM_NODES):
|
||||||
data_dir = os.path.join(cfg.TEST_DATADIRS, str(i))
|
data_dir = os.path.join(cfg.TEST_DATADIRS, str(i))
|
||||||
if os.path.exists(os.path.join(cfg.PARTICL_BINDIR, 'particl-wallet')):
|
if os.path.exists(os.path.join(cfg.PARTICL_BINDIR, 'particl-wallet')):
|
||||||
callrpc_cli(cfg.PARTICL_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat create', 'particl-wallet')
|
callrpc_cli(cfg.PARTICL_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'particl-wallet')
|
||||||
cls.daemons.append(startDaemon(data_dir, cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
cls.daemons.append(startDaemon(data_dir, cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
||||||
logging.info('Started %s %d', cfg.PARTICLD, cls.daemons[-1].pid)
|
logging.info('Started %s %d', cfg.PARTICLD, cls.daemons[-1].pid)
|
||||||
|
|
||||||
@ -332,7 +332,7 @@ class Test(unittest.TestCase):
|
|||||||
logging.info('Mining %d Bitcoin blocks to %s', num_blocks, cls.btc_addr)
|
logging.info('Mining %d Bitcoin blocks to %s', num_blocks, cls.btc_addr)
|
||||||
btcRpc('generatetoaddress {} {}'.format(num_blocks, cls.btc_addr))
|
btcRpc('generatetoaddress {} {}'.format(num_blocks, cls.btc_addr))
|
||||||
|
|
||||||
ro = btcRpc('getblockchaininfo')
|
ro = btcRpc('getdeploymentinfo')
|
||||||
checkForks(ro)
|
checkForks(ro)
|
||||||
|
|
||||||
ro = nmcRpc('getwalletinfo')
|
ro = nmcRpc('getwalletinfo')
|
||||||
|
@ -285,7 +285,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
btc_data_dir = os.path.join(cfg.TEST_DATADIRS, str(BTC_NODE))
|
btc_data_dir = os.path.join(cfg.TEST_DATADIRS, str(BTC_NODE))
|
||||||
if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')):
|
if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')):
|
||||||
callrpc_cli(cfg.BITCOIN_BINDIR, btc_data_dir, 'regtest', '-wallet=wallet.dat create', 'bitcoin-wallet')
|
callrpc_cli(cfg.BITCOIN_BINDIR, btc_data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'bitcoin-wallet')
|
||||||
cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
||||||
logging.info('Started %s %d', cfg.BITCOIND, cls.daemons[-1].pid)
|
logging.info('Started %s %d', cfg.BITCOIND, cls.daemons[-1].pid)
|
||||||
cls.daemons.append(startDaemon(os.path.join(cfg.TEST_DATADIRS, str(PIVX_NODE)), cfg.PIVX_BINDIR, cfg.PIVXD))
|
cls.daemons.append(startDaemon(os.path.join(cfg.TEST_DATADIRS, str(PIVX_NODE)), cfg.PIVX_BINDIR, cfg.PIVXD))
|
||||||
@ -294,7 +294,7 @@ class Test(unittest.TestCase):
|
|||||||
for i in range(NUM_NODES):
|
for i in range(NUM_NODES):
|
||||||
data_dir = os.path.join(cfg.TEST_DATADIRS, str(i))
|
data_dir = os.path.join(cfg.TEST_DATADIRS, str(i))
|
||||||
if os.path.exists(os.path.join(cfg.PARTICL_BINDIR, 'particl-wallet')):
|
if os.path.exists(os.path.join(cfg.PARTICL_BINDIR, 'particl-wallet')):
|
||||||
callrpc_cli(cfg.PARTICL_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat create', 'particl-wallet')
|
callrpc_cli(cfg.PARTICL_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'particl-wallet')
|
||||||
cls.daemons.append(startDaemon(data_dir, cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
cls.daemons.append(startDaemon(data_dir, cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
||||||
logging.info('Started %s %d', cfg.PARTICLD, cls.daemons[-1].pid)
|
logging.info('Started %s %d', cfg.PARTICLD, cls.daemons[-1].pid)
|
||||||
|
|
||||||
@ -346,7 +346,7 @@ class Test(unittest.TestCase):
|
|||||||
logging.info('Mining %d Bitcoin blocks to %s', num_blocks, cls.btc_addr)
|
logging.info('Mining %d Bitcoin blocks to %s', num_blocks, cls.btc_addr)
|
||||||
btcRpc('generatetoaddress {} {}'.format(num_blocks, cls.btc_addr))
|
btcRpc('generatetoaddress {} {}'.format(num_blocks, cls.btc_addr))
|
||||||
|
|
||||||
ro = btcRpc('getblockchaininfo')
|
ro = btcRpc('getdeploymentinfo')
|
||||||
checkForks(ro)
|
checkForks(ro)
|
||||||
|
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
@ -243,7 +243,8 @@ class BasicSwapTest(BaseTest):
|
|||||||
test_seed = '8e54a313e6df8918df6d758fafdbf127a115175fdd2238d0e908dd8093c9ac3b'
|
test_seed = '8e54a313e6df8918df6d758fafdbf127a115175fdd2238d0e908dd8093c9ac3b'
|
||||||
test_wif = self.swap_clients[0].ci(self.test_coin_from).encodeKey(bytes.fromhex(test_seed))
|
test_wif = self.swap_clients[0].ci(self.test_coin_from).encodeKey(bytes.fromhex(test_seed))
|
||||||
new_wallet_name = random.randbytes(10).hex()
|
new_wallet_name = random.randbytes(10).hex()
|
||||||
self.callnoderpc('createwallet', [new_wallet_name])
|
# wallet_name, wallet_name, blank, passphrase, avoid_reuse, descriptors
|
||||||
|
self.callnoderpc('createwallet', [new_wallet_name, False, True, '', False, False])
|
||||||
self.callnoderpc('sethdseed', [True, test_wif], wallet=new_wallet_name)
|
self.callnoderpc('sethdseed', [True, test_wif], wallet=new_wallet_name)
|
||||||
addr = self.callnoderpc('getnewaddress', wallet=new_wallet_name)
|
addr = self.callnoderpc('getnewaddress', wallet=new_wallet_name)
|
||||||
self.callnoderpc('unloadwallet', [new_wallet_name])
|
self.callnoderpc('unloadwallet', [new_wallet_name])
|
||||||
@ -432,7 +433,7 @@ class TestBTC(BasicSwapTest):
|
|||||||
assert (jsw['encrypted'] is False)
|
assert (jsw['encrypted'] is False)
|
||||||
assert (jsw['locked'] is False)
|
assert (jsw['locked'] is False)
|
||||||
|
|
||||||
rv = read_json_api(1800, 'setpassword', {'oldpassword': '', 'newpassword': 'notapassword123'})
|
read_json_api(1800, 'setpassword', {'oldpassword': '', 'newpassword': 'notapassword123'})
|
||||||
|
|
||||||
# Entire system is locked with Particl wallet
|
# Entire system is locked with Particl wallet
|
||||||
jsw = read_json_api(1800, 'wallets/btc')
|
jsw = read_json_api(1800, 'wallets/btc')
|
||||||
@ -450,7 +451,6 @@ class TestBTC(BasicSwapTest):
|
|||||||
assert ('Coin must be unlocked' in jsw['error'])
|
assert ('Coin must be unlocked' in jsw['error'])
|
||||||
|
|
||||||
read_json_api(1800, 'setpassword', {'oldpassword': 'notapassword123', 'newpassword': 'notapassword456'})
|
read_json_api(1800, 'setpassword', {'oldpassword': 'notapassword123', 'newpassword': 'notapassword456'})
|
||||||
|
|
||||||
read_json_api(1800, 'unlock', {'password': 'notapassword456'})
|
read_json_api(1800, 'unlock', {'password': 'notapassword456'})
|
||||||
|
|
||||||
for coin in ('part', 'btc', 'xmr'):
|
for coin in ('part', 'btc', 'xmr'):
|
||||||
@ -458,6 +458,17 @@ class TestBTC(BasicSwapTest):
|
|||||||
assert (jsw['encrypted'] is True)
|
assert (jsw['encrypted'] is True)
|
||||||
assert (jsw['locked'] is False)
|
assert (jsw['locked'] is False)
|
||||||
|
|
||||||
|
def test_01_full_swap(self):
|
||||||
|
js_0 = read_json_api(1800, 'wallets')
|
||||||
|
if not js_0['PART']['encrypted']:
|
||||||
|
read_json_api(1800, 'setpassword', {'oldpassword': '', 'newpassword': 'notapassword123'})
|
||||||
|
read_json_api(1800, 'unlock', {'password': 'notapassword123'})
|
||||||
|
js_0 = read_json_api(1800, 'wallets')
|
||||||
|
assert (js_0['PART']['encrypted'] is True)
|
||||||
|
assert (js_0['PART']['locked'] is False)
|
||||||
|
|
||||||
|
super().test_01_full_swap()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -143,6 +143,7 @@ def startXmrWalletRPC(node_dir, bin_dir, wallet_bin, node_id, opts=[]):
|
|||||||
args += ['--log-file={}'.format(os.path.join(data_dir, 'wallet.log'))]
|
args += ['--log-file={}'.format(os.path.join(data_dir, 'wallet.log'))]
|
||||||
args += ['--rpc-login=test{0}:test_pass{0}'.format(node_id)]
|
args += ['--rpc-login=test{0}:test_pass{0}'.format(node_id)]
|
||||||
args += ['--shared-ringdb-dir={}'.format(os.path.join(data_dir, 'shared-ringdb'))]
|
args += ['--shared-ringdb-dir={}'.format(os.path.join(data_dir, 'shared-ringdb'))]
|
||||||
|
args += ['--allow-mismatched-daemon-version']
|
||||||
|
|
||||||
args += opts
|
args += opts
|
||||||
logging.info('Starting daemon {} --wallet-dir={}'.format(daemon_bin, node_dir))
|
logging.info('Starting daemon {} --wallet-dir={}'.format(daemon_bin, node_dir))
|
||||||
@ -366,7 +367,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
if not cls.restore_instance:
|
if not cls.restore_instance:
|
||||||
data_dir = prepareDataDir(TEST_DIR, i, 'particl.conf', 'part_')
|
data_dir = prepareDataDir(TEST_DIR, i, 'particl.conf', 'part_')
|
||||||
if os.path.exists(os.path.join(cfg.PARTICL_BINDIR, 'particl-wallet')):
|
if os.path.exists(os.path.join(cfg.PARTICL_BINDIR, 'particl-wallet')):
|
||||||
callrpc_cli(cfg.PARTICL_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat create', 'particl-wallet')
|
callrpc_cli(cfg.PARTICL_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'particl-wallet')
|
||||||
|
|
||||||
cls.part_daemons.append(startDaemon(os.path.join(TEST_DIR, 'part_' + str(i)), cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
cls.part_daemons.append(startDaemon(os.path.join(TEST_DIR, 'part_' + str(i)), cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
||||||
logging.info('Started %s %d', cfg.PARTICLD, cls.part_daemons[-1].pid)
|
logging.info('Started %s %d', cfg.PARTICLD, cls.part_daemons[-1].pid)
|
||||||
@ -391,7 +392,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
if not cls.restore_instance:
|
if not cls.restore_instance:
|
||||||
data_dir = prepareDataDir(TEST_DIR, i, 'bitcoin.conf', 'btc_', base_p2p_port=BTC_BASE_PORT, base_rpc_port=BTC_BASE_RPC_PORT)
|
data_dir = prepareDataDir(TEST_DIR, i, 'bitcoin.conf', 'btc_', base_p2p_port=BTC_BASE_PORT, base_rpc_port=BTC_BASE_RPC_PORT)
|
||||||
if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')):
|
if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')):
|
||||||
callrpc_cli(cfg.BITCOIN_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat create', 'bitcoin-wallet')
|
callrpc_cli(cfg.BITCOIN_BINDIR, data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'bitcoin-wallet')
|
||||||
|
|
||||||
cls.btc_daemons.append(startDaemon(os.path.join(TEST_DIR, 'btc_' + str(i)), cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
cls.btc_daemons.append(startDaemon(os.path.join(TEST_DIR, 'btc_' + str(i)), cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
||||||
logging.info('Started %s %d', cfg.BITCOIND, cls.part_daemons[-1].pid)
|
logging.info('Started %s %d', cfg.BITCOIND, cls.part_daemons[-1].pid)
|
||||||
@ -500,7 +501,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
logging.info('Mining %d Bitcoin blocks to %s', num_blocks, cls.btc_addr)
|
logging.info('Mining %d Bitcoin blocks to %s', num_blocks, cls.btc_addr)
|
||||||
callnoderpc(0, 'generatetoaddress', [num_blocks, cls.btc_addr], base_rpc_port=BTC_BASE_RPC_PORT)
|
callnoderpc(0, 'generatetoaddress', [num_blocks, cls.btc_addr], base_rpc_port=BTC_BASE_RPC_PORT)
|
||||||
|
|
||||||
checkForks(callnoderpc(0, 'getblockchaininfo', base_rpc_port=BTC_BASE_RPC_PORT))
|
checkForks(callnoderpc(0, 'getdeploymentinfo', base_rpc_port=BTC_BASE_RPC_PORT))
|
||||||
|
|
||||||
if cls.start_ltc_nodes:
|
if cls.start_ltc_nodes:
|
||||||
num_blocks = 400
|
num_blocks = 400
|
||||||
|
Loading…
Reference in New Issue
Block a user