Skip to content

Commit

Permalink
Fix all last spelling errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienFT committed Apr 18, 2022
1 parent cee055f commit 8b1bcdc
Show file tree
Hide file tree
Showing 81 changed files with 448 additions and 418 deletions.
24 changes: 22 additions & 2 deletions .config/lingo.dic
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
65
85
hashmap
todo/M
json/M
Expand All @@ -18,6 +18,7 @@ ips/MS
IPs
unban/M
{0}
{0
serializer
checksum
SHA256
Expand Down Expand Up @@ -59,4 +60,23 @@ desynchronization
utils
hashset
endian
varint
varint
CANCELLABLE
staker
oneshot
TCP
merkle
tuple
TLS
ABI
ABIs
routable
MPSCs
mutex
transactionally
destructure
bootstrapable
dereferenced
sortable
rentability
genericity
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
with:
command: spellcheck

check:
if: github.ref != 'refs/heads/staging'
Expand Down
2 changes: 1 addition & 1 deletion massa-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub struct Public {
pub node_id: NodeId,
}

/// Private api content
/// Private API content
pub struct Private {
/// link to the consensus component
pub consensus_command_sender: ConsensusCommandSender,
Expand Down
2 changes: 1 addition & 1 deletion massa-async-pool/src/bootstrap.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Copyright (c) 2022 MASSA LABS <[email protected]>
//! Provides serializable structures for bootstrapping the AsyncPool
//! Provides serializable structures for bootstrapping the `AsyncPool`
use crate::message::AsyncMessage;
use massa_models::{
Expand Down
2 changes: 1 addition & 1 deletion massa-async-pool/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Copyright (c) 2022 MASSA LABS <[email protected]>
//! This file defines a configuration structure containing all settings for the async message pool system
//! This file defines a configuration structure containing all settings for the asynchronous message pool system
/// Asynchronous pool configuration
#[derive(Debug, Clone)]
Expand Down
10 changes: 5 additions & 5 deletions massa-async-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//! # General description
//!
//! This crate implements a consensual/deterministic pool of asynchronous messages (AsyncPool) within the context of autonomous smart contracts.
//! This crate implements a consensual/deterministic pool of asynchronous messages (`AsyncPool`) within the context of autonomous smart contracts.
//!
//! AsyncPool is used in conjunction with FinalLedger within the FinalState, but also as a speculative copy for speculative execution.
//! `AsyncPool` is used in conjunction with `FinalLedger` within the `FinalState`, but also as a speculative copy for speculative execution.
//!
//! ## Goal
//!
Expand Down Expand Up @@ -32,15 +32,15 @@
//!
//! ## How to send a message during bytecode execution
//!
//! * messages are sent using an ABI: `send_message(target_addrress, target_handler, validity_start, validity_end, max_gas, gas_price, coins, data: JSON string) -> Result<(), ABIReturnError>`. Note that data has a config defined max_async_message_data_size.
//! * messages are sent using an ABI: `send_message(target_address, target_handler, validity_start, validity_end, max_gas, gas_price, coins, data: JSON string) -> Result<(), ABIReturnError>`. Note that data has a configuration defined `max_async_message_data_size`.
//! * when called, this ABI does this:
//! * it consumes `compute_gas_cost_of_message_storage(context.current_slot, validity_end_slot)` of gas in the current execution. This allows making the message emission more gas-consuming when it requires storing the message in queue for longer
//! * it consumes `max_gas * gas_price + coins` coins from the sender
//! * it generates an AsyncMessage and stores it in an Async pool
//! * it generates an `AsyncMessage` and stores it in an asynchronous pool
//!
//! Note that `max_gas*gas_price` coins are burned when sending the message.
//!
//! ## How is the AsyncPool handled
//! ## How is the `AsyncPool` handled
//! ```
//! * In the AsyncPool, Messages are kept sorted by `priority = AsyncMessageId(msg.max_gas * msg.gas_price, rev(msg.slot), rev(msg.emission_index))`
//!
Expand Down
6 changes: 3 additions & 3 deletions massa-async-pool/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ impl AsyncPool {
}

/// Applies pre-compiled `AsyncPoolChanges` to the pool without checking for overflows.
/// This function is used when applying pre-compiled `AsyncPoolChanges` to an AsyncPool.
/// This function is used when applying pre-compiled `AsyncPoolChanges` to an `AsyncPool`.
///
/// # arguments
/// * changes: `AsyncPoolChanges` listing all asynchronous pool changes (message insertions/deletions)
/// * `changes`: `AsyncPoolChanges` listing all asynchronous pool changes (message insertions/deletions)
pub fn apply_changes_unchecked(&mut self, changes: AsyncPoolChanges) {
for change in changes.0.into_iter() {
match change {
Expand Down Expand Up @@ -86,7 +86,7 @@ impl AsyncPool {
/// # returns
/// The list of `(message_id, message)` that were eliminated from the pool after the changes were applied, sorted in the following order:
/// * expired messages from the pool, in priority order (from highest to lowest priority)
/// * expired messages from new_messages (in the order they appear in `new_messages`)
/// * expired messages from `new_messages` (in the order they appear in `new_messages`)
/// * excess messages after inserting all remaining `new_messages`, in priority order (from highest to lowest priority)
pub fn settle_slot(
&mut self,
Expand Down
2 changes: 1 addition & 1 deletion massa-bootstrap/src/client_binder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct BootstrapClientBinder {
}

impl BootstrapClientBinder {
/// Creates a new WriteBinder.
/// Creates a new `WriteBinder`.
///
/// # Argument
/// * duplex: duplex stream.
Expand Down
2 changes: 1 addition & 1 deletion massa-bootstrap/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub enum BootstrapError {
UnexpectedMessage(BootstrapMessage),
/// connection with bootstrap node dropped
UnexpectedConnectionDrop,
/// massa_hash error: {0}
/// `massa_hash` error: {0}
MassaHashError(#[from] MassaHashError),
/// time error: {0}
TimeError(#[from] TimeError),
Expand Down
6 changes: 3 additions & 3 deletions massa-bootstrap/src/establisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub mod types {
/// Tries to connect to address
///
/// # Argument
/// * addr: SocketAddr we are trying to connect to.
/// * `addr`: `SocketAddr` we are trying to connect to.
pub async fn connect(&mut self, addr: SocketAddr) -> io::Result<Duplex> {
match timeout(self.0.to_duration(), TcpStream::connect(addr)).await {
Ok(Ok(sock)) => Ok(sock),
Expand All @@ -72,15 +72,15 @@ pub mod types {
/// Gets the associated listener
///
/// # Argument
/// * addr: SocketAddr we want to bind to.
/// * `addr`: `SocketAddr` we want to bind to.
pub async fn get_listener(&mut self, addr: SocketAddr) -> io::Result<DefaultListener> {
Ok(DefaultListener(TcpListener::bind(addr).await?))
}

/// Get the connector with associated timeout
///
/// # Argument
/// * timeout_duration: timeout duration in milliseconds
/// * `timeout_duration`: timeout duration in milliseconds
pub async fn get_connector(
&mut self,
timeout_duration: MassaTime,
Expand Down
2 changes: 1 addition & 1 deletion massa-bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl BootstrapManager {
}

#[allow(clippy::too_many_arguments)]
/// TODO merging the command senders into one channel struct may allow removing that allow
/// TODO merging the command senders into one channel structure may allow removing that allow
///
/// start a bootstrap server.
/// Once your node will be ready, you may want other to bootstrap from you.
Expand Down
2 changes: 1 addition & 1 deletion massa-bootstrap/src/server_binder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct BootstrapServerBinder {
}

impl BootstrapServerBinder {
/// Creates a new WriteBinder.
/// Creates a new `WriteBinder`.
///
/// # Argument
/// * duplex: duplex stream.
Expand Down
2 changes: 1 addition & 1 deletion massa-bootstrap/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use serde::Deserialize;
use std::net::SocketAddr;

/// Bootstrap settings.
/// Both bootstrapping at startup and bootstrap server settings
/// Both bootstrapping at start-up and bootstrap server settings
#[derive(Debug, Deserialize, Clone)]
pub struct BootstrapSettings {
/// Ip address of our bootstrap nodes and their public key.
Expand Down
4 changes: 2 additions & 2 deletions massa-bootstrap/src/tests/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ where
}
}

/// asserts that two ExportProofOfStake are equal
/// asserts that two `ExportProofOfStake` are equal
pub fn assert_eq_thread_cycle_states(v1: &ExportProofOfStake, v2: &ExportProofOfStake) {
assert_eq!(
v1.cycle_states.len(),
Expand Down Expand Up @@ -242,7 +242,7 @@ pub fn assert_eq_thread_cycle_states(v1: &ExportProofOfStake, v2: &ExportProofOf
}
}

/// asserts that two BootstrapableGraph are equal
/// asserts that two `BootstrapableGraph` are equal
pub fn assert_eq_bootstrap_graph(v1: &BootstrapableGraph, v2: &BootstrapableGraph) {
assert_eq!(
v1.active_blocks.len(),
Expand Down
2 changes: 1 addition & 1 deletion massa-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct Args {
/// Command that client would execute (non-interactive mode)
#[structopt(name = "COMMAND", default_value = "help")]
command: Command,
/// Optional command parameter (as a JSON parsable string)
/// Optional command parameter (as a JSON string)
#[structopt(name = "PARAMETERS")]
parameters: Vec<String>,
/// Path of wallet file.
Expand Down
16 changes: 8 additions & 8 deletions massa-consensus-exports/src/consensus_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ use crate::{
pub struct ConsensusCommandSender(pub mpsc::Sender<ConsensusCommand>);

impl ConsensusCommandSender {
/// Gets all the available information on the block graph returning a Blockgraphexport.
/// Gets all the available information on the block graph returning a `BlockGraphExport`.
///
/// # Arguments
/// * slot_start: optional slot start for slot-based filtering (included).
/// * slot_end: optional slot end for slot-based filtering (excluded).
/// * `slot_start`: optional slot start for slot-based filtering (included).
/// * `slot_end`: optional slot end for slot-based filtering (excluded).
pub async fn get_block_graph_status(
&self,
slot_start: Option<Slot>,
Expand Down Expand Up @@ -109,11 +109,11 @@ impl ConsensusCommandSender {
})
}

/// Gets (slot, public_key) were the staker with public_key was selected for slot, between start_slot and end_slot.
/// Gets `(slot, public_key)` were the staker with `public_key` was selected for slot, between `start_slot` and `end_slot`.
///
/// # Arguments
/// * start_slot: beginning of the considered interval.
/// * end_slot: end of the considered interval.
/// * `start_slot`: beginning of the considered interval.
/// * `end_slot`: end of the considered interval.
pub async fn get_selection_draws(
&self,
start: Slot,
Expand Down Expand Up @@ -329,7 +329,7 @@ impl ConsensusCommandSender {

/// remove some keys from staking keys by associated address
/// the node won't be able to stake with these keys anymore
/// They wil be erased from the staking keys file
/// They will be erased from the staking keys file
pub async fn remove_staking_addresses(
&self,
addresses: Set<Address>,
Expand Down Expand Up @@ -454,7 +454,7 @@ impl ConsensusEventReceiver {
.ok_or(ConsensusError::ControllerEventError)
}

/// drains remaining events and returns them in a VecDeque
/// drains remaining events and returns them in a `VecDeque`
/// note: events are sorted from oldest to newest
pub async fn drain(mut self) -> VecDeque<ConsensusEvent> {
let mut remaining_events: VecDeque<ConsensusEvent> = VecDeque::new();
Expand Down
2 changes: 1 addition & 1 deletion massa-consensus-exports/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub enum ConsensusError {
ExecutionError(#[from] ExecutionError),
/// models error: {0}
ModelsError(#[from] ModelsError),
/// config error: {0}
/// configuration error: {0}
ConfigError(String),
/// Protocol error {0}
ProtocolError(#[from] Box<ProtocolError>),
Expand Down
2 changes: 1 addition & 1 deletion massa-consensus-exports/src/events.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Events that are emitted by consensus.
#[derive(Debug, Clone)]
pub enum ConsensusEvent {
/// probable desynchronization detected, need resync
/// probable desynchronization detected, need re-synchronization
NeedSync,
}
Loading

0 comments on commit 8b1bcdc

Please sign in to comment.