Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: fix typos #280

Merged
merged 1 commit into from
Jul 30, 2023
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ Other features can be directly found in the `examples/` folder, with some docume

These environment variables will be useful if there was ever a snag hit:

- `NEAR_RPC_TIMEOUT_SECS`: The default is 10 seconds, but this is the amount of time beforing timing out waiting for a RPC service when talking to the sandbox or any other network such as testnet.
- `NEAR_RPC_TIMEOUT_SECS`: The default is 10 seconds, but this is the amount of time before timing out waiting for a RPC service when talking to the sandbox or any other network such as testnet.
- `NEAR_SANDBOX_BIN_PATH`: Set this to our own prebuilt `neard-sandbox` bin path if we want to use a non-default version of the sandbox or configure nearcore with our own custom features that we want to test in workspaces.
- `NEAR_SANDBOX_MAX_PAYLOAD_SIZE`: Sets the max payload size for sending transaction commits to sandbox. The default is 1gb and is necessary for patching large states.
- `NEAR_SANDBOX_MAX_FILES`: Set the max amount of files that can be opened at a time in the sandbox. If none is specified, the default size of 4096 will be used. The actual near chain will use over 10,000 in pratice, but for testing this should be much lower since we do not have a constantly running blockchain unless our tests take up that much time.
- `NEAR_SANDBOX_MAX_FILES`: Set the max amount of files that can be opened at a time in the sandbox. If none is specified, the default size of 4096 will be used. The actual near chain will use over 10,000 in practice, but for testing this should be much lower since we do not have a constantly running blockchain unless our tests take up that much time.
2 changes: 1 addition & 1 deletion workspaces/src/network/betanet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub const RPC_URL: &str = "https://rpc.betanet.near.org";
/// is not currently supported, and these calls into creating a betanet
/// worker is meant for retrieving data and/or making queries only.
/// Also, note that betanet can be unstable and does not provide an
/// archival endpoint similiar to that of mainnet.
/// archival endpoint similar to that of mainnet.
///
/// [`workspaces::betanet`]: crate::betanet
/// [`workspaces::betanet_archival`]: crate::betanet_archival
Expand Down
2 changes: 1 addition & 1 deletion workspaces/src/network/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl<'a, T> NetworkBuilder<'a, T> {
impl NetworkBuilder<'_, Sandbox> {
/// Specify how to fetch the validator key of the manually spawned sandbox node.
/// We are expected to init our own sandbox before running this builder. To learn more
/// about initalizing and starting our own sandbox, go to [near-sandbox](https://github.com/near/sandbox).
/// about initializing and starting our own sandbox, go to [near-sandbox](https://github.com/near/sandbox).
/// This can be either set to a known key value or to the home directory where all the chain data lives.
/// This is the `my_home_folder` we passed into `near-sandbox --home {my_home_folder} init`.
pub fn validator_key(mut self, validator_key: ValidatorKey) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion workspaces/src/network/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl FromNetworkBuilder for Sandbox {
// Spawn a new sandbox since rpc_url and home_dir weren't specified:
(None, None) => SandboxServer::run_new().await?,

// Missing inputted paramters for sandbox:
// Missing inputted parameters for sandbox:
(Some(rpc_url), None) => {
return Err(SandboxErrorCode::InitFailure.message(format!(
"Custom rpc_url={rpc_url} requires validator_key set."
Expand Down
10 changes: 5 additions & 5 deletions workspaces/src/network/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ impl SandboxServer {

/// Run a new SandboxServer, spawning the sandbox node in the process.
pub(crate) async fn run_new() -> Result<Self> {
// Supress logs for the sandbox binary by default:
supress_sandbox_logs_if_required();
// Suppress logs for the sandbox binary by default:
suppress_sandbox_logs_if_required();

let home_dir = init_home_dir().await?.into_path();
// Configure `$home_dir/config.json` to our liking. Sandbox requires extra settings
Expand Down Expand Up @@ -215,18 +215,18 @@ impl Drop for SandboxServer {
}

/// Turn off neard-sandbox logs by default. Users can turn them back on with
/// NEAR_ENABLE_SANDBOX_LOG=1 and specify further paramters with the custom
/// NEAR_ENABLE_SANDBOX_LOG=1 and specify further parameters with the custom
/// NEAR_SANDBOX_LOG for higher levels of specificity. NEAR_SANDBOX_LOG args
/// will be forward into RUST_LOG environment variable as to not conflict
/// with similar named log targets.
fn supress_sandbox_logs_if_required() {
fn suppress_sandbox_logs_if_required() {
if let Ok(val) = std::env::var("NEAR_ENABLE_SANDBOX_LOG") {
if val != "0" {
return;
}
}

// non-exhaustive list of targets to supress, since choosing a default LogLevel
// non-exhaustive list of targets to suppress, since choosing a default LogLevel
// does nothing in this case, since nearcore seems to be overriding it somehow:
std::env::set_var("NEAR_SANDBOX_LOG", "near=error,stats=error,network=error");
}
12 changes: 6 additions & 6 deletions workspaces/src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Function {
self
}

/// Similiar to `args`, specify an argument that is JSON serializable and can be
/// Similar to `args`, specify an argument that is JSON serializable and can be
/// accepted by the equivalent contract. Recommend to use something like
/// `serde_json::json!` macro to easily serialize the arguments.
pub fn args_json<U: serde::Serialize>(mut self, args: U) -> Self {
Expand All @@ -73,7 +73,7 @@ impl Function {
self
}

/// Similiar to `args`, specify an argument that is borsh serializable and can be
/// Similar to `args`, specify an argument that is borsh serializable and can be
/// accepted by the equivalent contract.
pub fn args_borsh<U: borsh::BorshSerialize>(mut self, args: U) -> Self {
match args.try_to_vec() {
Expand Down Expand Up @@ -264,7 +264,7 @@ impl Transaction {
}
}

/// Similiar to a [`Transaction`], but more specific to making a call into a contract.
/// Similar to a [`Transaction`], but more specific to making a call into a contract.
/// Note, only one call can be made per `CallTransaction`.
pub struct CallTransaction {
worker: Worker<dyn Network>,
Expand Down Expand Up @@ -296,15 +296,15 @@ impl CallTransaction {
self
}

/// Similiar to `args`, specify an argument that is JSON serializable and can be
/// Similar to `args`, specify an argument that is JSON serializable and can be
/// accepted by the equivalent contract. Recommend to use something like
/// `serde_json::json!` macro to easily serialize the arguments.
pub fn args_json<U: serde::Serialize>(mut self, args: U) -> Self {
self.function = self.function.args_json(args);
self
}

/// Similiar to `args`, specify an argument that is borsh serializable and can be
/// Similar to `args`, specify an argument that is borsh serializable and can be
/// accepted by the equivalent contract.
pub fn args_borsh<U: borsh::BorshSerialize>(mut self, args: U) -> Self {
self.function = self.function.args_borsh(args);
Expand Down Expand Up @@ -384,7 +384,7 @@ impl CallTransaction {
}
}

/// Similiar to a [`Transaction`], but more specific to creating an account.
/// Similar to a [`Transaction`], but more specific to creating an account.
/// This transaction will create a new account with the specified `receiver_id`
pub struct CreateAccountTransaction<'a, 'b> {
worker: &'a Worker<dyn Network>,
Expand Down
6 changes: 3 additions & 3 deletions workspaces/src/rpc/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ impl Query<'_, ViewFunction> {
self
}

/// Similiar to `args`, specify an argument that is JSON serializable and can be
/// Similar to `args`, specify an argument that is JSON serializable and can be
/// accepted by the equivalent contract. Recommend to use something like
/// `serde_json::json!` macro to easily serialize the arguments.
pub fn args_json<U: serde::Serialize>(mut self, args: U) -> Self {
self.method.function = self.method.function.args_json(args);
self
}

/// Similiar to `args`, specify an argument that is borsh serializable and can be
/// Similar to `args`, specify an argument that is borsh serializable and can be
/// accepted by the equivalent contract.
pub fn args_borsh<U: borsh::BorshSerialize>(mut self, args: U) -> Self {
self.method.function = self.method.function.args_borsh(args);
Expand Down Expand Up @@ -404,7 +404,7 @@ impl ProcessQuery for GasPrice {
/// and either block [`CryptoHash`] or [`BlockHeight`]).
///
/// The default behavior where a `ChunkReference` is not supplied will use a `BlockShardId`
/// referencing the lastest block `CryptoHash` with `ShardId` of 0.
/// referencing the latest block `CryptoHash` with `ShardId` of 0.
pub struct QueryChunk<'a> {
client: &'a Client,
chunk_ref: Option<ChunkReference>,
Expand Down
4 changes: 2 additions & 2 deletions workspaces/src/types/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ impl Contract {
}

/// Deletes the current contract, and returns the execution details of this
/// transaction. The beneciary will receive the funds of the account deleted
/// transaction. The beneficiary will receive the funds of the account deleted
pub async fn delete_contract(self, beneficiary_id: &AccountId) -> Result<ExecutionFinalResult> {
self.account.delete_account(beneficiary_id).await
}
Expand Down Expand Up @@ -337,7 +337,7 @@ impl AccountDetails {
AccountView {
amount: self.balance,
locked: self.locked,
// unwrap guranteed to succeed unless CryptoHash impls have changed in near_primitives.
// unwrap guaranteed to succeed unless CryptoHash impls have changed in near_primitives.
code_hash: near_primitives::hash::CryptoHash(self.code_hash.0),
storage_usage: self.storage_usage,
storage_paid_at: self.storage_paid_at,
Expand Down
4 changes: 2 additions & 2 deletions workspaces/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ pub struct FunctionCallPermission {

// This isn't an AccountId because already existing records in testnet genesis have invalid
// values for this field (see: https://github.com/near/nearcore/pull/4621#issuecomment-892099860)
// we accomodate those by using a string, allowing us to read and parse genesis.
// we accommodate those by using a string, allowing us to read and parse genesis.
/// The access key only allows transactions with the given receiver's account id.
pub receiver_id: String,

Expand Down Expand Up @@ -444,7 +444,7 @@ pub enum Finality {
/// Optimistic finality. The latest block recorded on the node that responded to our query
/// (<1 second delay after the transaction is submitted).
Optimistic,
/// Near-final finality. Similiarly to `Final` finality, but delay should be roughly 1 second.
/// Near-final finality. Similarly to `Final` finality, but delay should be roughly 1 second.
DoomSlug,
/// Final finality. The block that has been validated on at least 66% of the nodes in the
/// network. (At max, should be 2 second delay after the transaction is submitted.)
Expand Down