hello_solana.ts 696 B

12345678910111213141516171819202122
  1. import * as anchor from '@coral-xyz/anchor';
  2. import type { HelloSolana } from '../target/types/hello_solana';
  3. describe('hello_solana', () => {
  4. // Configure the client to use the local cluster.
  5. const provider = anchor.AnchorProvider.env();
  6. anchor.setProvider(provider);
  7. const program = anchor.workspace.HelloSolana as anchor.Program<HelloSolana>;
  8. const payer = provider.wallet as anchor.Wallet;
  9. it('Say hello!', async () => {
  10. // Just run Anchor's IDL method to build a transaction
  11. // and sign it via a signer.
  12. await program.methods
  13. .hello()
  14. .accounts({
  15. signer: provider.wallet.publicKey,
  16. })
  17. .signers([payer.payer])
  18. .rpc();
  19. });
  20. });