lamports.ts 569 B

1234567891011121314151617181920
  1. import * as anchor from "@coral-xyz/anchor";
  2. import { Lamports } from "../../target/types/lamports";
  3. describe("lamports", () => {
  4. // Configure the client to use the local cluster
  5. anchor.setProvider(anchor.AnchorProvider.env());
  6. const program = anchor.workspace.Lamports as anchor.Program<Lamports>;
  7. it("Can transfer from/to PDA", async () => {
  8. await program.methods
  9. .transfer(new anchor.BN(anchor.web3.LAMPORTS_PER_SOL))
  10. .rpc();
  11. });
  12. it("Returns an error on overflow", async () => {
  13. await program.methods.overflow().rpc();
  14. });
  15. });