minor cleanups
This commit is contained in:
parent
bfddd5b8ae
commit
040671bb06
7 changed files with 30 additions and 19 deletions
|
|
@ -145,7 +145,7 @@ class MMGenID(HiliteStr, InitErrors, MMGenObject):
|
|||
assert id_str.count(':') == 2, 'mmtype letter required for extended MMGen IDs'
|
||||
me = str.__new__(cls, id_str)
|
||||
idx, ext = idx.split('-', 1)
|
||||
me.acct_num, me.acct_addr_num = [MoneroIdx(e) for e in ext.split('/', 1)]
|
||||
me.acct_idx, me.addr_idx = [MoneroIdx(e) for e in ext.split('/', 1)]
|
||||
else:
|
||||
me = str.__new__(cls, f'{sid}:{mmtype}:{idx}')
|
||||
me.sid = SeedID(sid=sid)
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ opts_data = {
|
|||
-b, --rescan-blockchain Rescan the blockchain if wallet fails to sync
|
||||
-d, --outdir=D Save transaction files to directory 'D'
|
||||
instead of the working directory
|
||||
-D, --daemon=H:P Connect to the monerod at {D}
|
||||
-D, --daemon=H:P Connect to the monerod at {dhp}
|
||||
-e, --skip-empty-accounts Skip display of empty accounts in wallets
|
||||
where applicable
|
||||
-E, --skip-empty-addresses Skip display of used empty addresses in
|
||||
|
|
@ -73,7 +73,7 @@ opts_data = {
|
|||
-P, --rescan-spent Perform a rescan of spent outputs. Used only
|
||||
with the ‘export-outputs-sign’ operation
|
||||
-R, --tx-relay-daemon=H:P[:H:P] Relay transactions via a monerod specified by
|
||||
{R}
|
||||
{rdhp}
|
||||
-r, --restore-height=H Scan from height 'H' when creating wallets.
|
||||
Use special value ‘current’ to create empty
|
||||
wallet at current blockchain height.
|
||||
|
|
@ -93,8 +93,8 @@ opts_data = {
|
|||
},
|
||||
'code': {
|
||||
'options': lambda cfg, help_notes, s: s.format(
|
||||
D = xmrwallet.uarg_info['daemon'].annot,
|
||||
R = xmrwallet.uarg_info['tx_relay_daemon'].annot,
|
||||
dhp = xmrwallet.uarg_info['daemon'].annot,
|
||||
rdhp = xmrwallet.uarg_info['tx_relay_daemon'].annot,
|
||||
cfg = cfg,
|
||||
gc = gc,
|
||||
tw_dir = help_notes('tw_dir'),
|
||||
|
|
|
|||
|
|
@ -718,12 +718,13 @@ class TwView(MMGenObject, metaclass=AsyncInit):
|
|||
# None: action aborted by user or no action performed
|
||||
# False: an error occurred
|
||||
# 'redo': user will be re-prompted for item number
|
||||
# 'redraw': action successfully performed, screen will be redrawn
|
||||
ret = await action_method(parent, idx)
|
||||
if ret != 'redo':
|
||||
break
|
||||
await asyncio.sleep(0.5)
|
||||
|
||||
if parent.scroll and ret is False:
|
||||
if parent.scroll and ret is False or ret == 'redraw':
|
||||
# error messages could leave screen in messy state, so do complete redraw:
|
||||
msg_r(
|
||||
CUR_HOME + ERASE_ALL +
|
||||
|
|
@ -744,7 +745,7 @@ class TwView(MMGenObject, metaclass=AsyncInit):
|
|||
parent.oneshot_msg = yellow(
|
||||
f'{parent.proto.dcoin} balance for {parent.item_desc} #{idx} refreshed')
|
||||
if res == 0:
|
||||
return False # zeroing balance may mess up display
|
||||
return 'redraw' # zeroing balance may mess up display
|
||||
|
||||
async def i_addr_delete(self, parent, idx):
|
||||
if not parent.keypress_confirm(
|
||||
|
|
|
|||
|
|
@ -34,14 +34,13 @@ class OpDump(OpWallet):
|
|||
).write()
|
||||
return True
|
||||
|
||||
class OpDumpDataBase(OpWallet):
|
||||
class OpDumpDataCommon(OpWallet):
|
||||
wallet_offline = True
|
||||
stem = 'dump'
|
||||
return_data = True
|
||||
|
||||
async def process_wallet(self, d, fn, last):
|
||||
h = MoneroWalletRPC(self, d)
|
||||
h.open_wallet('source')
|
||||
h.open_wallet('source', refresh=False)
|
||||
return {
|
||||
'seed_id': self.kal.al_id.sid,
|
||||
'wallet_num': d.idx,
|
||||
|
|
@ -50,10 +49,12 @@ class OpDumpDataBase(OpWallet):
|
|||
def post_main_success(self):
|
||||
pass
|
||||
|
||||
class OpDumpData(OpDumpDataBase):
|
||||
class OpDumpData(OpDumpDataCommon):
|
||||
start_daemon = False
|
||||
stem = 'load'
|
||||
|
||||
class OpDumpJson(OpDumpDataBase):
|
||||
class OpDumpJson(OpDumpDataCommon):
|
||||
stem = 'dump'
|
||||
|
||||
async def main(self):
|
||||
import json
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ class CmdTestRunner:
|
|||
|
||||
if self.logging:
|
||||
self.log_fd.write('[{}][{}:{}] {}\n'.format(
|
||||
(self.proto.coin.lower() if 'coin' in self.tg.passthru_opts else 'NONE'),
|
||||
self.proto.coin.lower(),
|
||||
self.tg.group_name,
|
||||
self.tg.test_name,
|
||||
cmd_disp))
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class CmdTestXMRAutosign(CmdTestXMRWallet, CmdTestAutosignThreaded):
|
|||
('mine_initial_coins', 'mining initial coins'),
|
||||
('autosign_setup', 'autosign setup with Alice’s seed'),
|
||||
('autosign_xmr_setup', 'autosign setup (creation of Monero signing wallets)'),
|
||||
('create_watchonly_wallets', 'creating watch-only wallets from Alice’s wallet dumps'),
|
||||
('restore_watchonly_wallets', 'creating watch-only wallets from Alice’s wallet dumps'),
|
||||
('delete_tmp_dump_files', 'deleting Alice’s dump files'),
|
||||
('fund_alice1', 'sending funds to Alice (wallet #1)'),
|
||||
('check_bal_alice1', 'mining, checking balance (wallet #1)'),
|
||||
|
|
@ -261,7 +261,7 @@ class CmdTestXMRAutosign(CmdTestXMRWallet, CmdTestAutosignThreaded):
|
|||
self.remove_device()
|
||||
return t
|
||||
|
||||
def create_watchonly_wallets(self):
|
||||
def restore_watchonly_wallets(self):
|
||||
return self._create_wallets('restore')
|
||||
|
||||
def restore_wallets(self):
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ class CmdTestXMRWallet(CmdTestBase):
|
|||
"""
|
||||
|
||||
networks = ('xmr',)
|
||||
passthru_opts = ()
|
||||
tmpdir_nums = [29]
|
||||
dfl_random_txs = 3
|
||||
color = True
|
||||
|
|
@ -377,13 +376,23 @@ class CmdTestXMRWallet(CmdTestBase):
|
|||
random_txs = self.dfl_random_txs)
|
||||
|
||||
def set_label_miner(self):
|
||||
return self.set_label_user('miner', '1:0:0,"Miner’s new primary account label [1:0:0]"', 'updated')
|
||||
return self.set_label_user(
|
||||
'miner',
|
||||
'1:0:0,"Miner’s new primary account label [1:0:0]"',
|
||||
'updated')
|
||||
|
||||
def remove_label_alice(self):
|
||||
return self.set_label_user('alice', '4:2:2,""', 'removed', add_opts=['--full-address'])
|
||||
return self.set_label_user(
|
||||
'alice',
|
||||
'4:2:2,""',
|
||||
'removed',
|
||||
add_opts = ['--full-address'])
|
||||
|
||||
def set_label_alice(self):
|
||||
return self.set_label_user('alice', '4:2:2,"Alice’s new subaddress label [4:2:2]"', 'set')
|
||||
return self.set_label_user(
|
||||
'alice',
|
||||
'4:2:2,"Alice’s new subaddress label [4:2:2]"',
|
||||
'set')
|
||||
|
||||
def set_label_user(self, user, label_spec, expect, add_opts=[]):
|
||||
data = self.users[user]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue