Skip to content

Commit

Permalink
Spell check comments and typos in comments
Browse files Browse the repository at this point in the history
Spell check comments and typos in comments
  • Loading branch information
aching authored and calibra-opensource committed Jun 18, 2019
1 parent f6815d2 commit b073451
Show file tree
Hide file tree
Showing 46 changed files with 61 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl AdmissionControlNode {
mp_client: Arc<M>,
storage_client: Option<Arc<StorageReadServiceClient>>,
) -> Result<()> {
// create storage client if doesnt exist
// create storage client if doesn't exist
let storage_client: Arc<dyn StorageRead> = match storage_client {
Some(c) => c,
None => Arc::new(StorageReadServiceClient::new(
Expand Down
2 changes: 1 addition & 1 deletion client/libra_wallet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
2 changes: 1 addition & 1 deletion client/libra_wallet/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = ::std::result::Result<T, WalletError>;

/// 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 {
Expand Down
2 changes: 1 addition & 1 deletion client/libra_wallet/src/io_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
2 changes: 1 addition & 1 deletion client/libra_wallet/src/key_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f64> {
ensure!(
space_delim_strings.len() == 2,
Expand Down
4 changes: 2 additions & 2 deletions client/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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('?')
}
Expand Down Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion common/channel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl<T> FusedStream for Receiver<T> {
}

/// `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<T> Stream for Receiver<T> {
type Item = T;

Expand Down
2 changes: 1 addition & 1 deletion common/grpcio-client/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;

Expand Down
2 changes: 1 addition & 1 deletion common/metrics/src/service_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/config_builder/src/swarm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
2 changes: 1 addition & 1 deletion crypto/legacy_crypto/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crypto/nextgen_crypto/src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<()> {
Expand Down
6 changes: 3 additions & 3 deletions crypto/nextgen_crypto/src/vrf/unit_tests/vrf_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion crypto/secret_service/src/secret_service_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions execution/execution_service/tests/storage_integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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!(
Expand Down
4 changes: 2 additions & 2 deletions execution/executor/src/block_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/block_tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<B: Block> {
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/executor_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/transaction_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<TransactionData>,

/// The in-memory Merkle Accumulator after appending new `TransactionInfo` objects.
Expand Down
4 changes: 2 additions & 2 deletions language/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion language/bytecode_verifier/src/stack_usage_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions language/compiler/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ impl<'a> Scope for ScriptScope<'a> {

struct Compiler<S: Scope + Sized> {
// 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...
Expand Down Expand Up @@ -1476,7 +1476,7 @@ impl<S: Scope + Sized> Compiler<S> {
}

//
// Signatue building methods
// Signature building methods
//

fn build_type_signature(&mut self, type_: &Type) -> Result<TypeSignature> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion language/vm/cost_synthesis/src/module_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion language/vm/vm_runtime/src/txn_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ where
to_be_published_modules: Vec<(CodeKey, Vec<u8>)>,
result: VMResult<()>,
) -> VMRuntimeResult<TransactionOutput> {
// 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;
Expand Down
2 changes: 1 addition & 1 deletion libra_swarm/src/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion mempool/src/core_mempool/unit_tests/core_mempool_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion mempool/src/unit_tests/service_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion network/netcore/src/negotiate/inbound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion network/netcore/src/negotiate/outbound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit b073451

Please sign in to comment.