another-suite.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import * as anchor from "@project-serum/anchor";
  2. import { Program } from "@project-serum/anchor";
  3. import { PublicKey } from "@solana/web3.js";
  4. import { assert } from "chai";
  5. import { MultipleSuites } from "../../target/types/multiple_suites";
  6. describe("multiple-suites", () => {
  7. // Configure the client to use the local cluster.
  8. anchor.setProvider(anchor.Provider.env());
  9. const program = anchor.workspace.MultipleSuites as Program<MultipleSuites>;
  10. it("Is initialized!", async () => {
  11. // Add your test here.
  12. const tx = await program.rpc.initialize(new anchor.BN(100000), {});
  13. // SOME_TOKEN.json should exist.
  14. const SOME_TOKEN = await program.provider.connection.getAccountInfo(
  15. new PublicKey("C4XeBpzX4tDjGV1gkLsj7jJh6XHunVqAykANWCfTLszw")
  16. );
  17. // SOME_ACCOUNT.json should NOT exist.
  18. const SOME_ACCOUNT = await program.provider.connection.getAccountInfo(
  19. new PublicKey("3vMPj13emX9JmifYcWc77ekEzV1F37ga36E1YeSr6Mdj")
  20. );
  21. // ANOTHER_ACC.json should exist.
  22. const ANOTHER_ACC = await program.provider.connection.getAccountInfo(
  23. new PublicKey("JC7Vcye5upE6tMLAjAem76MCGuPNidTtg2cuYm71UukH")
  24. );
  25. // CLONED ACC should exist.
  26. const CLONED_ACC = await program.provider.connection.getAccountInfo(
  27. new PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s")
  28. );
  29. assert.isNotNull(SOME_TOKEN);
  30. assert.isNull(SOME_ACCOUNT);
  31. assert.isNotNull(ANOTHER_ACC);
  32. assert.isNotNull(CLONED_ACC);
  33. console.log("Your transaction signature", tx);
  34. });
  35. });