addrfile.py: improve key-address validity check handling
This commit is contained in:
parent
0514ec24c5
commit
42bb5d5fc5
4 changed files with 10 additions and 10 deletions
|
|
@ -165,9 +165,9 @@ class AddrFile(MMGenObject):
|
|||
|
||||
ret.append(a)
|
||||
|
||||
if p.has_keys and not p.skip_ka_check:
|
||||
if p.has_keys and p.ka_validity_chk != False:
|
||||
from .opts import opt
|
||||
if opt.yes or keypress_confirm('Check key-to-address validity?'):
|
||||
if opt.yes or p.ka_validity_chk == True or keypress_confirm('Check key-to-address validity?'):
|
||||
from .addr import KeyGenerator,AddrGenerator
|
||||
kg = KeyGenerator(p.proto,p.al_id.mmtype.pubkey_type)
|
||||
ag = AddrGenerator(p.proto,p.al_id.mmtype)
|
||||
|
|
|
|||
|
|
@ -147,12 +147,12 @@ class AddrList(MMGenObject): # Address info for a single seed ID
|
|||
addrlist = '',
|
||||
keylist = '',
|
||||
mmtype = None,
|
||||
skip_key_address_validity_check = False,
|
||||
key_address_validity_check = None, # None=prompt user, True=check without prompt, False=skip check
|
||||
skip_chksum = False,
|
||||
add_p2pkh = False,
|
||||
):
|
||||
|
||||
self.skip_ka_check = skip_key_address_validity_check
|
||||
self.ka_validity_chk = key_address_validity_check
|
||||
self.add_p2pkh = add_p2pkh
|
||||
self.proto = proto
|
||||
do_chksum = False
|
||||
|
|
|
|||
|
|
@ -334,7 +334,11 @@ class MoneroWalletOps:
|
|||
|
||||
super().__init__(uarg_tuple,uopt_tuple)
|
||||
|
||||
self.kal = KeyAddrList(self.proto,uarg.infile)
|
||||
self.kal = KeyAddrList(
|
||||
self.proto,
|
||||
uarg.infile,
|
||||
key_address_validity_check = True )
|
||||
|
||||
self.create_addr_data()
|
||||
|
||||
check_wallets()
|
||||
|
|
|
|||
|
|
@ -300,7 +300,6 @@ class TestSuiteXMRWallet(TestSuiteBase):
|
|||
t = self.spawn(
|
||||
'mmgen-xmrwallet',
|
||||
self.extra_opts + dir_opt + [ 'create', data.kafile, (wallet or data.kal_range) ] )
|
||||
t.expect('Check key-to-address validity? (y/N): ','n')
|
||||
for i in MMGenRange(wallet or data.kal_range).items:
|
||||
t.expect('Address: ')
|
||||
return t
|
||||
|
|
@ -337,7 +336,6 @@ class TestSuiteXMRWallet(TestSuiteBase):
|
|||
t = self.spawn(
|
||||
'mmgen-xmrwallet',
|
||||
self.extra_opts + cmd_opts + (add_opts or []) + [ 'sync', data.kafile ] + ([wallets] if wallets else []) )
|
||||
t.expect('Check key-to-address validity? (y/N): ','n')
|
||||
wlist = AddrIdxList(wallets) if wallets else MMGenRange(data.kal_range).items
|
||||
for n,wnum in enumerate(wlist):
|
||||
t.expect('Syncing wallet {}/{} ({})'.format(
|
||||
|
|
@ -373,8 +371,6 @@ class TestSuiteXMRWallet(TestSuiteBase):
|
|||
self.extra_opts + cmd_opts + [ op, data.kafile, arg2 ],
|
||||
extra_desc = f'({capfirst(user)}{add_desc})' )
|
||||
|
||||
t.expect('Check key-to-address validity? (y/N): ','n')
|
||||
|
||||
if op == 'sweep':
|
||||
t.expect(
|
||||
r'Create new {} .* \(y/N\): '.format(('address','account')[',' in arg2]),
|
||||
|
|
@ -491,7 +487,7 @@ class TestSuiteXMRWallet(TestSuiteBase):
|
|||
async def open_wallet_user(self,user,wnum):
|
||||
data = self.users[user]
|
||||
silence()
|
||||
kal = KeyAddrList(self.proto,data.kafile,skip_key_address_validity_check=True)
|
||||
kal = KeyAddrList(self.proto,data.kafile,key_address_validity_check=False)
|
||||
end_silence()
|
||||
self.users[user].wd.start(silent=not (opt.exact_output or opt.verbose))
|
||||
return await data.wd_rpc.call(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue