1234567891011121314151617181920212223 |
- import * as anchor from "@project-serum/anchor";
- import { HelloSolana } from "../target/types/hello_solana";
- describe("hello_solana", () => {
- // Configure the client to use the local cluster.
- const provider = anchor.AnchorProvider.env();
- anchor.setProvider(provider);
- const program = anchor.workspace.HelloSolana as anchor.Program<HelloSolana>;
- const payer = provider.wallet as anchor.Wallet;
- it("Say hello!", async () => {
- // Just run Anchor's IDL method to build a transaction
- // and sign it via a signer.
- await program.methods.hello()
- .accounts({
- signer: provider.wallet.publicKey,
- })
- .signers([payer.payer])
- .rpc();
- });
- });
|