hello_solana.ts 700 B

1234567891011121314151617181920212223
  1. import * as anchor from "@project-serum/anchor";
  2. import { 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.hello()
  13. .accounts({
  14. signer: provider.wallet.publicKey,
  15. })
  16. .signers([payer.payer])
  17. .rpc();
  18. });
  19. });