From 2fcec77352f528640b22c877bdd8d8842e31dacc Mon Sep 17 00:00:00 2001 From: austbot Date: Thu, 30 Jun 2022 16:38:42 -0500 Subject: [PATCH] fixes small bug with accounts and asset id for decompress and configurizes plerkle messenger, ingester messenger like api is configureized --- contracts/tests/bubblegum-test-rpc.ts | 12 +++++++++--- contracts/tests/bubblegum-test.ts | 15 +++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/contracts/tests/bubblegum-test-rpc.ts b/contracts/tests/bubblegum-test-rpc.ts index a07c17183c..2f5d9fe252 100644 --- a/contracts/tests/bubblegum-test-rpc.ts +++ b/contracts/tests/bubblegum-test-rpc.ts @@ -42,6 +42,7 @@ import {TokenProgramVersion, Version} from "../sdk/bubblegum/src/generated"; import {sleep} from "@metaplex-foundation/amman/dist/utils"; import {verbose} from "sqlite3"; import {bs58} from "@project-serum/anchor/dist/cjs/utils/bytes"; +import {CANDY_WRAPPER_PROGRAM_ID} from "../sdk/utils"; // @ts-ignore let Bubblegum; @@ -157,6 +158,7 @@ describe("bubblegum", () => { const initGummyrollIx = createCreateTreeInstruction( { treeCreator: payer.publicKey, + candyWrapper: CANDY_WRAPPER_PROGRAM_ID, payer: payer.publicKey, authority: authority, gummyrollProgram: GummyrollProgramId, @@ -221,6 +223,7 @@ describe("bubblegum", () => { { mintAuthority: payer.publicKey, authority: treeAuthority, + candyWrapper: CANDY_WRAPPER_PROGRAM_ID, gummyrollProgram: GummyrollProgramId, owner: payer.publicKey, delegate: payer.publicKey, @@ -258,6 +261,7 @@ describe("bubblegum", () => { let transferIx = createTransferInstruction( { authority: treeAuthority, + candyWrapper: CANDY_WRAPPER_PROGRAM_ID, owner: payer.publicKey, delegate: payer.publicKey, newOwner: destination.publicKey, @@ -284,6 +288,7 @@ describe("bubblegum", () => { let delegateIx = await createDelegateInstruction( { authority: treeAuthority, + candyWrapper: CANDY_WRAPPER_PROGRAM_ID, owner: destination.publicKey, previousDelegate: destination.publicKey, newDelegate: delegateKey.publicKey, @@ -308,6 +313,7 @@ describe("bubblegum", () => { let delTransferIx = createTransferInstruction( { authority: treeAuthority, + candyWrapper: CANDY_WRAPPER_PROGRAM_ID, owner: destination.publicKey, delegate: delegateKey.publicKey, newOwner: payer.publicKey, @@ -332,7 +338,6 @@ describe("bubblegum", () => { commitment: "confirmed", } ); - } let [voucher] = await PublicKey.findProgramAddress( @@ -350,6 +355,7 @@ describe("bubblegum", () => { let redeemIx = createRedeemInstruction( { authority: treeAuthority, + candyWrapper: CANDY_WRAPPER_PROGRAM_ID, owner: payer.publicKey, delegate: payer.publicKey, gummyrollProgram: GummyrollProgramId, @@ -391,6 +397,7 @@ describe("bubblegum", () => { const cancelRedeemIx = createCancelRedeemInstruction( { authority: treeAuthority, + candyWrapper: CANDY_WRAPPER_PROGRAM_ID, owner: payer.publicKey, gummyrollProgram: GummyrollProgramId, merkleSlab: merkleRollKeypair.publicKey, @@ -417,6 +424,7 @@ describe("bubblegum", () => { { authority: treeAuthority, owner: payer.publicKey, + candyWrapper: CANDY_WRAPPER_PROGRAM_ID, delegate: payer.publicKey, gummyrollProgram: GummyrollProgramId, merkleSlab: merkleRollKeypair.publicKey, @@ -440,8 +448,6 @@ describe("bubblegum", () => { ); } - - console.log("Decompressing - ", asset.toBase58()) let [mintAuthority] = await PublicKey.findProgramAddress( diff --git a/contracts/tests/bubblegum-test.ts b/contracts/tests/bubblegum-test.ts index a001e5ab49..dfe982878f 100644 --- a/contracts/tests/bubblegum-test.ts +++ b/contracts/tests/bubblegum-test.ts @@ -348,13 +348,8 @@ describe("bubblegum", () => { Bubblegum.programId ); - let [tokenMint] = await PublicKey.findProgramAddress( - [asset.toBuffer(), TOKEN_PROGRAM_ID.toBuffer()], - Bubblegum.programId - ); //TODO -> change this for v1 id must be the mint - let [mintAuthority] = await PublicKey.findProgramAddress( - [tokenMint.toBuffer()], + [asset.toBuffer()], Bubblegum.programId ); @@ -392,13 +387,13 @@ describe("bubblegum", () => { tokenAccount: await Token.getAssociatedTokenAddress( ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID, - tokenMint, + asset, payer.publicKey ), - mint: tokenMint, + mint: asset, mintAuthority: mintAuthority, - metadata: await getMetadata(tokenMint), - masterEdition: await getMasterEdition(tokenMint), + metadata: await getMetadata(asset), + masterEdition: await getMasterEdition(asset), sysvarRent: SYSVAR_RENT_PUBKEY, tokenMetadataProgram: PROGRAM_ID, associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,