Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

improve spelling #100

Merged
merged 2 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/commands/add_command/access_key/operation_mode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ impl OperationMode {
///Do you want to derive some information required for transaction construction automatically querying it online?
pub enum Mode {
#[strum_discriminants(strum(message = "Yes, I keep it simple"))]
/// Prepare and, optionally, submit a new transaction with online mode
/// Prepare and, optionally, submit a new transaction in online mode
Network(self::online_mode::NetworkArgs),
#[strum_discriminants(strum(
message = "No, I want to work in no-network (air-gapped) environment"
))]
/// Prepare and, optionally, submit a new transaction with offline mode
/// Prepare and, optionally, submit a new transaction in offline mode
Offline(self::offline_mode::OfflineArgs),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl CallFunctionAction {
println!();
let gas: u64 = loop {
let input_gas: crate::common::NearGas = Input::new()
.with_prompt("Enter a gas for function")
.with_prompt("Enter gas for function call")
.with_initial_text("100 TeraGas")
.interact_text()?;
let gas: u64 = match input_gas {
Expand Down Expand Up @@ -58,7 +58,7 @@ impl CallFunctionAction {
println!();
let deposit: crate::common::NearBalance = Input::new()
.with_prompt(
"Enter a deposit for function (example: 10NEAR or 0.5near or 10000yoctonear).",
"Enter deposit for a function call (example: 10NEAR or 0.5near or 10000yoctonear).",
)
.with_initial_text("0 NEAR")
.interact_text()?;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/add_command/contract_code/contract/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl ContractFile {
) -> color_eyre::eyre::Result<crate::types::path_buf::PathBuf> {
println!();
let input_file_path: String = Input::new()
.with_prompt("What is a file location of the contract?")
.with_prompt("What is the file location of the contract?")
.interact_text()?;
Ok(std::path::PathBuf::from(input_file_path).into())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl ContractFile {
) -> color_eyre::eyre::Result<std::path::PathBuf> {
println!();
let input_file_path: String = Input::new()
.with_prompt("What is a file location of the contract?")
.with_prompt("What is the file location of the contract?")
.interact_text()?;
Ok(std::path::PathBuf::from(input_file_path).into())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl CallFunctionAction {
println!();
let gas: u64 = loop {
let input_gas: crate::common::NearGas = Input::new()
.with_prompt("Enter a gas for function")
.with_prompt("Enter gas for function call")
.with_initial_text("100 TeraGas")
.interact_text()?;
let gas: u64 = match input_gas {
Expand Down Expand Up @@ -170,7 +170,7 @@ impl CallFunctionAction {
println!();
let deposit: crate::common::NearBalance = Input::new()
.with_prompt(
"Enter a deposit for function (example: 10NEAR or 0.5near or 10000yoctonear).",
"Enter deposit for a function call (example: 10NEAR or 0.5near or 10000yoctonear).",
)
.with_initial_text("0 NEAR")
.interact_text()?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl CallFunctionAction {
println!();
let gas: u64 = loop {
let input_gas: crate::common::NearGas = Input::new()
.with_prompt("Enter a gas for function")
.with_prompt("Enter gas for function call")
.with_initial_text("100 TeraGas")
.interact_text()?;
let gas: u64 = match input_gas {
Expand Down Expand Up @@ -60,7 +60,7 @@ impl CallFunctionAction {
println!();
let deposit: crate::common::NearBalance = Input::new()
.with_prompt(
"Enter a deposit for function (example: 10NEAR or 0.5near or 10000yoctonear).",
"Enter deposit for a function call (example: 10NEAR or 0.5near or 10000yoctonear).",
)
.with_initial_text("0 NEAR")
.interact_text()?;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/execute_command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ impl OptionMethod {
///Choose your method
pub enum Method {
#[strum_discriminants(strum(
message = "Execute a changing method (construct a transaction with a function call)"
message = "Execute a change method (construct a transaction with a function call)"
))]
/// Specify a change method
ChangeMethod(self::change_method::operation_mode::OperationMode),
#[strum_discriminants(strum(
message = "Execute a viewing method (read-only call, which does not require a transaction)"
message = "Execute a view method (read-only call, which does not require signing)"
))]
/// Specify a view method
ViewMethod(self::view_method::operation_mode::OperationMode),
Expand Down
2 changes: 1 addition & 1 deletion src/commands/execute_command/view_method/block_id/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub enum BlockId {
#[strum_discriminants(strum(message = "View this contract at final block"))]
/// Specify a block ID final to view this contract
AtFinalBlock,
#[strum_discriminants(strum(message = "View this contract at block heigt"))]
#[strum_discriminants(strum(message = "View this contract at block height"))]
/// Specify a block ID height to view this contract
AtBlockHeight(self::block_id_height::BlockIdHeight),
#[strum_discriminants(strum(message = "View this contract at block hash"))]
Expand Down
4 changes: 2 additions & 2 deletions src/commands/utils_command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ impl From<Util> for CliUtil {
Util::SignTransactionWithLedger(sign_transaction_with_ledger) => {
Self::SignTransactionWithLedger(sign_transaction_with_ledger.into())
}
Util::CombineTransactionSignature(combine_transaction_signaturte) => {
Self::CombineTransactionSignature(combine_transaction_signaturte.into())
Util::CombineTransactionSignature(combine_transaction_signature) => {
Self::CombineTransactionSignature(combine_transaction_signature.into())
}
Util::ViewSerializedTransaction(view_serialized_transaction) => {
Self::ViewSerializedTransaction(view_serialized_transaction.into())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ impl CliSignTransactionPrivateKey {
}

impl From<SignTransactionPrivateKey> for CliSignTransactionPrivateKey {
fn from(sign_transacrion_private_key: SignTransactionPrivateKey) -> Self {
fn from(sign_transaction_private_key: SignTransactionPrivateKey) -> Self {
Self {
signer_private_key: Some(sign_transacrion_private_key.signer_private_key),
signer_private_key: Some(sign_transaction_private_key.signer_private_key),
unsigned_transaction: Some(crate::common::TransactionAsBase64 {
inner: sign_transacrion_private_key.unsigned_transaction,
inner: sign_transaction_private_key.unsigned_transaction,
}),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/view_command/view_account/block_id/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub enum BlockId {
#[strum_discriminants(strum(message = "View this account at final block"))]
/// Specify a block ID final to view this account
AtFinalBlock,
#[strum_discriminants(strum(message = "View this account at block heigt"))]
#[strum_discriminants(strum(message = "View this account at block height"))]
/// Specify a block ID height to view this account
AtBlockHeight(self::block_id_height::BlockIdHeight),
#[strum_discriminants(strum(message = "View this account at block hash"))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub enum BlockId {
#[strum_discriminants(strum(message = "View this contract at final block"))]
/// Specify a block ID final to view this contract
AtFinalBlock,
#[strum_discriminants(strum(message = "View this contract at block heigt"))]
#[strum_discriminants(strum(message = "View this contract at block height"))]
/// Specify a block ID height to view this contract
AtBlockHeight(self::block_id_height::BlockIdHeight),
#[strum_discriminants(strum(message = "View this contract at block hash"))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub enum BlockId {
#[strum_discriminants(strum(message = "View this contract at final block"))]
/// Specify a block ID final to view this contract
AtFinalBlock,
#[strum_discriminants(strum(message = "View this contract at block heigt"))]
#[strum_discriminants(strum(message = "View this contract at block height"))]
/// Specify a block ID height to view this contract
AtBlockHeight(self::block_id_height::BlockIdHeight),
#[strum_discriminants(strum(message = "View this contract at block hash"))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl Sender {
err
))
})?;
println!("Transactiion status: {:#?}", query_view_transaction_status);
println!("Transaction status: {:#?}", query_view_transaction_status);
Ok(())
}
}
22 changes: 11 additions & 11 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,13 +801,13 @@ fn print_value_successful_transaction(
}
near_primitives::views::ActionView::DeleteKey { public_key } => {
println!(
"Access key <{}> for account <{}> has been successfully deletted.",
"Access key <{}> for account <{}> has been successfully deleted.",
public_key, transaction_info.transaction.signer_id,
);
}
near_primitives::views::ActionView::DeleteAccount { beneficiary_id: _ } => {
println!(
"Account <{}> has been successfully deletted.",
"Account <{}> has been successfully deleted.",
transaction_info.transaction.signer_id,
);
}
Expand Down Expand Up @@ -874,7 +874,7 @@ pub fn rpc_transaction_error(
pub fn print_action_error(action_error: near_primitives::errors::ActionError) {
match action_error.kind {
near_primitives::errors::ActionErrorKind::AccountAlreadyExists { account_id } => {
println!("Error: Create Account action tries to create an account with account ID <{}> which is already exists in the storage.", account_id)
println!("Error: Create Account action tries to create an account with account ID <{}> which already exists in the storage.", account_id)
}
near_primitives::errors::ActionErrorKind::AccountDoesNotExist { account_id } => {
println!(
Expand Down Expand Up @@ -926,7 +926,7 @@ pub fn print_action_error(action_error: near_primitives::errors::ActionError) {
)
}
near_primitives::errors::ActionErrorKind::LackBalanceForState { account_id, amount } => {
println!("Error: Receipt action can't be completed, because the remaining balance will not be enough to cover storage.\nAn account which needs balance: <{}>\nBalance required to complete an action: <{}>",
println!("Error: Receipt action can't be completed, because the remaining balance will not be enough to cover storage.\nAn account which needs balance: <{}>\nBalance required to complete the action: <{}>",
account_id,
crate::common::NearBalance::from_yoctonear(amount)
)
Expand Down Expand Up @@ -972,7 +972,7 @@ pub fn print_action_error(action_error: near_primitives::errors::ActionError) {
near_primitives::errors::ActionErrorKind::OnlyImplicitAccountCreationAllowed {
account_id: _,
} => {
println!("Error: Error occurs when a `CreateAccount` action is called on hex-characters account of length 64.\nSee implicit account creation NEP: https://github.com/nearprotocol/NEPs/pull/71")
println!("Error: `CreateAccount` action is called on hex-characters account of length 64.\nSee implicit account creation NEP: https://github.com/nearprotocol/NEPs/pull/71")
}
near_primitives::errors::ActionErrorKind::DeleteAccountWithLargeState { account_id } => {
println!(
Expand Down Expand Up @@ -1015,10 +1015,10 @@ pub fn handler_invalid_tx_error(
}
},
near_primitives::errors::InvalidTxError::InvalidSignerId { signer_id } => {
format!("Error: TX signer ID <{}> is not in a valid format or not satisfy requirements see \"near_runtime_utils::utils::is_valid_account_id\".", signer_id)
format!("Error: TX signer ID <{}> is not in a valid format or does not satisfy requirements\nSee \"near_runtime_utils::utils::is_valid_account_id\".", signer_id)
},
near_primitives::errors::InvalidTxError::SignerDoesNotExist { signer_id } => {
format!("Error: TX signer ID <{}> is not found in a storage.", signer_id)
format!("Error: TX signer ID <{}> is not found in the storage.", signer_id)
},
near_primitives::errors::InvalidTxError::InvalidNonce { tx_nonce, ak_nonce } => {
format!("Error: Transaction nonce ({}) must be account[access_key].nonce ({}) + 1.", tx_nonce, ak_nonce)
Expand All @@ -1027,7 +1027,7 @@ pub fn handler_invalid_tx_error(
format!("Error: Transaction nonce ({}) is larger than the upper bound ({}) given by the block height.", tx_nonce, upper_bound)
},
near_primitives::errors::InvalidTxError::InvalidReceiverId { receiver_id } => {
format!("Error: TX receiver ID ({}) is not in a valid format or not satisfy requirements see \"near_runtime_utils::is_valid_account_id\".", receiver_id)
format!("Error: TX receiver ID ({}) is not in a valid format or does not satisfy requirements\nSee \"near_runtime_utils::is_valid_account_id\".", receiver_id)
},
near_primitives::errors::InvalidTxError::InvalidSignature => {
format!("Error: TX signature is not valid")
Expand Down Expand Up @@ -1057,7 +1057,7 @@ pub fn handler_invalid_tx_error(
near_primitives::errors::InvalidTxError::ActionsValidation(actions_validation_error) => {
match actions_validation_error {
near_primitives::errors::ActionsValidationError::DeleteActionMustBeFinal => {
format!("Error: The delete action must be a final action in transaction.")
format!("Error: The delete action must be the final action in transaction.")
},
near_primitives::errors::ActionsValidationError::TotalPrepaidGasExceeded {total_prepaid_gas, limit} => {
format!("Error: The total prepaid gas ({}) for all given actions exceeded the limit ({}).",
Expand All @@ -1075,7 +1075,7 @@ pub fn handler_invalid_tx_error(
format!("Error: The length ({}) of some method name exceeded the limit ({}) in a Add Key action.", length, limit)
},
near_primitives::errors::ActionsValidationError::IntegerOverflow => {
format!("Error: Integer overflow during a compute.")
format!("Error: Integer overflow.")
},
near_primitives::errors::ActionsValidationError::InvalidAccountId {account_id} => {
format!("Error: Invalid account ID <{}>.", account_id)
Expand Down Expand Up @@ -1235,7 +1235,7 @@ pub fn try_external_subcommand_execution() -> CliResult {

if let Some(perr) = err.downcast_ref::<cargo_util::ProcessError>() {
if let Some(code) = perr.code {
return Err(color_eyre::eyre::eyre!("perror occured, code: {}", code));
return Err(color_eyre::eyre::eyre!("perror occurred, code: {}", code));
}
}
return Err(color_eyre::eyre::eyre!(err));
Expand Down