Skip to content

Commit a0e20e3

Browse files
author
Solandy
committed
put constants in extra file
1 parent 188dda7 commit a0e20e3

File tree

4 files changed

+17
-27
lines changed

4 files changed

+17
-27
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as anchor from "@project-serum/anchor";
2+
import { CnftVault } from "../../target/types/cnft_vault";
3+
import { loadWalletKey } from "../utils";
4+
import { IDL } from "../../target/types/cnft_vault"
5+
6+
export const connection = new anchor.web3.Connection("https://api.devnet.solana.com");
7+
export const keypair = loadWalletKey("~/.config/solana/id.json");
8+
export const wallet = new anchor.Wallet(keypair);
9+
export const provider = new anchor.AnchorProvider(connection, wallet, {});
10+
export const programID = new anchor.web3.PublicKey("CNftyK7T8udPwYRzZUMWzbh79rKrz9a5GwV2wv7iEHpk")
11+
export const program = new anchor.Program<CnftVault>(IDL, programID, provider);

compression/cnft-vault/anchor/tests/scripts/withdraw.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
import * as anchor from "@project-serum/anchor";
2-
import { CnftVault } from "../../target/types/cnft_vault";
3-
import { loadWalletKey, decode, mapProof } from "../utils";
4-
import { IDL } from "../../target/types/cnft_vault"
2+
import { decode, mapProof } from "../utils";
53
import { PROGRAM_ID as BUBBLEGUM_PROGRAM_ID } from "@metaplex-foundation/mpl-bubblegum";
64
import { SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID } from "@solana/spl-account-compression";
75
import { getAsset, getAssetProof } from "../readAPI";
86

7+
import { program, programID } from "./constants";
98

10-
const connection = new anchor.web3.Connection("https://api.devnet.solana.com");
11-
const keypair = loadWalletKey("../AndYPfCmbSSHpe2yukLXDT9N29twa7kJDk3yrRMQW7SN.json");
12-
const wallet = new anchor.Wallet(keypair);
13-
const provider = new anchor.AnchorProvider(connection, wallet, {});
14-
const programID = new anchor.web3.PublicKey("CNftyK7T8udPwYRzZUMWzbh79rKrz9a5GwV2wv7iEHpk")
15-
const program = new anchor.Program<CnftVault>(IDL, programID, provider);
169
async function main() {
1710
const [vaultPDA, _bump] = anchor.web3.PublicKey.findProgramAddressSync(
1811
[Buffer.from("cNFT-vault", "utf8")],

compression/cnft-vault/anchor/tests/scripts/withdrawTwo.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
import * as anchor from "@project-serum/anchor";
2-
import { CnftVault } from "../../target/types/cnft_vault";
3-
import { loadWalletKey, decode, mapProof } from "../utils";
4-
import { IDL } from "../../target/types/cnft_vault"
2+
import { decode, mapProof } from "../utils";
53
import { PROGRAM_ID as BUBBLEGUM_PROGRAM_ID } from "@metaplex-foundation/mpl-bubblegum";
64
import { SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID } from "@solana/spl-account-compression";
75
import { getAsset, getAssetProof } from "../readAPI";
86
import { AccountMeta } from "@solana/web3.js";
97

8+
import { program, programID } from "./constants";
109

11-
const connection = new anchor.web3.Connection("https://api.devnet.solana.com");
12-
const keypair = loadWalletKey("../AndYPfCmbSSHpe2yukLXDT9N29twa7kJDk3yrRMQW7SN.json");
13-
const wallet = new anchor.Wallet(keypair);
14-
const provider = new anchor.AnchorProvider(connection, wallet, {});
15-
const programID = new anchor.web3.PublicKey("CNftyK7T8udPwYRzZUMWzbh79rKrz9a5GwV2wv7iEHpk")
16-
const program = new anchor.Program<CnftVault>(IDL, programID, provider);
1710
async function main() {
1811

1912
// TODO change all of these to your values

compression/cnft-vault/anchor/tests/scripts/withdrawWithLookup.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
import * as anchor from "@project-serum/anchor";
2-
import { CnftVault } from "../../target/types/cnft_vault";
3-
import { loadWalletKey, decode, mapProof } from "../utils";
4-
import { IDL } from "../../target/types/cnft_vault"
2+
import { decode, mapProof } from "../utils";
53
import { PROGRAM_ID as BUBBLEGUM_PROGRAM_ID } from "@metaplex-foundation/mpl-bubblegum";
64
import { SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID } from "@solana/spl-account-compression";
75
import { getAsset, getAssetProof } from "../readAPI";
86
import { AccountMeta, AddressLookupTableProgram, PublicKey, SystemProgram, Transaction, TransactionMessage, VersionedTransaction, sendAndConfirmTransaction } from "@solana/web3.js";
97

8+
import { connection, keypair, program, programID } from "./constants";
109

11-
const connection = new anchor.web3.Connection("https://api.devnet.solana.com");
12-
const keypair = loadWalletKey("../AndYPfCmbSSHpe2yukLXDT9N29twa7kJDk3yrRMQW7SN.json");
13-
const wallet = new anchor.Wallet(keypair);
14-
const provider = new anchor.AnchorProvider(connection, wallet, {});
15-
const programID = new anchor.web3.PublicKey("CNftyK7T8udPwYRzZUMWzbh79rKrz9a5GwV2wv7iEHpk")
16-
const program = new anchor.Program<CnftVault>(IDL, programID, provider);
1710
async function main() {
1811

1912
// TODO change all of these to your values

0 commit comments

Comments
 (0)