litesvm.test.ts 720 B

1234567891011121314151617
  1. import * as anchor from '@coral-xyz/anchor';
  2. import { Program } from '@coral-xyz/anchor';
  3. import { Keypair } from '@solana/web3.js';
  4. import { LiteSVMProvider, fromWorkspace } from 'anchor-litesvm';
  5. import { ProcessingInstructions } from '../target/types/processing_instructions';
  6. const IDL = require('../target/idl/processing_instructions.json');
  7. it('Go to the park!', async () => {
  8. const client = fromWorkspace('');
  9. const provider = new LiteSVMProvider(client);
  10. const payer = provider.wallet.payer;
  11. const program = new anchor.Program<ProcessingInstructions>(IDL, provider);
  12. await program.methods.goToPark('Jimmy', 3).accounts({}).rpc();
  13. await program.methods.goToPark('Mary', 10).accounts({}).rpc();
  14. });