Browse Source

Update not to use hard coded public key for program id

Dadepo Aderemi 2 years ago
parent
commit
0e3ffefe47
1 changed files with 3 additions and 4 deletions
  1. 3 4
      basics/create-account/native/tests/test.ts

+ 3 - 4
basics/create-account/native/tests/test.ts

@@ -21,10 +21,9 @@ describe("Create a system account", async () => {
 
     const connection = new Connection(`http://localhost:8899`, 'confirmed');
     const payer = createKeypairFromFile(require('os').homedir() + '/.config/solana/id.json');
-    
-    const PROGRAM_ID: PublicKey = new PublicKey(
-        "Au21huMZuDQrbzu2Ec5ohpW5CKRqhcGV6qLawfydStGs"
-    );
+    const program = createKeypairFromFile('./program/target/so/program-keypair.json')
+
+    const PROGRAM_ID: PublicKey = program.publicKey;
   
     it("Create the account via a cross program invocation", async () => {