Merge branch 'moneroexamples-cash_ed_calculations'

This commit is contained in:
Michał Sałaban 2019-01-31 10:53:42 +01:00
commit 517a5d52e4
1 changed files with 11 additions and 2 deletions

View File

@ -61,6 +61,9 @@ class Seed(object):
self.word_list = wordlists.get_wordlist(wordlist)
self._ed_pub_spend_key = None
self._ed_pub_view_key = None
if phrase_or_hex:
seed_split = phrase_or_hex.split(" ")
if len(seed_split) >= 24:
@ -137,10 +140,16 @@ class Seed(object):
return self.sc_reduce(h.digest())
def public_spend_key(self):
return ed25519.public_from_secret_hex(self.secret_spend_key())
if self._ed_pub_spend_key:
return self._ed_pub_spend_key
self._ed_pub_spend_key = ed25519.public_from_secret_hex(self.secret_spend_key())
return self._ed_pub_spend_key
def public_view_key(self):
return ed25519.public_from_secret_hex(self.secret_view_key())
if self._ed_pub_view_key:
return self._ed_pub_view_key
self._ed_pub_view_key = ed25519.public_from_secret_hex(self.secret_view_key())
return self._ed_pub_view_key
def public_address(self, net='mainnet'):
"""Returns the master :class:`Address <monero.address.Address>` represented by the seed.