test.py ref ref_altcoin: minor cleanups
This commit is contained in:
parent
2cc1fd282c
commit
af97327541
2 changed files with 7 additions and 7 deletions
|
|
@ -210,7 +210,6 @@ class TestSuiteRef(TestSuiteBase,TestSuiteShared):
|
|||
subdir = None,
|
||||
pfx = None,
|
||||
mmtype = None,
|
||||
add_args = [],
|
||||
id_key = None,
|
||||
pat = None ):
|
||||
|
||||
|
|
@ -220,7 +219,7 @@ class TestSuiteRef(TestSuiteBase,TestSuiteShared):
|
|||
af = joinpath(ref_dir,(subdir or self.ref_subdir,'')[ftype=='passwd'],af_fn)
|
||||
coin_arg = [] if coin == None else ['--coin='+coin]
|
||||
tool_cmd = ftype.replace('segwit','').replace('bech32','')+'file_chksum'
|
||||
t = self.spawn('mmgen-tool',coin_arg+['--verbose','-p1',tool_cmd,af]+add_args)
|
||||
t = self.spawn( 'mmgen-tool', coin_arg + ['--verbose','-p1',tool_cmd,af] )
|
||||
if ftype == 'keyaddr':
|
||||
t.do_decrypt_ka_data(hp=ref_kafile_hash_preset,pw=ref_kafile_pass,have_yes_opt=True)
|
||||
chksum_key = '_'.join([af_key,'chksum'] + ([coin.lower()] if coin else []) + ([mmtype] if mmtype else []))
|
||||
|
|
|
|||
|
|
@ -114,19 +114,20 @@ class TestSuiteRefAltcoin(TestSuiteRef,TestSuiteBase):
|
|||
stop_test_daemons(proto.network_id)
|
||||
return 'ok'
|
||||
|
||||
def ref_altcoin_addrgen(self,coin,mmtype,gen_what='addr',coin_suf='',add_args=[]):
|
||||
def ref_altcoin_addrgen(self,coin,mmtype,gen_what='addr',coin_suf='',add_args=[],addr_idx_list=None):
|
||||
wf = dfl_words_file
|
||||
t = self.spawn(f'mmgen-{gen_what}gen',
|
||||
t = self.spawn(
|
||||
'mmgen-keygen' if 'key' in gen_what else 'mmgen-addrgen',
|
||||
['-Sq','--coin='+coin] +
|
||||
(['--type='+mmtype] if mmtype else []) +
|
||||
add_args +
|
||||
[wf,dfl_addr_idx_list])
|
||||
if gen_what == 'key':
|
||||
[wf,addr_idx_list or dfl_addr_idx_list])
|
||||
if 'key' in gen_what:
|
||||
t.expect('Encrypt key list? (y/N): ','N')
|
||||
chk = t.expect_getend(r'.* data checksum for \S*: ',regex=True)
|
||||
chk_ref = self.chk_data[
|
||||
'ref_{}addrfile_chksum_{}{}'.format(
|
||||
('key' if gen_what == 'key' else ''),
|
||||
(gen_what if 'key' in gen_what else ''),
|
||||
coin.lower(),
|
||||
coin_suf )
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue