From b073451b479575e36f1c0d7e7629e9f8b5de1cd8 Mon Sep 17 00:00:00 2001 From: Avery Ching Date: Tue, 18 Jun 2019 03:19:07 -0700 Subject: [PATCH] Spell check comments and typos in comments Spell check comments and typos in comments --- .../src/admission_control_node.rs | 2 +- client/libra_wallet/README.md | 2 +- client/libra_wallet/src/error.rs | 2 +- client/libra_wallet/src/io_utils.rs | 2 +- client/libra_wallet/src/key_factory.rs | 2 +- client/src/client_proxy.rs | 2 +- client/src/commands.rs | 4 ++-- common/channel/src/lib.rs | 2 +- common/grpcio-client/src/util.rs | 2 +- common/metrics/src/service_metrics.rs | 2 +- config/config_builder/src/swarm_config.rs | 2 +- crypto/legacy_crypto/src/hash.rs | 2 +- crypto/nextgen_crypto/src/ed25519.rs | 2 +- crypto/nextgen_crypto/src/vrf/unit_tests/vrf_test.rs | 6 +++--- crypto/secret_service/src/secret_service_server.rs | 2 +- .../execution_service/tests/storage_integration_test.rs | 4 ++-- execution/executor/src/block_processor.rs | 4 ++-- execution/executor/src/block_tree/mod.rs | 2 +- execution/executor/src/executor_test.rs | 2 +- execution/executor/src/transaction_block.rs | 2 +- language/README.md | 4 ++-- language/bytecode_verifier/src/stack_usage_verifier.rs | 2 +- language/compiler/src/compiler.rs | 4 ++-- .../_old_move_ir_tests/src/tests/epilogue.rs | 2 +- .../create_account_script.mvir | 2 +- language/vm/cost_synthesis/src/module_generator.rs | 2 +- language/vm/vm_runtime/src/txn_executor.rs | 2 +- libra_swarm/src/swarm.rs | 2 +- mempool/src/core_mempool/unit_tests/core_mempool_test.rs | 2 +- mempool/src/unit_tests/service_test.rs | 2 +- network/netcore/src/negotiate/inbound.rs | 2 +- network/netcore/src/negotiate/outbound.rs | 2 +- network/src/connectivity_manager/mod.rs | 6 +++--- network/src/peer_manager/tests.rs | 8 ++++---- network/src/proto/network.proto | 2 +- network/src/protocols/direct_send/mod.rs | 2 +- network/src/protocols/discovery/mod.rs | 4 ++-- network/src/protocols/health_checker/mod.rs | 2 +- network/src/protocols/rpc/mod.rs | 2 +- scripts/cargo_check_dependencies.sh | 2 +- storage/libradb/src/lib.rs | 2 +- storage/sparse_merkle/src/lib.rs | 2 +- storage/sparse_merkle/src/node_type/mod.rs | 6 +++--- storage/storage_proto/src/proto/storage.proto | 2 +- types/src/access_path.rs | 2 +- types/src/proof/mod.rs | 2 +- 46 files changed, 61 insertions(+), 61 deletions(-) diff --git a/admission_control/admission_control_service/src/admission_control_node.rs b/admission_control/admission_control_service/src/admission_control_node.rs index 64ab520067e5..8f74d873f18b 100644 --- a/admission_control/admission_control_service/src/admission_control_node.rs +++ b/admission_control/admission_control_service/src/admission_control_node.rs @@ -73,7 +73,7 @@ impl AdmissionControlNode { mp_client: Arc, storage_client: Option>, ) -> Result<()> { - // create storage client if doesnt exist + // create storage client if doesn't exist let storage_client: Arc = match storage_client { Some(c) => c, None => Arc::new(StorageReadServiceClient::new( diff --git a/client/libra_wallet/README.md b/client/libra_wallet/README.md index aaabecfe1475..8c1daa9a0055 100644 --- a/client/libra_wallet/README.md +++ b/client/libra_wallet/README.md @@ -12,4 +12,4 @@ The `internal_macros.rs` is taken from [`rust-bitcoin`](https://github.com/rust- `key_factory.rs` implements the key derivation functions. The `KeyFactory` struct holds the Master Secret Material used to derive the Child Key(s). The constructor of a particular `KeyFactory` accepts a `[u8; 64]` `Seed` and computes both the `Master` Secret Material as well as the `ChainCode` from the HMAC-512 of the `Seed`. Finally, the `KeyFactory` allows to derive a child PrivateKey at a particular `ChildNumber` from the Master and ChainCode, as well as the `ChildNumber`'s u64 member. -`wallet_library.rs` is a thin wrapper around `KeyFactory` which enables to keep track of Libra `AccountAddresses` and the information required to restore the current wallet from a `Mnemonic` backup. The `WalletLibrary` struct includes constructors that allow to generate a new `WalletLibrary` from OS randomness or generate a `WalletLibrary` from an instance of `Mnemonic`. `WalletLibrary` also allows to generate new addresses in-order or out-of-order via the `fn new_address` and `fn new_address_at_child_number`. Finally, `WalletLibrary` is capable of signing a Libra `RawTransaction` withe PrivateKey associated to the `AccountAddress` submitted. Note that in the future, Libra will support rotating authentication keys and therefore, `WalletLibrary` will need to understand more general inputs when mapping `AuthenticationKeys` to `PrivateKeys` +`wallet_library.rs` is a thin wrapper around `KeyFactory` which enables to keep track of Libra `AccountAddresses` and the information required to restore the current wallet from a `Mnemonic` backup. The `WalletLibrary` struct includes constructors that allow to generate a new `WalletLibrary` from OS randomness or generate a `WalletLibrary` from an instance of `Mnemonic`. `WalletLibrary` also allows to generate new addresses in-order or out-of-order via the `fn new_address` and `fn new_address_at_child_number`. Finally, `WalletLibrary` is capable of signing a Libra `RawTransaction` with the PrivateKey associated to the `AccountAddress` submitted. Note that in the future, Libra will support rotating authentication keys and therefore, `WalletLibrary` will need to understand more general inputs when mapping `AuthenticationKeys` to `PrivateKeys` diff --git a/client/libra_wallet/src/error.rs b/client/libra_wallet/src/error.rs index e71f01f28149..99a58159dab6 100644 --- a/client/libra_wallet/src/error.rs +++ b/client/libra_wallet/src/error.rs @@ -8,7 +8,7 @@ use std::{convert, error::Error, fmt, io}; /// We define our own Result type in order to not have to import the libra/common/failture_ext pub type Result = ::std::result::Result; -/// Libra Wallet Error is a convenience enum for generating arbitarary WalletErrors. Curently, only +/// Libra Wallet Error is a convenience enum for generating arbitarary WalletErrors. Currently, only /// the LibraWalletGeneric error is being used, but there are plans to add more specific errors as /// LibraWallet matures pub enum WalletError { diff --git a/client/libra_wallet/src/io_utils.rs b/client/libra_wallet/src/io_utils.rs index d53679cad01c..9249c874cc63 100644 --- a/client/libra_wallet/src/io_utils.rs +++ b/client/libra_wallet/src/io_utils.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 //! A module to generate, store and load known users accounts. -//! The concept of known users can be helpful for testing to provide reproducable results. +//! The concept of known users can be helpful for testing to provide reproducible results. use crate::*; use failure::prelude::*; diff --git a/client/libra_wallet/src/key_factory.rs b/client/libra_wallet/src/key_factory.rs index 4978e9e63a5a..b70877b6dce0 100644 --- a/client/libra_wallet/src/key_factory.rs +++ b/client/libra_wallet/src/key_factory.rs @@ -159,7 +159,7 @@ impl KeyFactory { } } -/// Seed is the ouput of a one-way function, which accepts a Mnemonic as input +/// Seed is the output of a one-way function, which accepts a Mnemonic as input pub struct Seed([u8; 32]); impl Seed { diff --git a/client/src/client_proxy.rs b/client/src/client_proxy.rs index 1b02965e4a91..b43c64f63e3d 100644 --- a/client/src/client_proxy.rs +++ b/client/src/client_proxy.rs @@ -212,7 +212,7 @@ impl ClientProxy { ret } - /// Get balance from validator for the account sepcified. + /// Get balance from validator for the account specified. pub fn get_balance(&mut self, space_delim_strings: &[&str]) -> Result { ensure!( space_delim_strings.len() == 2, diff --git a/client/src/commands.rs b/client/src/commands.rs index 5973bb6a2174..851a13e9c075 100644 --- a/client/src/commands.rs +++ b/client/src/commands.rs @@ -39,7 +39,7 @@ pub fn blocking_cmd(cmd: &str) -> bool { cmd.ends_with('b') } -/// Chech whether a command is debugging command. +/// Check whether a command is debugging command. pub fn debug_format_cmd(cmd: &str) -> bool { cmd.ends_with('?') } @@ -131,7 +131,7 @@ pub trait Command { fn get_params_help(&self) -> &'static str { "" } - /// string that describes whet command does. + /// string that describes what the command does. fn get_description(&self) -> &'static str; /// code to execute. fn execute(&self, client: &mut ClientProxy, params: &[&str]); diff --git a/common/channel/src/lib.rs b/common/channel/src/lib.rs index c831e2ca9528..6a26eb5c7238 100644 --- a/common/channel/src/lib.rs +++ b/common/channel/src/lib.rs @@ -118,7 +118,7 @@ impl FusedStream for Receiver { } /// `Receiver` implements `Stream` in the same way as `mpsc::Stream`, but it decrements the -/// associated `IntGauge` when it gets polled sucessfully. +/// associated `IntGauge` when it gets polled successfully. impl Stream for Receiver { type Item = T; diff --git a/common/grpcio-client/src/util.rs b/common/grpcio-client/src/util.rs index 3e96747b8cb0..4d46f0fc040c 100644 --- a/common/grpcio-client/src/util.rs +++ b/common/grpcio-client/src/util.rs @@ -71,7 +71,7 @@ pub fn protoc_descriptor_set( let protoc = Protoc::from_env_path(); protoc .check() - .expect("failed to find `protoc`, `protoc` must be availabe in `PATH`"); + .expect("failed to find `protoc`, `protoc` must be available in `PATH`"); let descriptor_set = Temp::new_file()?; diff --git a/common/metrics/src/service_metrics.rs b/common/metrics/src/service_metrics.rs index 54b21de54b52..1544f38da4bf 100644 --- a/common/metrics/src/service_metrics.rs +++ b/common/metrics/src/service_metrics.rs @@ -8,7 +8,7 @@ metrics about a gRPC server. For each method, the counters that are captured are: - num_req: number of requests - num_error: number of errors (can be used to calculate error rate) -- duration: duration (in units determined by the exporter) the rquest too, bucketed +- duration: duration (in units determined by the exporter) the request too, bucketed Example use: call `req` when when entering service method, and call `resp` on diff --git a/config/config_builder/src/swarm_config.rs b/config/config_builder/src/swarm_config.rs index 3b57f4ff9401..5dd4181941f4 100644 --- a/config/config_builder/src/swarm_config.rs +++ b/config/config_builder/src/swarm_config.rs @@ -233,7 +233,7 @@ impl SwarmConfigBuilder { // generate all things needed for generation if !self.output_dir.is_dir() { if !self.output_dir.exists() { - // generate if doesnt exist + // generate if doesn't exist std::fs::create_dir(&self.output_dir).expect("Failed to create output dir"); } assert!( diff --git a/crypto/legacy_crypto/src/hash.rs b/crypto/legacy_crypto/src/hash.rs index 819e41487e81..5d065f0f8e60 100644 --- a/crypto/legacy_crypto/src/hash.rs +++ b/crypto/legacy_crypto/src/hash.rs @@ -354,7 +354,7 @@ pub trait CryptoHasher: Default { } } -/// Our preferred hashing schema, outputing [`HashValue`]s. +/// Our preferred hashing schema, outputting [`HashValue`]s. /// * Hashing is parameterized by a `domain` to prevent domain /// ambiguity attacks. /// * The existence of serialization/deserialization function rules diff --git a/crypto/nextgen_crypto/src/ed25519.rs b/crypto/nextgen_crypto/src/ed25519.rs index 2dfeeb93ab06..d1d9b110e654 100644 --- a/crypto/nextgen_crypto/src/ed25519.rs +++ b/crypto/nextgen_crypto/src/ed25519.rs @@ -309,7 +309,7 @@ impl Signature for Ed25519Signature { self.verify_arbitrary_msg(message.as_ref(), public_key) } - /// Checks that `self` is valid for an arbitary &[u8] `message` using `public_key`. + /// Checks that `self` is valid for an arbitrary &[u8] `message` using `public_key`. /// Outside of this crate, this particular function should only be used for native signature /// verification in move fn verify_arbitrary_msg(&self, message: &[u8], public_key: &Ed25519PublicKey) -> Result<()> { diff --git a/crypto/nextgen_crypto/src/vrf/unit_tests/vrf_test.rs b/crypto/nextgen_crypto/src/vrf/unit_tests/vrf_test.rs index 731701d0aa43..45b495463c38 100644 --- a/crypto/nextgen_crypto/src/vrf/unit_tests/vrf_test.rs +++ b/crypto/nextgen_crypto/src/vrf/unit_tests/vrf_test.rs @@ -51,7 +51,7 @@ const TESTVECTORS : [VRFTestVector; 3] = [ PK : "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a", alpha : b"", x : "307c83864f2833cb427a2ef1c00a013cfdff2768d980c0a3a520f006904de94f", - // try_and_increment succeded on ctr = 0 + // try_and_increment succeeded on ctr = 0 H : "5b2c80db3ce2d79cc85b1bfb269f02f915c5f0e222036dc82123f640205d0d24", k : "647ac2b3ca3f6a77e4c4f4f79c6c4c8ce1f421a9baaa294b0adf0244915130f7067640acb6fd9e7e84f8bc30d4e03a95e410b82f96a5ada97080e0f187758d38", U : "a21c342b8704853ad10928e3db3e58ede289c798e3cdfd485fbbb8c1b620604f", @@ -64,7 +64,7 @@ const TESTVECTORS : [VRFTestVector; 3] = [ PK : "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c", alpha : b"\x72", x : "68bd9ed75882d52815a97585caf4790a7f6c6b3b7f821c5e259a24b02e502e51", - // try_and_increment succeded on ctr = 4 + // try_and_increment succeeded on ctr = 4 H : "08e18a34f3923db32e80834fb8ced4e878037cd0459c63ddd66e5004258cf76c", k : "627237308294a8b344a09ad893997c630153ee514cd292eddd577a9068e2a6f24cbee0038beb0b1ee5df8be08215e9fc74608e6f9358b0e8d6383b1742a70628", U : "18b5e500cb34690ced061a0d6995e2722623c105221eb91b08d90bf0491cf979", @@ -77,7 +77,7 @@ const TESTVECTORS : [VRFTestVector; 3] = [ PK : "fc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025", alpha : b"\xaf\x82", x : "909a8b755ed902849023a55b15c23d11ba4d7f4ec5c2f51b1325a181991ea95c", - // try_and_increment succeded on ctr = 0 + // try_and_increment succeeded on ctr = 0 H : "e4581824b70badf0e57af789dd8cf85513d4b9814566de0e3f738439becfba33", k : "a950f736af2e3ae2dbcb76795f9cbd57c671eee64ab17069f945509cd6c4a74852fe1bbc331e1bd573038ec703ca28601d861ad1e9684ec89d57bc22986acb0e", U : "5114dc4e741b7c4a28844bc585350240a51348a05f337b5fd75046d2c2423f7a", diff --git a/crypto/secret_service/src/secret_service_server.rs b/crypto/secret_service/src/secret_service_server.rs index 1cc000e07a65..92678d14e4ec 100644 --- a/crypto/secret_service/src/secret_service_server.rs +++ b/crypto/secret_service/src/secret_service_server.rs @@ -158,7 +158,7 @@ impl secret_service_grpc::SecretService for SecretServiceServer { provide_grpc_response(Ok(response), ctx, sink); } - /// Returns a signature on a given hash-value with a correponding signing key answering a + /// Returns a signature on a given hash-value with a corresponding signing key answering a /// SignRequest with a SignResponse. fn sign( &mut self, diff --git a/execution/execution_service/tests/storage_integration_test.rs b/execution/execution_service/tests/storage_integration_test.rs index 44e715aa5521..c9f9c44dbedc 100644 --- a/execution/execution_service/tests/storage_integration_test.rs +++ b/execution/execution_service/tests/storage_integration_test.rs @@ -135,7 +135,7 @@ fn test_execution_with_storage() { let mut block2 = vec![]; let block2_id = gen_block_id(2); - // Create 14 txns transfering 1k from account1 to account3 each. + // Create 14 txns transferring 1k from account1 to account3 each. for i in 2..=15 { block2.push(get_test_signed_transaction( account1, @@ -554,7 +554,7 @@ fn verify_committed_txn_status( expected_txn: &SignedTransaction, ) -> Result<()> { let signed_txn = &signed_txn_with_proof - .ok_or_else(|| format_err!("Transaction is not commited."))? + .ok_or_else(|| format_err!("Transaction is not committed."))? .signed_transaction; ensure!( diff --git a/execution/executor/src/block_processor.rs b/execution/executor/src/block_processor.rs index 7e45ca251569..9d328cec1bf1 100644 --- a/execution/executor/src/block_processor.rs +++ b/execution/executor/src/block_processor.rs @@ -312,7 +312,7 @@ where .skip(num_txns_to_skip as usize) .unzip(); - // Construct a StateView and pass the transations to VM. + // Construct a StateView and pass the transactions to VM. let db_root_hash = self.committed_state_tree.root_hash(); let state_view = VerifiedStateView::new( Arc::clone(&self.storage_read_client), @@ -597,7 +597,7 @@ where .get_block_mut(id) .expect("Block to execute should exist."); - // Construct a StateView and pass the transations to VM. + // Construct a StateView and pass the transactions to VM. let db_root_hash = self.committed_state_tree.root_hash(); let state_view = VerifiedStateView::new( Arc::clone(&self.storage_read_client), diff --git a/execution/executor/src/block_tree/mod.rs b/execution/executor/src/block_tree/mod.rs index e5dac8a26633..a1bfcfa13e7a 100644 --- a/execution/executor/src/block_tree/mod.rs +++ b/execution/executor/src/block_tree/mod.rs @@ -290,7 +290,7 @@ where } } -/// An error retured by `add_block`. The error contains the block being added so the caller does +/// An error returned by `add_block`. The error contains the block being added so the caller does /// not lose it. #[derive(Debug, Eq, PartialEq)] pub enum AddBlockError { diff --git a/execution/executor/src/executor_test.rs b/execution/executor/src/executor_test.rs index eaeb01199811..65a2aac97e63 100644 --- a/execution/executor/src/executor_test.rs +++ b/execution/executor/src/executor_test.rs @@ -503,7 +503,7 @@ proptest! { block_on(executor.commit_block(ledger_info)).unwrap().unwrap(); } - // Now we construt a new executor and run one more block. + // Now we construct a new executor and run one more block. let root_hash = { let executor = create_executor(&config); let response_b = block_on(executor.execute_block( diff --git a/execution/executor/src/transaction_block.rs b/execution/executor/src/transaction_block.rs index 4da925030ee1..d4442ee9f07c 100644 --- a/execution/executor/src/transaction_block.rs +++ b/execution/executor/src/transaction_block.rs @@ -330,7 +330,7 @@ impl TransactionData { /// Generated by processing VM's output. #[derive(Debug)] pub struct ProcessedVMOutput { - /// The entire set of data assoicated with each transaction. + /// The entire set of data associated with each transaction. transaction_data: Vec, /// The in-memory Merkle Accumulator after appending new `TransactionInfo` objects. diff --git a/language/README.md b/language/README.md index 5b87f570bac5..a768d858e32d 100644 --- a/language/README.md +++ b/language/README.md @@ -28,10 +28,10 @@ Libra Core components interact with the language component through the VM. Speci ### Exploring Move IR -* You can find many small Move IR examples in the [tests](https://github.com/libra/libra/tree/master/language/functional_tests/tests/testsuite). The easiest way to experiment with Move IR is to create a new test in this directory and follow the instructions for runnning the tests. +* You can find many small Move IR examples in the [tests](https://github.com/libra/libra/tree/master/language/functional_tests/tests/testsuite). The easiest way to experiment with Move IR is to create a new test in this directory and follow the instructions for running the tests. * Some more substantial examples can be found in the [standard library](https://github.com/libra/libra/tree/master/language/stdlib/modules). The two most notable ones are [LibraAccount.mvir](https://github.com/libra/libra/blob/master/language/stdlib/modules/libra_account.mvir), which implements accounts on the Libra blockchain, and [LibraCoin.mvir](https://github.com/libra/libra/blob/master/language/stdlib/modules/libra_coin.mvir), which implements Libra coin. * The four transaction scripts supported in the Libra testnet are also in the standard library directiory. They are [peer-to-peer transfer](https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/peer_to_peer_transfer.mvir), [account creation](https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/create_account.mvir), [minting new Libra](https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/mint.mvir) (will only work for an account with proper privileges), and [key rotation](https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/rotate_authentication_key.mvir). -* The most complete documention of the Move IR syntax is the [grammar](https://github.com/libra/libra/blob/master/language/compiler/src/parser/mod.rs). You can also take a look at the [parser for the Move IR](https://github.com/libra/libra/blob/master/language/compiler/src/parser/syntax.lalrpop). +* The most complete documentation of the Move IR syntax is the [grammar](https://github.com/libra/libra/blob/master/language/compiler/src/parser/mod.rs). You can also take a look at the [parser for the Move IR](https://github.com/libra/libra/blob/master/language/compiler/src/parser/syntax.lalrpop). * Check out the [IR compiler README](https://github.com/libra/libra/blob/master/language/compiler/README.md) for more details on writing Move IR code. ### Directory Organization diff --git a/language/bytecode_verifier/src/stack_usage_verifier.rs b/language/bytecode_verifier/src/stack_usage_verifier.rs index 232a8203f915..8ec4d60980dc 100644 --- a/language/bytecode_verifier/src/stack_usage_verifier.rs +++ b/language/bytecode_verifier/src/stack_usage_verifier.rs @@ -4,7 +4,7 @@ //! This module implements a checker for verifying that basic blocks in the bytecode instruction //! sequence of a function use the evaluation stack in a balanced manner. Every basic block, //! except those that end in Ret (return to caller) opcode, must leave the stack height the -//! same as at the begining of the block. A basic block that ends in Ret opcode must increase +//! same as at the beginning of the block. A basic block that ends in Ret opcode must increase //! the stack height by the number of values returned by the function as indicated in its //! signature. Additionally, the stack height must not dip below that at the beginning of the //! block for any basic block. diff --git a/language/compiler/src/compiler.rs b/language/compiler/src/compiler.rs index 6a488963d798..af81bc2d236b 100644 --- a/language/compiler/src/compiler.rs +++ b/language/compiler/src/compiler.rs @@ -928,7 +928,7 @@ impl<'a> Scope for ScriptScope<'a> { struct Compiler { // identity maps - // Map a handle to its positon in its table + // Map a handle to its position in its table // TODO: those could be expressed as references and it would make for better code. // For now this is easier to do and those are intended to be "primitive" values so we'll get // back to this... @@ -1476,7 +1476,7 @@ impl Compiler { } // - // Signatue building methods + // Signature building methods // fn build_type_signature(&mut self, type_: &Type) -> Result { diff --git a/language/functional_tests/_old_move_ir_tests/src/tests/epilogue.rs b/language/functional_tests/_old_move_ir_tests/src/tests/epilogue.rs index 74bca4ff5025..c331f7ab5604 100644 --- a/language/functional_tests/_old_move_ir_tests/src/tests/epilogue.rs +++ b/language/functional_tests/_old_move_ir_tests/src/tests/epilogue.rs @@ -553,7 +553,7 @@ main() {{ // TODO don't increment sequence number after: // bad signature // bad auth key -// cant pay gas deposit +// can't pay gas deposit // TODO: do increment sequence number after: // parse error diff --git a/language/functional_tests/tests/testsuite/move_getting_started_examples/create_account_script.mvir b/language/functional_tests/tests/testsuite/move_getting_started_examples/create_account_script.mvir index 6cff361979cd..16de6aa7ff94 100644 --- a/language/functional_tests/tests/testsuite/move_getting_started_examples/create_account_script.mvir +++ b/language/functional_tests/tests/testsuite/move_getting_started_examples/create_account_script.mvir @@ -17,7 +17,7 @@ main(payee: address, amount: u64) { if (!move(account_exists)) { // Creates a fresh account at the address `payee` by publishing a - // LibraAccount.T resource under this address. If theres is already a + // LibraAccount.T resource under this address. If there is already a // LibraAccount.T resource under the address, this will fail. create_account(copy(payee)); } diff --git a/language/vm/cost_synthesis/src/module_generator.rs b/language/vm/cost_synthesis/src/module_generator.rs index ac71f9389378..69efd8e87e12 100644 --- a/language/vm/cost_synthesis/src/module_generator.rs +++ b/language/vm/cost_synthesis/src/module_generator.rs @@ -355,7 +355,7 @@ impl ModuleBuilder { /// /// The `ModuleBuilder` is already designed to build module universes but the size of this universe /// is unspecified and un-iterable. This is a simple wrapper around the builder that allows -/// the implemenation of the `Iterator` trait over it. +/// the implementation of the `Iterator` trait over it. pub struct ModuleGenerator { module_builder: ModuleBuilder, iters: u64, diff --git a/language/vm/vm_runtime/src/txn_executor.rs b/language/vm/vm_runtime/src/txn_executor.rs index 1a77c9b9a2d8..731d0790721b 100644 --- a/language/vm/vm_runtime/src/txn_executor.rs +++ b/language/vm/vm_runtime/src/txn_executor.rs @@ -776,7 +776,7 @@ where to_be_published_modules: Vec<(CodeKey, Vec)>, result: VMResult<()>, ) -> VMRuntimeResult { - // This should only be used for bookeeping. The gas is already deducted from the sender's + // This should only be used for bookkeeping. The gas is already deducted from the sender's // account in the account module's epilogue. let gas: u64 = (self.txn_data.max_gas_amount - self.gas_meter.remaining_gas()) * self.txn_data.gas_unit_price; diff --git a/libra_swarm/src/swarm.rs b/libra_swarm/src/swarm.rs index b28934845a8a..ac2e7da5d727 100644 --- a/libra_swarm/src/swarm.rs +++ b/libra_swarm/src/swarm.rs @@ -315,7 +315,7 @@ impl LibraSwarm { } } - // Check if all the nodes have been successfully lauched + // Check if all the nodes have been successfully launched if done.iter().all(|status| *status) { return true; } diff --git a/mempool/src/core_mempool/unit_tests/core_mempool_test.rs b/mempool/src/core_mempool/unit_tests/core_mempool_test.rs index 064cbce440f9..9a48b1c047f7 100644 --- a/mempool/src/core_mempool/unit_tests/core_mempool_test.rs +++ b/mempool/src/core_mempool/unit_tests/core_mempool_test.rs @@ -303,7 +303,7 @@ fn test_gc_ready_transaction() { add_txn(&mut pool, TestTransaction::new(1, 2, 1)).unwrap(); add_txn(&mut pool, TestTransaction::new(1, 3, 1)).unwrap(); - // chack that all txns are ready + // check that all txns are ready let (timeline, _) = pool.read_timeline(0, 10); assert_eq!(timeline.len(), 4); diff --git a/mempool/src/unit_tests/service_test.rs b/mempool/src/unit_tests/service_test.rs index 451a5be0e13d..883bb3a344e5 100644 --- a/mempool/src/unit_tests/service_test.rs +++ b/mempool/src/unit_tests/service_test.rs @@ -109,7 +109,7 @@ fn test_consensus_callbacks() { let mut response = client.get_block(&GetBlockRequest::new()).unwrap(); assert_eq!(response.get_block().get_transactions().len(), 1); - // remove: transaction is commited + // remove: transaction is committed let mut transaction = CommittedTransaction::new(); let signed_txn = SignedTransaction::from_proto(add_req.get_signed_txn().clone()).unwrap(); let sender = signed_txn.sender().as_ref().to_vec(); diff --git a/network/netcore/src/negotiate/inbound.rs b/network/netcore/src/negotiate/inbound.rs index 92b0cd56290a..d889df7e9522 100644 --- a/network/netcore/src/negotiate/inbound.rs +++ b/network/netcore/src/negotiate/inbound.rs @@ -66,7 +66,7 @@ where write_u16frame(&mut stream, PROTOCOL_INTERACTIVE).await?; stream.flush().await?; - // We make upto 10 attempts to negotiate a protocol. + // We make up to 10 attempts to negotiate a protocol. for _ in 0..10 { // Read in the Protocol they want to speak and attempt to match // it against our supported protocols diff --git a/network/netcore/src/negotiate/outbound.rs b/network/netcore/src/negotiate/outbound.rs index bb84cd826020..7d1a608ef8d0 100644 --- a/network/netcore/src/negotiate/outbound.rs +++ b/network/netcore/src/negotiate/outbound.rs @@ -247,7 +247,7 @@ mod test { read_u16frame(&mut b, &mut buf).await?; assert_eq!(buf.as_ref(), protocol_unsupported); - // Just drop b to signle that the upgrade failed + // Just drop b to signal that the upgrade failed drop(b); // Force return type of the async block diff --git a/network/src/connectivity_manager/mod.rs b/network/src/connectivity_manager/mod.rs index ecde2bae118e..ba5827bd55a7 100644 --- a/network/src/connectivity_manager/mod.rs +++ b/network/src/connectivity_manager/mod.rs @@ -127,9 +127,9 @@ where for p in stale_connections.into_iter() { info!("Should no longer be connected to peer: {}", p.short_str()); match self.peer_mgr_reqs_tx.disconnect_peer(p).await { - // If we disconnect succesfully, or if the connection has already broken, we eagerly - // remove the peer from list of connected peers, without waiting for the LostPeer - // notification from PeerManager. + // If we disconnect successfully, or if the connection has already broken, we + // eagerly remove the peer from list of connected peers, without + // waiting for the LostPeer notification from PeerManager. Ok(_) | Err(PeerManagerError::NotConnected(_)) => { self.connected.remove(&p); } diff --git a/network/src/peer_manager/tests.rs b/network/src/peer_manager/tests.rs index 2406284224e1..9bb709f5c41b 100644 --- a/network/src/peer_manager/tests.rs +++ b/network/src/peer_manager/tests.rs @@ -38,7 +38,7 @@ use types::PeerId; const HELLO_PROTOCOL: &[u8] = b"/hello-world/1.0.0"; // Builds a concrete typed transport (instead of using impl Trait) for testing PeerManager. -// Specificly this transport is compatible with the `build_test_connection` test helper making +// Specifically this transport is compatible with the `build_test_connection` test helper making // it easy to build connections without going through the whole transport pipeline. fn build_test_transport( own_peer_id: PeerId, @@ -204,14 +204,14 @@ fn peer_open_substream_simultaneous() { let _ = timeout_a.await.unwrap().unwrap(); let _ = timeout_b.await.unwrap().unwrap(); - // Check that we recieved the new inbound substream for both peers + // Check that we received the new inbound substream for both peers assert_new_substream_event(peer_handle_a.peer_id, &mut internal_event_rx_a).await; assert_new_substream_event(peer_handle_b.peer_id, &mut internal_event_rx_b).await; // Shut one peers and the other should shutdown due to ConnectionLost peer_handle_a.disconnect().await; - // Check that we recieved both shutdown events + // Check that we received both shutdown events assert_peer_disconnected_event( peer_handle_a.peer_id, DisconnectReason::Requested, @@ -711,7 +711,7 @@ fn peer_manager_simultaneous_dial_disconnect_event() { .await; // Create a PeerDisconnect event with the opposite origin of the one stored in - // PeerManager to ensure that handling the event wont cause the PeerHandle to be + // PeerManager to ensure that handling the event won't cause the PeerHandle to be // removed from PeerManager let event = InternalEvent::PeerDisconnected( ids[0], diff --git a/network/src/proto/network.proto b/network/src/proto/network.proto index f4f09932f0fc..f192e4d4fdd7 100644 --- a/network/src/proto/network.proto +++ b/network/src/proto/network.proto @@ -41,5 +41,5 @@ message IdentityMsg { // Ping message sent as liveness probe. message Ping {} -// Pong message sent as reponse to liveness probe. +// Pong message sent as response to liveness probe. message Pong {} diff --git a/network/src/protocols/direct_send/mod.rs b/network/src/protocols/direct_send/mod.rs index e3b2cc1e3f26..1be6dff97299 100644 --- a/network/src/protocols/direct_send/mod.rs +++ b/network/src/protocols/direct_send/mod.rs @@ -9,7 +9,7 @@ //! 1. Every message runs in its own ephemeral substream. The substream is directional in the way //! that only the dialer sends a message to the listener, but no messages or acknowledgements //! sending back on the other direction. So the message delivery is best effort and not -//! guranteed. Because the substreams are independent, there is no gurantee on the ordering +//! guaranteed. Because the substreams are independent, there is no guarantee on the ordering //! of the message delivery either. //! 2. An DirectSend call negotiates which protocol to speak using [`protocol-select`]. This //! allows simple versioning of message delivery and negotiation of which message types are diff --git a/network/src/protocols/discovery/mod.rs b/network/src/protocols/discovery/mod.rs index deabb75bf90c..71576a4ad0dc 100644 --- a/network/src/protocols/discovery/mod.rs +++ b/network/src/protocols/discovery/mod.rs @@ -10,7 +10,7 @@ //! the network to a randomly chosen peer. Other peers are also expected to be running the same //! protocol. Therefore, in expectation, every peer expects to hear from 1 other peer in each //! round. On hearing from the remote peer, the local discovery module tries to reconcile its state -//! to reflect any changes. In addition to updating its state, it also passes on new infromation to +//! to reflect any changes. In addition to updating its state, it also passes on new information to //! the [`ConnectivityManager`] module. //! //! For the initial bootstrap of a node, it sends the discovery message to a randomly chosen seed @@ -259,7 +259,7 @@ where } _ => { debug!( - "Received redundant lost peer notfication for {}", + "Received redundant lost peer notification for {}", peer_id.short_str() ); } diff --git a/network/src/protocols/health_checker/mod.rs b/network/src/protocols/health_checker/mod.rs index d15c6b8960d9..18bd67601a71 100644 --- a/network/src/protocols/health_checker/mod.rs +++ b/network/src/protocols/health_checker/mod.rs @@ -76,7 +76,7 @@ where TTicker: Stream + FusedStream + Unpin, TSubstream: AsyncRead + AsyncWrite + Send + Unpin + Debug + 'static, { - /// Create new intance of the [`HealthChecker`] actor. + /// Create new instance of the [`HealthChecker`] actor. pub fn new( ticker: TTicker, peer_mgr_reqs_tx: PeerManagerRequestSender, diff --git a/network/src/protocols/rpc/mod.rs b/network/src/protocols/rpc/mod.rs index 0d64753e1514..bfda3085ff3f 100644 --- a/network/src/protocols/rpc/mod.rs +++ b/network/src/protocols/rpc/mod.rs @@ -91,7 +91,7 @@ mod test; #[derive(Debug)] pub struct InboundRpcRequest { /// Rpc method identifier, e.g., `/libra/consensus/rpc/0.1.0`. This is used - /// to dispath the request to the corresponding client handler. + /// to dispatch the request to the corresponding client handler. pub protocol: ProtocolId, /// The serialized request data received from the sender. pub data: Bytes, diff --git a/scripts/cargo_check_dependencies.sh b/scripts/cargo_check_dependencies.sh index 5fe6394791fd..c0cf0deaa2b2 100755 --- a/scripts/cargo_check_dependencies.sh +++ b/scripts/cargo_check_dependencies.sh @@ -7,7 +7,7 @@ # and sees if this Cargo.toml file can operate without some of its # dependencies using repeated `cargo check --all-targets` attempts. # -# In order to run this in a directoy containing multiple Cargo.toml files, +# In order to run this in a directory containing multiple Cargo.toml files, # we could suggest: # find ./ -name Cargo.toml -execdir /path/to/$(basename $0) \; diff --git a/storage/libradb/src/lib.rs b/storage/libradb/src/lib.rs index 9e87f251c2e0..c73ffc9e1d7f 100644 --- a/storage/libradb/src/lib.rs +++ b/storage/libradb/src/lib.rs @@ -135,7 +135,7 @@ impl LibraDB { let latest_version = self.get_latest_version()?; ensure!( ledger_version <= latest_version, - "The ledger version {} is greather than the latest version currently in ledger: {}", + "The ledger version {} is greater than the latest version currently in ledger: {}", ledger_version, latest_version ); diff --git a/storage/sparse_merkle/src/lib.rs b/storage/sparse_merkle/src/lib.rs index 72dfb09c5626..52987a7f79ed 100644 --- a/storage/sparse_merkle/src/lib.rs +++ b/storage/sparse_merkle/src/lib.rs @@ -125,7 +125,7 @@ where /// storage and apply the `keyed_blob_set` of transaction `T_{i+1}`. Then if the storage commits /// the returned batch, the state `S_{i+1}` is ready to be read from the tree by calling /// [`get_with_proof`](SparseMerkleTree::get_with_proof). Anything inside the batch is not - /// reachable from public interfaces before being commited. + /// reachable from public interfaces before being committed. pub fn put_keyed_blob_set( &self, keyed_blob_set: Vec<(HashValue, AccountStateBlob)>, diff --git a/storage/sparse_merkle/src/node_type/mod.rs b/storage/sparse_merkle/src/node_type/mod.rs index 8acf9b635fa6..ad699cf4e261 100644 --- a/storage/sparse_merkle/src/node_type/mod.rs +++ b/storage/sparse_merkle/src/node_type/mod.rs @@ -52,7 +52,7 @@ pub struct ExtensionNode { child: HashValue, } -/// Represents an account. It has two fields: `key` is the hash of the acccont adress and +/// Represents an account. It has two fields: `key` is the hash of the acccont address and /// `value_hash` is the hash of account state blob. #[derive(Clone, Debug, Eq, PartialEq)] pub struct LeafNode { @@ -305,7 +305,7 @@ impl BranchNode { .unwrap_or_else(|| { panic!( "Corrupted branch node: child_bitmap indicates \ - the existense of a non-exist child at index {}", + the existence of a non-exist child at index {}", only_child_index ) }) @@ -379,7 +379,7 @@ impl BranchNode { .unwrap_or_else(|| { panic!( "Corrupted branch node: child_bitmap indicates \ - the existense of a non-exist child at index {}", + the existence of a non-exist child at index {}", only_child_index ) }) diff --git a/storage/storage_proto/src/proto/storage.proto b/storage/storage_proto/src/proto/storage.proto index 8e4453df5fcd..78ff4c55a9f8 100644 --- a/storage/storage_proto/src/proto/storage.proto +++ b/storage/storage_proto/src/proto/storage.proto @@ -68,7 +68,7 @@ message GetTransactionsRequest { // The size of the transaction batch. uint64 batch_size = 2; // All the proofs returned in the response should be relative to this - // given verison. + // given version. uint64 ledger_version = 3; // Used to return the events associated with each transaction bool fetch_events = 4; diff --git a/types/src/access_path.rs b/types/src/access_path.rs index 9c569a0fc727..1bc473997b8e 100644 --- a/types/src/access_path.rs +++ b/types/src/access_path.rs @@ -126,7 +126,7 @@ impl fmt::Display for Access { #[derive(Eq, Hash, Serialize, Deserialize, Debug, Clone, PartialEq, Ord, PartialOrd)] pub struct Accesses(Vec); -/// SEPARATOR is used as a delimeter between fields. It should not be a legal part of any identifier +/// SEPARATOR is used as a delimiter between fields. It should not be a legal part of any identifier /// in the language const SEPARATOR: char = '/'; diff --git a/types/src/proof/mod.rs b/types/src/proof/mod.rs index d754216ce661..6fc33640ead0 100644 --- a/types/src/proof/mod.rs +++ b/types/src/proof/mod.rs @@ -152,7 +152,7 @@ pub(crate) fn verify_transaction_list( ); } - // 1. Emtpy list; + // 1. Empty list; if num_txns == 0 { ensure!( first_proof.is_none(),