Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,4 @@ lint-js:
cd ./clients/js && pnpm install && pnpm lint

test-js:
./scripts/restart-test-validator.sh
cd ./clients/js && pnpm install && pnpm build && pnpm test
./scripts/stop-test-validator.sh
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,3 @@ The following clients are available for the System program. You may use the foll

- [JS client](./clients/js)
- [Rust client](./clients/rust)

## Starting and stopping the local validator

The following script is available to start or restart your local validator.

```sh
./scripts/restart-test-validator.sh
```

Finally, you may stop the local validator using the following command.

```sh
./scripts/stop-test-validator.sh
```
2 changes: 1 addition & 1 deletion clients/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"devDependencies": {
"@solana/eslint-config-solana": "^6.0.0",
"@solana/kit-plugin-rpc": "^0.10.0",
"@solana/kit-plugin-litesvm": "^0.10.0",
"@solana/kit-plugin-signer": "^0.10.0",
"@solana/kit": "^6.4.0",
"@types/node": "^24",
Expand Down
111 changes: 106 additions & 5 deletions clients/js/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clients/js/test/_setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
lamports,
sequentialInstructionPlan,
} from '@solana/kit';
import { solanaLocalRpc } from '@solana/kit-plugin-rpc';
import { litesvm } from '@solana/kit-plugin-litesvm';
import { airdropSigner, generatedSigner } from '@solana/kit-plugin-signer';
import {
SYSTEM_PROGRAM_ADDRESS,
Expand All @@ -20,7 +20,7 @@ import {
export const createTestClient = () => {
return createClient()
.use(generatedSigner())
.use(solanaLocalRpc())
.use(litesvm())
.use(systemProgram())
.use(airdropSigner(lamports(1_000_000_000n)));
};
Expand Down
6 changes: 6 additions & 0 deletions clients/js/test/advanceNonceAccount.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ it('advances the nonce account', async () => {
await client.sendTransaction(await getCreateNonceInstructionPlan(client, nonce, authority));
const originalNonceAccount = await client.system.accounts.nonce.fetch(nonce.address);

// Expire the blockhash so the nonce's stored blockhash is no longer in the
// RecentBlockhashes sysvar. On a live cluster this happens naturally between
// blocks; under LiteSVM we have to trigger it explicitly, otherwise the
// System Program returns NonceBlockhashNotExpired (error 7).
client.svm.expireBlockhash();

// When the authority advances the nonce account.
await client.system.instructions
.advanceNonceAccount({ nonceAccount: nonce.address, nonceAuthority: authority })
Expand Down
37 changes: 0 additions & 37 deletions scripts/restart-test-validator.sh

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/stop-test-validator.sh

This file was deleted.

Loading