From 374ee2f1b321196bfb44757e4a46e291bdfc433a Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:03:54 +0100 Subject: [PATCH] fix lints. (#421) --- mining/src/model/topological_index.rs | 2 +- rothschild/src/main.rs | 4 ++-- rpc/grpc/core/src/convert/header.rs | 4 ++-- testing/integration/src/common/utils.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mining/src/model/topological_index.rs b/mining/src/model/topological_index.rs index 82c29d755..96e0673da 100644 --- a/mining/src/model/topological_index.rs +++ b/mining/src/model/topological_index.rs @@ -114,7 +114,7 @@ where Ok(sorted) } - fn check_topological_order(&'a self, sorted: &Vec) -> TopologicalIndexResult<()> { + fn check_topological_order(&'a self, sorted: &[TKey]) -> TopologicalIndexResult<()> { let nodes = self.topology_nodes().collect::>(); if sorted.len() != nodes.len() { return Err(TopologicalIndexError::IndexHasWrongKeySet); diff --git a/rothschild/src/main.rs b/rothschild/src/main.rs index 3137ad9bc..e846702ba 100644 --- a/rothschild/src/main.rs +++ b/rothschild/src/main.rs @@ -265,7 +265,7 @@ async fn main() { fn should_maximize_inputs( old_value: bool, - utxos: &Vec<(TransactionOutpoint, UtxoEntry)>, + utxos: &[(TransactionOutpoint, UtxoEntry)], pending: &HashMap, ) -> bool { let estimated_utxos = if utxos.len() > pending.len() { utxos.len() - pending.len() } else { 0 }; @@ -353,7 +353,7 @@ async fn maybe_send_tx( txs_to_send: u64, tx_sender: &async_channel::Sender, kaspa_addr: Address, - utxos: &mut Vec<(TransactionOutpoint, UtxoEntry)>, + utxos: &mut [(TransactionOutpoint, UtxoEntry)], pending: &mut HashMap, schnorr_key: KeyPair, stats: Arc>, diff --git a/rpc/grpc/core/src/convert/header.rs b/rpc/grpc/core/src/convert/header.rs index 9a9ac0928..f4d78b7c1 100644 --- a/rpc/grpc/core/src/convert/header.rs +++ b/rpc/grpc/core/src/convert/header.rs @@ -64,14 +64,14 @@ mod tests { RpcHash::from_u64_word(c) } - fn test_parents_by_level_rxr(r: &Vec>, r2: &[Vec]) { + fn test_parents_by_level_rxr(r: &[Vec], r2: &[Vec]) { for i in 0..r.len() { for j in 0..r[i].len() { assert_eq!(r[i][j], r2[i][j]); } } } - fn test_parents_by_level_rxp(r: &Vec>, p: &[protowire::RpcBlockLevelParents]) { + fn test_parents_by_level_rxp(r: &[Vec], p: &[protowire::RpcBlockLevelParents]) { for i in 0..r.len() { for j in 0..r[i].len() { assert_eq!(r[i][j].to_string(), p[i].parent_hashes[j]); diff --git a/testing/integration/src/common/utils.rs b/testing/integration/src/common/utils.rs index 93669e791..cbde1bd53 100644 --- a/testing/integration/src/common/utils.rs +++ b/testing/integration/src/common/utils.rs @@ -90,7 +90,7 @@ pub fn generate_tx_dag( } /// Sanity test verifying that the generated TX DAG is valid, topologically ordered and has no double spends -pub fn verify_tx_dag(initial_utxoset: &UtxoCollection, txs: &Vec>) { +pub fn verify_tx_dag(initial_utxoset: &UtxoCollection, txs: &[Arc]) { let mut prev_txs: HashMap> = HashMap::new(); let mut used_outpoints = HashSet::with_capacity(txs.len() * 2); for tx in txs.iter() {