addr.py,obj.py: minor changes
This commit is contained in:
parent
b5dd04c380
commit
dd1300d946
3 changed files with 10 additions and 9 deletions
|
|
@ -43,4 +43,4 @@ the case, you must change your wallet password to an ASCII one (or export your
|
|||
brainwallet to another MMGen wallet format) using an older version of MMGen
|
||||
before upgrading.
|
||||
|
||||
[1]: ../../doc/README.mswin.md
|
||||
[1]: /doc/README.mswin.md
|
||||
|
|
|
|||
|
|
@ -436,12 +436,12 @@ Removed {{}} duplicate WIF key{{}} from keylist (also in {pnm} key-address file
|
|||
e.sec = PrivKey(sha256(sha256(seed).digest()).digest(),compressed=compressed,pubkey_type=pubkey_type)
|
||||
|
||||
if self.gen_addrs:
|
||||
ph = kg.to_pubhex(e.sec)
|
||||
e.addr = ag.to_addr(ph)
|
||||
pubhex = kg.to_pubhex(e.sec)
|
||||
e.addr = ag.to_addr(pubhex)
|
||||
if gen_viewkey:
|
||||
e.viewkey = ag.to_viewkey(ph)
|
||||
e.viewkey = ag.to_viewkey(pubhex)
|
||||
if gen_wallet_passwd:
|
||||
e.wallet_passwd = ag.to_wallet_passwd(ph)
|
||||
e.wallet_passwd = ag.to_wallet_passwd(e.sec)
|
||||
|
||||
if type(self) == PasswordList:
|
||||
e.passwd = unicode(self.make_passwd(e.sec)) # TODO - own type
|
||||
|
|
|
|||
|
|
@ -745,12 +745,15 @@ class MMGenAddrType(str,Hilite,InitErrors,MMGenObject):
|
|||
'compressed':False,
|
||||
'gen_method':'zcash_z',
|
||||
'addr_fmt':'zcash_z',
|
||||
'extra_attrs': ('viewkey',),
|
||||
'desc':'Zcash z-address' },
|
||||
'M': { 'name':'monero',
|
||||
'pubkey_type':'monero',
|
||||
'compressed':False,
|
||||
'gen_method':'monero',
|
||||
'addr_fmt':'monero',
|
||||
'wif_label':'spendkey:',
|
||||
'extra_attrs': ('viewkey','wallet_passwd'),
|
||||
'desc':'Monero address'}
|
||||
}
|
||||
def __new__(cls,s,on_fail='die',errmsg=None):
|
||||
|
|
@ -766,10 +769,8 @@ class MMGenAddrType(str,Hilite,InitErrors,MMGenObject):
|
|||
setattr(me,k,v[k])
|
||||
assert me in g.proto.mmtypes + ('P',), (
|
||||
"'{}': invalid address type for {}".format(me.name,g.proto.__name__))
|
||||
me.extra_attrs = []
|
||||
if me.name in ('monero','zcash_z'): me.extra_attrs += ['viewkey']
|
||||
if me.name == 'monero': me.extra_attrs += ['wallet_passwd']
|
||||
me.wif_label = ('wif:','spendkey:')[me.name=='monero']
|
||||
me.extra_attrs = v['extra_attrs'] if 'extra_attrs' in v else ()
|
||||
me.wif_label = v['wif_label'] if 'wif_label' in v else 'wif:'
|
||||
return me
|
||||
raise ValueError,'not found'
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue