Kaynağa Gözat

chore: minor cleanup

aggstam 3 yıl önce
ebeveyn
işleme
7c6a2b912c

+ 1 - 1
bin/lilith/src/main.rs

@@ -157,7 +157,7 @@ impl Lilith {
 
                     let connector = Connector::new(p2p_.settings(), Arc::new(session_weak));
                     debug!("Connecting to {}", host);
-                    match connector.connect(&host).await {
+                    match connector.connect(host).await {
                         Ok((_url, channel)) => {
                             debug!("Connected successfully!");
                             let proto_ver = ProtocolVersion::new(

+ 1 - 1
src/consensus/proto/protocol_sync.rs

@@ -141,7 +141,7 @@ impl ProtocolSync {
 
     async fn handle_receive_block(self: Arc<Self>) -> Result<()> {
         debug!(target: "consensus::protocol_sync::handle_receive_block()", "START");
-        let _exclude_list = vec![self.channel.address()];
+        let _exclude_list = [self.channel.address()];
         loop {
             let info = match self.block_sub.receive().await {
                 Ok(v) => v,

+ 2 - 1
src/contract/test-harness/src/dao_exec.rs

@@ -40,6 +40,7 @@ use rand::rngs::OsRng;
 use super::{Holder, TestHarness, TxAction};
 
 impl TestHarness {
+    #[allow(clippy::too_many_arguments)]
     pub fn dao_exec(
         &mut self,
         dao: &DaoInfo,
@@ -130,7 +131,7 @@ impl TestHarness {
             signature_secret: exec_signature_secret,
         };
 
-        let (exec_params, exec_proofs) = exec_builder.make(&dao_exec_zkbin, &dao_exec_pk)?;
+        let (exec_params, exec_proofs) = exec_builder.make(dao_exec_zkbin, dao_exec_pk)?;
         let mut data = vec![DaoFunction::Exec as u8];
         exec_params.encode(&mut data)?;
         let exec_call = ContractCall { contract_id: *DAO_CONTRACT_ID, data };

+ 8 - 8
src/contract/test-harness/src/dao_propose.rs

@@ -52,7 +52,7 @@ impl TestHarness {
         let tx_action_benchmark = self.tx_action_benchmarks.get_mut(&TxAction::DaoPropose).unwrap();
         let timer = Instant::now();
 
-        let wallet = self.holders.get(&proposer).unwrap();
+        let wallet = self.holders.get(proposer).unwrap();
         let propose_owncoin: OwnCoin = wallet
             .unspent_money_coins
             .iter()
@@ -73,7 +73,7 @@ impl TestHarness {
         };
 
         let proposal = DaoProposalInfo {
-            dest: self.holders.get(&recipient).unwrap().keypair.public,
+            dest: self.holders.get(recipient).unwrap().keypair.public,
             amount,
             token_id: tx_token_id,
             blind: pallas::Base::random(&mut OsRng),
@@ -83,19 +83,19 @@ impl TestHarness {
             inputs: vec![input],
             proposal: proposal.clone(),
             dao: dao.clone(),
-            dao_leaf_position: *wallet.dao_leafs.get(&dao_bulla).unwrap(),
+            dao_leaf_position: *wallet.dao_leafs.get(dao_bulla).unwrap(),
             dao_merkle_path: wallet
                 .dao_merkle_tree
-                .witness(*wallet.dao_leafs.get(&dao_bulla).unwrap(), 0)
+                .witness(*wallet.dao_leafs.get(dao_bulla).unwrap(), 0)
                 .unwrap(),
             dao_merkle_root: wallet.dao_merkle_tree.root(0).unwrap(),
         };
 
         let (params, proofs) = call.make(
-            &dao_propose_burn_zkbin,
-            &dao_propose_burn_pk,
-            &dao_propose_main_zkbin,
-            &dao_propose_main_pk,
+            dao_propose_burn_zkbin,
+            dao_propose_burn_pk,
+            dao_propose_main_zkbin,
+            dao_propose_main_pk,
         )?;
 
         let mut data = vec![DaoFunction::Propose as u8];

+ 5 - 5
src/contract/test-harness/src/dao_vote.rs

@@ -55,7 +55,7 @@ impl TestHarness {
         let wallet = self.holders.get(voter).unwrap();
 
         let (_proposal_leaf_pos, money_merkle_tree) =
-            wallet.dao_prop_leafs.get(&proposal_bulla).unwrap();
+            wallet.dao_prop_leafs.get(proposal_bulla).unwrap();
 
         let vote_owncoin: OwnCoin = wallet
             .unspent_money_coins
@@ -83,10 +83,10 @@ impl TestHarness {
         };
 
         let (params, proofs) = call.make(
-            &dao_vote_burn_zkbin,
-            &dao_vote_burn_pk,
-            &dao_vote_main_zkbin,
-            &dao_vote_main_pk,
+            dao_vote_burn_zkbin,
+            dao_vote_burn_pk,
+            dao_vote_main_zkbin,
+            dao_vote_main_pk,
         )?;
 
         let mut data = vec![DaoFunction::Vote as u8];

+ 1 - 1
src/contract/test-harness/src/lib.rs

@@ -361,7 +361,7 @@ impl TestHarness {
         output: &Output,
         secret_key: Option<SecretKey>,
     ) -> Result<OwnCoin> {
-        let wallet = self.holders.get_mut(&holder).unwrap();
+        let wallet = self.holders.get_mut(holder).unwrap();
         let leaf_position = wallet.money_merkle_tree.mark().unwrap();
         let secret_key = match secret_key {
             Some(key) => key,

+ 1 - 1
src/contract/test-harness/src/money_otc_swap.rs

@@ -160,7 +160,7 @@ impl TestHarness {
         slot: u64,
         append: bool,
     ) -> Result<()> {
-        let wallet = self.holders.get_mut(&holder).unwrap();
+        let wallet = self.holders.get_mut(holder).unwrap();
         let tx_action_benchmark =
             self.tx_action_benchmarks.get_mut(&TxAction::MoneyOtcSwap).unwrap();
         let timer = Instant::now();

+ 1 - 0
src/sdk/src/blockchain.rs

@@ -49,6 +49,7 @@ pub struct Slot {
 }
 
 impl Slot {
+    #[allow(clippy::too_many_arguments)]
     pub fn new(
         id: u64,
         previous_eta: pallas::Base,

+ 1 - 1
src/validator/mod.rs

@@ -197,7 +197,7 @@ impl Validator {
                 &overlay,
                 &time_keeper,
                 block,
-                &previous,
+                previous,
                 expected_reward,
                 self.testing_mode,
             )