ghassmo 4 tahun lalu
induk
melakukan
043bb61f78

+ 1 - 1
src/client.rs

@@ -381,7 +381,7 @@ pub struct State {
 impl ProgramState for State {
     fn is_valid_cashier_public_key(&self, public: &jubjub::SubgroupPoint) -> bool {
         debug!(target: "CLIENT STATE", "Check if it is valid cashier public key");
-        return self.public_keys.contains(public);
+        self.public_keys.contains(public)
     }
 
     fn is_valid_merkle(&self, merkle_root: &MerkleNode) -> bool {

+ 1 - 1
src/rpc/rpcserver.rs

@@ -103,7 +103,7 @@ async fn serve(
             },
             Err(e) => {
                 debug!(target: "RPC SERVER", "Failed to establish TLS connection: {:#}", e);
-                return Ok(());
+                Ok(())
             }
         },
     }

+ 1 - 1
src/service/btc.rs

@@ -312,7 +312,7 @@ impl BtcClient {
             input: inputs,
             output: vec![TxOut {
                 script_pubkey: main_script_pubkey,
-                value: value,
+                value,
             }],
             lock_time: 0,
             version: 2,

+ 2 - 2
src/service/sol.rs

@@ -219,8 +219,9 @@ impl SolClient {
             ));
         }
 
+        let amnt = cur_balance - prev_balance;
+
         if mint.is_some() {
-            let amnt = cur_balance - prev_balance;
             let ui_amnt = amnt / u64::pow(10, decimals as u32);
 
             send_notification
@@ -237,7 +238,6 @@ impl SolClient {
             debug!(target: "SOL BRIDGE", "Received {} {:?} tokens", ui_amnt, mint.unwrap());
             let _ = self.send_tok_to_main_wallet(&rpc, &mint.unwrap(), amnt, decimals, &keypair)?;
         } else {
-            let amnt = cur_balance - prev_balance;
             let ui_amnt = lamports_to_sol(amnt);
 
             send_notification

+ 2 - 2
src/wallet/cashierdb.rs

@@ -63,7 +63,7 @@ impl CashierDb {
                 let conn = Connection::open(&self.path)?;
                 debug!(target: "CASHIERDB", "Opened connection at path {:?}", self.path);
                 conn.pragma_update(None, "key", &self.password)?;
-                conn.execute_batch(&contents)?;
+                conn.execute_batch(contents)?;
                 *self.initialized.lock().await = true;
             } else {
                 debug!(
@@ -264,7 +264,7 @@ impl CashierDb {
             WHERE d_key_public = :d_key_public AND confirm = :confirm;",
         )?;
         let addr_iter = stmt.query_map(
-            &[(":d_key_public", &d_key_public), (":confirm", &&confirm)],
+            &[(":d_key_public", &d_key_public), (":confirm", &confirm)],
             |row| Ok((row.get(0)?, row.get(1)?, row.get(2)?, row.get(3)?)),
         )?;
 

+ 1 - 1
src/wallet/wallet_api.rs

@@ -13,7 +13,7 @@ pub trait WalletApi {
     }
 
     fn get_value_deserialized<D: Decodable>(&self, key: &Vec<u8>) -> Result<D> {
-        let v: D = deserialize(&key)?;
+        let v: D = deserialize(key)?;
         Ok(v)
     }
 }

+ 1 - 1
src/wallet/walletdb.rs

@@ -80,7 +80,7 @@ impl WalletDb {
                 let conn = Connection::open(&self.path)?;
                 debug!(target: "WALLETDB", "OPENED CONNECTION AT PATH {:?}", self.path);
                 conn.pragma_update(None, "key", &self.password)?;
-                conn.execute_batch(&contents)?;
+                conn.execute_batch(contents)?;
                 *self.initialized.lock().await = true;
             } else {
                 debug!(