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

chore: fix docs & typos #340

Merged
merged 1 commit into from Nov 27, 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 @@ -99,7 +99,7 @@ Afterwards, let's mint an NFT via `nft_mint`. This showcases some extra argument
"token_owner_id": contract.id(),
"token_metadata": {
"title": "Olympus Mons",
"dscription": "Tallest mountain in charted solar system",
"description": "Tallest mountain in charted solar system",
"copies": 1,
},
}))
Expand Down Expand Up @@ -137,7 +137,7 @@ More standalone examples can be found in `examples/src/*.rs`.

To run the above NFT example, execute:

```
```sh
cargo run --example nft
```

Expand Down
2 changes: 1 addition & 1 deletion examples/manually-spawned-sandbox.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Utilizing custom sandbox node

This example will show us how to spin up a sandbox node of our own choosing. Follow the guide in https://github.com/near/sandbox to download it. This is mainly needed if a user wants to manage their own node and/or not require each test to spin up a new node each time.
This example will show us how to spin up a sandbox node of our own choosing. Follow the guide in <https://github.com/near/sandbox> to download it. This is mainly needed if a user wants to manage their own node and/or not require each test to spin up a new node each time.

Then initialize the chain via `init` and run it:

Expand Down
4 changes: 2 additions & 2 deletions examples/src/croncat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ pub async fn run_scheduled_tasks(
NearToken::from_yoctonear(2260000000000000000000u128)
);

// This shows how much the agent has profitted from executing the task:
// This shows how much the agent has profited from executing the task:
println!(
"Agent profitted {} yN and has been transferred to the agent's account",
"Agent profited {} yN and has been transferred to the agent's account",
before_withdraw.as_yoctonear() - agent_details.balance.as_yoctonear()
);

Expand Down
2 changes: 1 addition & 1 deletion examples/src/nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async fn main() -> anyhow::Result<()> {
"token_owner_id": contract.id(),
"token_metadata": {
"title": "Olympus Mons",
"dscription": "Tallest mountain in charted solar system",
"description": "Tallest mountain in charted solar system",
"copies": 1,
},
}))
Expand Down
4 changes: 2 additions & 2 deletions examples/src/ref_finance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async fn create_ref(owner: &Account, worker: &Worker<Sandbox>) -> anyhow::Result
.transact()
.await?;

// NOTE: We are not pulling down the contract's data here, so we'll need to initalize
// NOTE: We are not pulling down the contract's data here, so we'll need to initialize
// our own set of metadata. This is because the contract's data is too big for the rpc
// service to pull down (i.e. greater than 50kb).

Expand All @@ -58,7 +58,7 @@ async fn create_ref(owner: &Account, worker: &Worker<Sandbox>) -> anyhow::Result
Ok(ref_finance)
}

/// Pull down the WNear contract from mainnet and initilize it with our own metadata.
/// Pull down the WNear contract from mainnet and initialize it with our own metadata.
async fn create_wnear(owner: &Account, worker: &Worker<Sandbox>) -> anyhow::Result<Contract> {
let mainnet = near_workspaces::mainnet_archival().await?;
let wnear_id: AccountId = "wrap.near".to_string().try_into()?;
Expand Down
6 changes: 3 additions & 3 deletions examples/src/spooning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const STATUS_MSG_WASM_FILEPATH: &str = "./examples/res/status_message.wasm";
/// overload testnet and have to go through a couple more cycles than we have to, to showcase spooning.
///
/// If you'd like a different account to deploy it to, run the following:
/// ```norun
/// ```rust, norun
/// async fn deploy_testnet() -> anyhow::Result<()> {
/// let worker = worspaces::testnet().await?;
/// let worker = near_workspaces::testnet().await?;
///
/// let contract = deploy_status_contract(worker, "hello from testnet").await?;
/// println!("{}", contract.id());
Expand Down Expand Up @@ -114,7 +114,7 @@ async fn main() -> anyhow::Result<()> {
info!(target: "spooning", "New status patched: {:?}", status);
assert_eq!(&status, "hello from testnet");

// See that sandbox state was overriden. Grabbing get_status(sandbox_contract_id) should yield Null
// See that sandbox state was overridden. Grabbing get_status(sandbox_contract_id) should yield Null
let result: Option<String> = sandbox_contract
.view("get_status")
.args_json(json!({
Expand Down
6 changes: 3 additions & 3 deletions examples/src/various_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async fn main() -> anyhow::Result<()> {
.block_height(0)
// can instead use .block_hash(CryptoHash) as well
.await?;
println!("Sandbox Geneis Block: {genesis_block:#?}");
println!("Sandbox Genesis Block: {genesis_block:#?}");

// Reference the chunk via the block hash we queried for earlier:
let shard_id = 0;
Expand Down Expand Up @@ -48,7 +48,7 @@ async fn main() -> anyhow::Result<()> {
.await?
.into_result()?;
println!(
"Bob burnt {} gas callling into `set_status('Hello')`",
"Bob burnt {} gas calling into `set_status('Hello')`",
outcome.total_gas_burnt
);

Expand All @@ -66,7 +66,7 @@ async fn main() -> anyhow::Result<()> {
.await?
.into_result()?;
println!(
"Bob burnt {} gas callling into `set_status('World')`",
"Bob burnt {} gas calling into `set_status('World')`",
outcome.total_gas_burnt
);

Expand Down
2 changes: 1 addition & 1 deletion workspaces/src/network/mainnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl FromNetworkBuilder for Mainnet {
name: build.name.into(),
root_id: "near".parse().unwrap(),
keystore_path: PathBuf::from(".near-credentials/mainnet/"),
rpc_url: url::Url::parse(&rpc_url).expect("url is hardcodeed"),
rpc_url: url::Url::parse(&rpc_url).expect("url is hardcoded"),
},
})
}
Expand Down
2 changes: 1 addition & 1 deletion workspaces/tests/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async fn test_manually_spawned_deploy() -> anyhow::Result<()> {
let mut home_dir = std::env::temp_dir();
home_dir.push(format!("test-sandbox-{}", rpc_port));

// intialize chain data with supplied home dir
// initialize chain data with supplied home dir
let output = near_sandbox_utils::init(&home_dir)?
.wait_with_output()
.await
Expand Down
6 changes: 3 additions & 3 deletions workspaces/tests/optional_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ async fn test_empty_args_error() -> anyhow::Result<()> {
.await?
.into_result();

if let Some(exeuction_err) = res.err() {
assert!(format!("{}", exeuction_err).contains("Failed to deserialize input from JSON"));
if let Some(execution_err) = res.err() {
assert!(format!("{}", execution_err).contains("Failed to deserialize input from JSON"));
assert!(
exeuction_err.total_gas_burnt > NearGas::from_gas(0),
execution_err.total_gas_burnt > NearGas::from_gas(0),
"Gas is still burnt for transaction although inputs are incorrect"
);
} else {
Expand Down
2 changes: 1 addition & 1 deletion workspaces/tests/parallel_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async fn test_parallel_async() -> anyhow::Result<()> {
let contract = worker.dev_deploy(STATUS_MSG_CONTRACT).await?;
let account = worker.dev_create_account().await?;

// nonce of access key before any transactions occured.
// nonce of access key before any transactions occurred.
let nonce_start = worker
.view_access_key(account.id(), &account.secret_key().public_key())
.await?
Expand Down
Loading