ghassmo 4 лет назад
Родитель
Сommit
d58e1e7f38
1 измененных файлов с 13 добавлено и 5 удалено
  1. 13 5
      src/wallet/walletdb.rs

+ 13 - 5
src/wallet/walletdb.rs

@@ -1,6 +1,7 @@
 use super::WalletApi;
 use super::WalletApi;
 use crate::client::ClientFailed;
 use crate::client::ClientFailed;
-use crate::crypto::{ merkle::IncrementalWitness, merkle_node::MerkleNode, note::Note, OwnCoin, OwnCoins,
+use crate::crypto::{
+    merkle::IncrementalWitness, merkle_node::MerkleNode, note::Note, OwnCoin, OwnCoins,
 };
 };
 use crate::serial;
 use crate::serial;
 use crate::{Error, Result};
 use crate::{Error, Result};
@@ -57,7 +58,10 @@ impl WalletDb {
                 conn.execute_batch(&contents)?;
                 conn.execute_batch(&contents)?;
                 *self.initialized.lock().await = true;
                 *self.initialized.lock().await = true;
             } else {
             } else {
-                debug!(target: "WALLETDB", "Password is empty. You must set a password to use the wallet.");
+                debug!(
+                target: "WALLETDB",
+                "Password is empty. You must set a password to use the wallet."
+                );
                 return Err(Error::from(ClientFailed::EmptyPassword));
                 return Err(Error::from(ClientFailed::EmptyPassword));
             }
             }
         } else {
         } else {
@@ -197,8 +201,10 @@ impl WalletDb {
         }
         }
 
 
         conn.execute(
         conn.execute(
-            "INSERT INTO coins(coin, serial, value, asset_id, coin_blind, valcom_blind, witness, key_id)
-            VALUES (:coin, :serial, :value, :asset_id, :coin_blind, :valcom_blind, :witness, :key_id)",
+            "INSERT INTO coins
+            (coin, serial, value, asset_id, coin_blind, valcom_blind, witness, key_id)
+            VALUES 
+            (:coin, :serial, :value, :asset_id, :coin_blind, :valcom_blind, :witness, :key_id);",
             named_params! {
             named_params! {
                 ":coin": coin,
                 ":coin": coin,
                 ":serial": serial,
                 ":serial": serial,
@@ -307,7 +313,9 @@ mod tests {
             conn.pragma_update(None, "key", &password)?;
             conn.pragma_update(None, "key", &password)?;
             conn.execute_batch(&contents)?;
             conn.execute_batch(&contents)?;
         } else {
         } else {
-            debug!(target: "WALLETDB", "Password is empty. You must set a password to use the wallet.");
+            debug!(
+            target: "WALLETDB", "Password is empty. You must set a password to use the wallet."
+            );
             return Err(Error::from(ClientFailed::EmptyPassword));
             return Err(Error::from(ClientFailed::EmptyPassword));
         }
         }
         Ok(())
         Ok(())