fix(milestone): make sure code snippet compiles and some formatting (#73)

This commit is contained in:
Sohrab 2022-04-26 04:41:07 +10:00 committed by GitHub
parent b111ea271a
commit 65b33d962e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 12 deletions

View File

@ -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)

View File

@ -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/<address>.<program-name>.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