From 65b33d962e8845975078f7d88b98f737a02a60d4 Mon Sep 17 00:00:00 2001 From: Sohrab <4444588+sohrab-@users.noreply.github.com> Date: Tue, 26 Apr 2022 04:41:07 +1000 Subject: [PATCH] fix(milestone): make sure code snippet compiles and some formatting (#73) --- .../milestone_project_tic-tac-toe.md | 2 +- src/anchor_references/cli.md | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/anchor_in_depth/milestone_project_tic-tac-toe.md b/src/anchor_in_depth/milestone_project_tic-tac-toe.md index 3f10b68..30edba9 100644 --- a/src/anchor_in_depth/milestone_project_tic-tac-toe.md +++ b/src/anchor_in_depth/milestone_project_tic-tac-toe.md @@ -278,7 +278,7 @@ Time to test our code! Head over into the `tests` folder in the root directory. ```typescript it('setup game!', async() => { const gameKeypair = anchor.web3.Keypair.generate(); - const playerOne = program.provider.wallet; + const playerOne = (program.provider as anchor.AnchorProvider).wallet; const playerTwo = anchor.web3.Keypair.generate(); await program.methods .setupGame(playerTwo.publicKey) diff --git a/src/anchor_references/cli.md b/src/anchor_references/cli.md index c841485..b8e47c8 100644 --- a/src/anchor_references/cli.md +++ b/src/anchor_references/cli.md @@ -212,20 +212,16 @@ of all workspace programs before running them. If the configured network is a localnet, then automatically starts the localnetwork and runs the test. -::: tip Note -Be sure to shutdown any other local validators, otherwise `anchor test` will fail to run. - -If you'd prefer to run the program against your local validator use `anchor test --skip-local-validator`. -::: +> Note: Be sure to shutdown any other local validators, otherwise `anchor test` will fail to run. +> +> If you'd prefer to run the program against your local validator use `anchor test --skip-local-validator`. When running tests we stream program logs to `.anchor/program-logs/
..log` -::: tip Note -The Anchor workflow [recommends](https://www.parity.io/paritys-checklist-for-secure-smart-contract-development/) -to test your program using integration tests in a language other -than Rust to make sure that bugs related to syntax misunderstandings -are coverable with tests and not just replicated in tests. -::: +> Note: The Anchor workflow [recommends](https://www.parity.io/paritys-checklist-for-secure-smart-contract-development/) +> to test your program using integration tests in a language other +> than Rust to make sure that bugs related to syntax misunderstandings +> are coverable with tests and not just replicated in tests. ## Upgrade