From 5bb441ce3768f9daacb2453067df90fecba85595 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 4 Nov 2012 19:40:17 +0100 Subject: [PATCH] add mnemonic functions to module --- electrum | 6 +++--- lib/__init__.py | 2 ++ lib/interface.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/electrum b/electrum index a0809dd60..d0809cd0c 100755 --- a/electrum +++ b/electrum @@ -253,7 +253,7 @@ if __name__ == '__main__': seed.decode('hex') except: print_error("Warning: Not hex, trying decode.") - seed = mnemonic.mn_decode( seed.split(' ') ) + seed = mnemonic_decode( seed.split(' ') ) if not seed: sys.exit("Error: No seed") @@ -282,7 +282,7 @@ if __name__ == '__main__': print "Your wallet generation seed is: " + wallet.seed print "Please keep it in a safe place; if you lose it, you will not be able to restore your wallet." print "Equivalently, your wallet seed can be stored and recovered with the following mnemonic code:" - print "\""+' '.join(mnemonic.mn_encode(wallet.seed))+"\"" + print "\""+' '.join(mnemonic_encode(wallet.seed))+"\"" print "Wallet saved in '%s'"%wallet.config.path if password: @@ -360,7 +360,7 @@ if __name__ == '__main__': elif cmd == 'seed': seed = wallet.pw_decode( wallet.seed, password) - print seed + ' "' + ' '.join(mnemonic.mn_encode(seed)) + '"' + print seed + ' "' + ' '.join(mnemonic_encode(seed)) + '"' elif cmd == 'deseed': if not wallet.seed: diff --git a/lib/__init__.py b/lib/__init__.py index 3d9e7cecb..086f534e4 100644 --- a/lib/__init__.py +++ b/lib/__init__.py @@ -4,3 +4,5 @@ from verifier import WalletVerifier from interface import Interface, pick_random_server, DEFAULT_SERVERS from simple_config import SimpleConfig import bitcoin +from mnemonic import mn_encode as mnemonic_encode +from mnemonic import mn_decode as mnemonic_decode diff --git a/lib/interface.py b/lib/interface.py index 89934f85c..f27306e24 100644 --- a/lib/interface.py +++ b/lib/interface.py @@ -75,7 +75,7 @@ class Interface(threading.Thread): def queue_json_response(self, c): # uncomment to debug - # print "<--",c + # print_error( "<--",c ) msg_id = c.get('id') error = c.get('error')