Răsfoiți Sursa

fixed the keypair

0xPratik 1 an în urmă
părinte
comite
c96997574e
1 a modificat fișierele cu 5 adăugiri și 1 ștergeri
  1. 5 1
      compression/cnft-burn/tests/createAndMint.ts

+ 5 - 1
compression/cnft-burn/tests/createAndMint.ts

@@ -32,6 +32,7 @@ import { ValidDepthSizePair } from "@solana/spl-account-compression";
 // local import of the connection wrapper, to help with using the ReadApi
 import { WrapperConnection } from "./ReadApi/WrapperConnection";
 import { RPC_PATH } from "./cnft-burn";
+import * as anchor from "@coral-xyz/anchor";
 
 // define some reusable balance values for tracking
 let initBalance: number, balance: number;
@@ -41,7 +42,10 @@ export async function createAndMint() {
   //////////////////////////////////////////////////////////////////////////////
 
   // load it locally from the filesystem when available
-  const payer = loadKeypairFromFile("~/.config/solana/id.json");
+  anchor.setProvider(anchor.AnchorProvider.env());
+  const provider = anchor.AnchorProvider.env();
+  const payerWallet = provider.wallet as anchor.Wallet;
+  const payer = payerWallet.payer;
 
   console.log("Payer address:", payer.publicKey.toBase58());