From ad971bbdd5b36490272b75fdfc2c85a853506f72 Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou Date: Wed, 20 Apr 2022 03:26:58 +0300 Subject: [PATCH] Fix typos (#4112) --- zebra-rpc/src/methods/tests/prop.rs | 8 ++++---- zebra-rpc/src/methods/tests/vectors.rs | 2 +- zebra-rpc/src/queue.rs | 10 +++++----- zebra-rpc/src/queue/tests/prop.rs | 4 ++-- .../src/service/non_finalized_state/chain/index.rs | 2 +- zebra-state/src/service/read.rs | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/zebra-rpc/src/methods/tests/prop.rs b/zebra-rpc/src/methods/tests/prop.rs index 2288ff9ab..55c57a23e 100644 --- a/zebra-rpc/src/methods/tests/prop.rs +++ b/zebra-rpc/src/methods/tests/prop.rs @@ -635,7 +635,7 @@ proptest! { .await? .respond(response); - // no more requets are done + // no more requests are done mempool.expect_no_requests().await?; state.expect_no_requests().await?; @@ -680,7 +680,7 @@ proptest! { let tx_unmined = UnminedTx::from(tx.clone()); let expected_request = mempool::Request::Queue(vec![tx_unmined.clone().into()]); - // inser to hs we will use later + // insert to hs we will use later transactions_hash_set.insert(tx_unmined.id); // fail the mempool insertion @@ -700,7 +700,7 @@ proptest! { let spacing = chrono::Duration::seconds(150); tokio::time::advance(spacing.to_std().unwrap()).await; - // the runner will made a new call to TransactionsById quering with both transactions + // the runner will made a new call to TransactionsById querying with both transactions let expected_request = mempool::Request::TransactionsById(transactions_hash_set); let response = mempool::Response::Transactions(vec![]); @@ -731,7 +731,7 @@ proptest! { .respond(response); } - // no more requets are done + // no more requests are done mempool.expect_no_requests().await?; state.expect_no_requests().await?; diff --git a/zebra-rpc/src/methods/tests/vectors.rs b/zebra-rpc/src/methods/tests/vectors.rs index f2799a6cd..d034cc0d5 100644 --- a/zebra-rpc/src/methods/tests/vectors.rs +++ b/zebra-rpc/src/methods/tests/vectors.rs @@ -429,7 +429,7 @@ async fn rpc_getaddresstxids_response() { .await .expect("arguments are valid so no error can happen here"); - // TODO: The lenght of the response should be 1 + // TODO: The length of the response should be 1 // Fix in the context of #3147 assert_eq!(response.len(), 0); diff --git a/zebra-rpc/src/queue.rs b/zebra-rpc/src/queue.rs index 6b960360f..880b13cac 100644 --- a/zebra-rpc/src/queue.rs +++ b/zebra-rpc/src/queue.rs @@ -1,7 +1,7 @@ //! Transaction Queue. //! //! All transactions that are sent from RPC methods should be added to this queue for retries. -//! Transactions can fail to be inserted to the mempool inmediatly by different reasons, +//! Transactions can fail to be inserted to the mempool immediately by different reasons, //! like having not mined utxos. //! //! The [`Queue`] is just an `IndexMap` of transactions with insertion date. @@ -130,7 +130,7 @@ impl Runner { self.tip_height = height; } - /// Retry sending to memempool if needed. + /// Retry sending to mempool if needed. /// /// Creates a loop that will run each time a new block is mined. /// In this loop, get the transactions that are in the queue and: @@ -140,7 +140,7 @@ impl Runner { /// - With the transactions left in the queue, retry sending them to the mempool ignoring /// the result of this operation. /// - /// Addtionally, each iteration of the above loop, will receive and insert to the queue + /// Additionally, each iteration of the above loop, will receive and insert to the queue /// transactions that are pending in the channel. pub async fn run( mut self, @@ -311,10 +311,10 @@ impl Runner { let gossip = Gossip::Tx(unmined.clone()); let request = Request::Queue(vec![gossip]); - // Send to memmpool and ignore any error + // Send to mempool and ignore any error let _ = mempool.clone().oneshot(request).await; - // retrurn what we retried but don't delete from the queue, + // return what we retried but don't delete from the queue, // we might retry again in a next call. retried.insert(unmined.id); } diff --git a/zebra-rpc/src/queue/tests/prop.rs b/zebra-rpc/src/queue/tests/prop.rs index e4851d756..f4df80f80 100644 --- a/zebra-rpc/src/queue/tests/prop.rs +++ b/zebra-rpc/src/queue/tests/prop.rs @@ -117,7 +117,7 @@ proptest! { // have a block interval value equal to the one at Height(1) let spacing = Duration::seconds(150); - // apply expiration inmediatly, transaction will not be removed from queue + // apply expiration immediately, transaction will not be removed from queue runner.remove_expired(spacing); prop_assert_eq!(runner.queue.transactions().len(), 1); @@ -229,7 +229,7 @@ proptest! { runner.remove_committed(result); prop_assert_eq!(runner.queue.transactions().len(), 0); - // no more requets expected + // no more requests expected mempool.expect_no_requests().await?; Ok::<_, TestCaseError>(()) diff --git a/zebra-state/src/service/non_finalized_state/chain/index.rs b/zebra-state/src/service/non_finalized_state/chain/index.rs index b57055ff9..f1f73523f 100644 --- a/zebra-state/src/service/non_finalized_state/chain/index.rs +++ b/zebra-state/src/service/non_finalized_state/chain/index.rs @@ -206,7 +206,7 @@ impl TransparentTransfers { } /// Returns the [`transaction::Hash`]es of the transactions that - /// sent or received transparent tranfers to this address, + /// sent or received transparent transfers to this address, /// in this partial chain, in chain order. /// /// `chain_tx_by_hash` should be the `tx_by_hash` field from the [`Chain`] containing this index. diff --git a/zebra-state/src/service/read.rs b/zebra-state/src/service/read.rs index 4ab7cf500..b791ba5ba 100644 --- a/zebra-state/src/service/read.rs +++ b/zebra-state/src/service/read.rs @@ -103,7 +103,7 @@ pub(crate) fn transparent_balance( ) -> Result, BoxError> { let mut balance_result = finalized_transparent_balance(db, &addresses); - // Retry the finalized balance query if it was interruped by a finalizing block + // Retry the finalized balance query if it was interrupted by a finalizing block for _ in 0..FINALIZED_ADDRESS_INDEX_RETRIES { if balance_result.is_ok() { break;