serinko 4 anni fa
parent
commit
e30bdb3c79
1 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. 6 4
      whallets_cli.py

+ 6 - 4
whallets_cli.py

@@ -90,12 +90,14 @@ def confirm_entry(addresses, new_wallet):
 
 def save_wallet(ntw_i, new_wallet_dictionary):
     """Saves the wallet into the database/dictionary and informs the user"""
-
-    dict = get_wallets()[ntw_i]
-
+   
     filename = 'wallets_dict.json'
+
     with open(filename) as f:
-        f[dict].update(new_wallet_dictionary)
+        all_wallets = json.load(f)
+        dict = all_wallets[ntw_i]
+
+        all_wallets[dict].update(new_wallet_dictionary)
         json.dump(f)