2022-12-16 05:21:50 -08:00
|
|
|
import * as anchor from "@coral-xyz/anchor";
|
|
|
|
import { Program } from "@coral-xyz/anchor";
|
2022-03-30 14:17:54 -07:00
|
|
|
import { PublicKey } from "@solana/web3.js";
|
|
|
|
import { assert } from "chai";
|
|
|
|
import { MultipleSuites } from "../../target/types/multiple_suites";
|
|
|
|
|
|
|
|
describe("multiple-suites", () => {
|
|
|
|
// Configure the client to use the local cluster.
|
2022-04-11 12:48:58 -07:00
|
|
|
anchor.setProvider(anchor.AnchorProvider.env());
|
2022-03-30 14:17:54 -07:00
|
|
|
|
|
|
|
const program = anchor.workspace.MultipleSuites as Program<MultipleSuites>;
|
|
|
|
|
|
|
|
it("Is initialized!", async () => {
|
|
|
|
// Add your test here.
|
|
|
|
const tx = await program.rpc.initialize(new anchor.BN(100000), {});
|
|
|
|
|
|
|
|
// SOME_TOKEN.json should exist.
|
|
|
|
const SOME_TOKEN = await program.provider.connection.getAccountInfo(
|
|
|
|
new PublicKey("C4XeBpzX4tDjGV1gkLsj7jJh6XHunVqAykANWCfTLszw")
|
|
|
|
);
|
|
|
|
|
|
|
|
// SOME_ACCOUNT.json should NOT exist.
|
|
|
|
const SOME_ACCOUNT = await program.provider.connection.getAccountInfo(
|
|
|
|
new PublicKey("3vMPj13emX9JmifYcWc77ekEzV1F37ga36E1YeSr6Mdj")
|
|
|
|
);
|
|
|
|
|
|
|
|
// ANOTHER_ACC.json should exist.
|
|
|
|
const ANOTHER_ACC = await program.provider.connection.getAccountInfo(
|
|
|
|
new PublicKey("JC7Vcye5upE6tMLAjAem76MCGuPNidTtg2cuYm71UukH")
|
|
|
|
);
|
|
|
|
|
|
|
|
// CLONED ACC should exist.
|
|
|
|
const CLONED_ACC = await program.provider.connection.getAccountInfo(
|
|
|
|
new PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s")
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.isNotNull(SOME_TOKEN);
|
|
|
|
assert.isNull(SOME_ACCOUNT);
|
|
|
|
assert.isNotNull(ANOTHER_ACC);
|
|
|
|
assert.isNotNull(CLONED_ACC);
|
|
|
|
|
|
|
|
console.log("Your transaction signature", tx);
|
|
|
|
});
|
|
|
|
});
|