ui: Use coin tickers as wallet keys in json/wallets
This commit is contained in:
15 files changed
+58
-40
No files matched your search
@@ -82,19 +82,19 @@ class Test(unittest.TestCase):
|
||||
waitForServer(self.delay_event, 12700)
|
||||
|
||||
wallets_0 = read_json_api(12700, 'wallets')
|
||||
assert(wallets_0['1']['expected_seed'] is True)
|
||||
assert(wallets_0['6']['expected_seed'] is True)
|
||||
assert(wallets_0['PART']['expected_seed'] is True)
|
||||
assert(wallets_0['XMR']['expected_seed'] is True)
|
||||
|
||||
waitForServer(self.delay_event, 12701)
|
||||
wallets_1 = read_json_api(12701, 'wallets')
|
||||
|
||||
assert(wallets_0['1']['expected_seed'] is True)
|
||||
assert(wallets_1['6']['expected_seed'] is True)
|
||||
assert(wallets_0['PART']['expected_seed'] is True)
|
||||
assert(wallets_1['XMR']['expected_seed'] is True)
|
||||
|
||||
# TODO: Check other coins
|
||||
|
||||
assert(wallets_0['1']['deposit_address'] == wallets_1['1']['deposit_address'])
|
||||
assert(wallets_0['6']['deposit_address'] == wallets_1['6']['deposit_address'])
|
||||
assert(wallets_0['PART']['deposit_address'] == wallets_1['1']['deposit_address'])
|
||||
assert(wallets_0['XMR']['deposit_address'] == wallets_1['6']['deposit_address'])
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
@@ -164,12 +164,23 @@ class Test(TestBase):
|
||||
processes[-1].start()
|
||||
waitForServer(self.delay_event, 12703)
|
||||
|
||||
# TODO: Try detect past swaps
|
||||
self.wait_seconds(5)
|
||||
|
||||
ltc_orig = read_json_api(12700, 'wallets/ltc')
|
||||
# TODO: Attempt to detect past swaps
|
||||
|
||||
ltc_original = read_json_api(12700, 'wallets/ltc')
|
||||
ltc_restored = read_json_api(12703, 'wallets/ltc')
|
||||
assert(float(ltc_orig['balance']) + float(ltc_orig['unconfirmed']) > 0.0)
|
||||
assert(float(ltc_orig['balance']) + float(ltc_orig['unconfirmed']) == float(ltc_restored['balance']) + float(ltc_restored['unconfirmed']))
|
||||
assert(float(ltc_original['balance']) + float(ltc_original['unconfirmed']) > 0.0)
|
||||
assert(float(ltc_original['balance']) + float(ltc_original['unconfirmed']) == float(ltc_restored['balance']) + float(ltc_restored['unconfirmed']))
|
||||
|
||||
wallets_original = read_json_api(12700, 'wallets')
|
||||
# TODO: After restoring a new deposit address should be generated, should be automated
|
||||
# Swaps should use a new key path, not the external path
|
||||
next_addr = read_json_api(12703, 'wallets/part/nextdepositaddr')
|
||||
next_addr = read_json_api(12703, 'wallets/part/nextdepositaddr')
|
||||
wallets_restored = read_json_api(12703, 'wallets')
|
||||
for k, w in wallets_original.items():
|
||||
assert(w['deposit_address'] == wallets_restored[k]['deposit_address'])
|
||||
|
||||
logging.info('Test passed.')
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ class Test(unittest.TestCase):
|
||||
|
||||
wallets = read_json_api(UI_PORT + 1, 'wallets')
|
||||
|
||||
self.xmr_addr = wallets['6']['main_address']
|
||||
self.xmr_addr = wallets['XMR']['main_address']
|
||||
num_blocks = 100
|
||||
if callrpc_xmr_na(XMR_BASE_RPC_PORT + 1, 'get_block_count')['count'] < num_blocks:
|
||||
logging.info('Mining {} Monero blocks to {}.'.format(num_blocks, self.xmr_addr))
|
||||
|
||||
Reference in new issue
Block a user