move master_private_keys and master_public_keys to NewWallet
[electrum-nvc.git] / gui / android.py
index f57b539..a89673c 100644 (file)
@@ -345,7 +345,7 @@ def get_history_values(n):
                 time_str = str( dt.time() )
             else:
                 time_str = str( dt.date() )
-        except:
+        except Exception:
             time_str = 'pending'
 
         conf_str = 'v' if conf else 'o'
@@ -458,7 +458,7 @@ def pay_to(recipient, amount, fee, label):
 
     try:
         tx = wallet.mktx( [(recipient, amount)], password, fee)
-    except BaseException, e:
+    except Exception as e:
         modal_dialog('error', e.message)
         droid.dialogDismiss()
         return
@@ -488,7 +488,7 @@ def make_new_contact():
         data = r['extras']['SCAN_RESULT']
         if data:
             if re.match('^bitcoin:', data):
-                address, _, _, _, _, _, _ = util.parse_url(data)
+                address, _, _, _, _ = util.parse_URI(data)
             elif is_valid(data):
                 address = data
             else:
@@ -600,7 +600,7 @@ def payto_loop():
 
                 try:
                     amount = int( 100000000 * Decimal(amount) )
-                except:
+                except Exception:
                     modal_dialog('Error','Invalid amount')
                     continue
 
@@ -619,7 +619,7 @@ def payto_loop():
                     data = r['extras']['SCAN_RESULT']
                     if data:
                         if re.match('^bitcoin:', data):
-                            payto, amount, label, _, _, _, _ = util.parse_url(data)
+                            payto, amount, label, _, _ = util.parse_URI(data)
                             droid.fullSetProperty("recipient", "text",payto)
                             droid.fullSetProperty("amount", "text", amount)
                             droid.fullSetProperty("label", "text", label)
@@ -717,8 +717,8 @@ def show_seed():
         password = None
     
     try:
-        seed = wallet.decode_seed(password)
-    except:
+        seed = wallet.get_seed(password)
+    except Exception:
         modal_dialog('error','incorrect password')
         return
 
@@ -733,8 +733,8 @@ def change_password_dialog():
         password = None
 
     try:
-        seed = wallet.decode_seed(password)
-    except:
+        wallet.get_seed(password)
+    except Exception:
         modal_dialog('error','incorrect password')
         return
 
@@ -748,7 +748,7 @@ def change_password_dialog():
             modal_dialog('error','passwords do not match')
             return
 
-    wallet.update_password(seed, password, new_password)
+    wallet.update_password(password, new_password)
     if new_password:
         modal_dialog('Password updated','your wallet is encrypted')
     else:
@@ -811,7 +811,7 @@ def settings_loop():
                 if fee:
                     try:
                         fee = int( 100000000 * Decimal(fee) )
-                    except:
+                    except Exception:
                         modal_dialog('error','invalid fee value')
                     wallet.set_fee(fee)
                     set_listview()
@@ -828,7 +828,7 @@ def settings_loop():
                 auto_connect = False
                 try:
                     network.set_parameters(host, port, protocol, proxy, auto_connect)
-                except:
+                except Exception:
                     modal_dialog('error','invalid server')
                 set_listview()
 
@@ -903,8 +903,7 @@ class ElectrumGui:
             if action == 'create':
                 wallet.init_seed(None)
                 self.show_seed()
-                wallet.save_seed()
-                wallet.create_accounts()
+                wallet.save_seed(None)
                 wallet.synchronize()  # generate first addresses offline
                 
             elif action == 'restore':
@@ -912,7 +911,7 @@ class ElectrumGui:
                 if not seed:
                     exit()
                 wallet.init_seed(str(seed))
-                wallet.save_seed()
+                wallet.save_seed(None)
             else:
                 exit()
 
@@ -987,7 +986,7 @@ class ElectrumGui:
             m = modal_input('Mnemonic','please enter your code')
             try:
                 seed = mnemonic_decode(m.split(' '))
-            except:
+            except Exception:
                 modal_dialog('error: could not decode this seed')
                 return
 
@@ -997,9 +996,6 @@ class ElectrumGui:
     def network_dialog(self):
         return True
 
-    def verify_seed(self):
-        wallet.save_seed()
-        return True
         
     def show_seed(self):
         modal_dialog('Your seed is:', wallet.seed)