Skip to content

Commit

Permalink
Merge pull request #130 from jarry-xiao/add-config-fix-id-bug
Browse files Browse the repository at this point in the history
External Configuration
  • Loading branch information
austbot authored Jul 1, 2022
2 parents 4e4d2e1 + 2fcec77 commit e5192f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
12 changes: 9 additions & 3 deletions contracts/tests/bubblegum-test-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -157,6 +158,7 @@ describe("bubblegum", () => {
const initGummyrollIx = createCreateTreeInstruction(
{
treeCreator: payer.publicKey,
candyWrapper: CANDY_WRAPPER_PROGRAM_ID,
payer: payer.publicKey,
authority: authority,
gummyrollProgram: GummyrollProgramId,
Expand Down Expand Up @@ -221,6 +223,7 @@ describe("bubblegum", () => {
{
mintAuthority: payer.publicKey,
authority: treeAuthority,
candyWrapper: CANDY_WRAPPER_PROGRAM_ID,
gummyrollProgram: GummyrollProgramId,
owner: payer.publicKey,
delegate: payer.publicKey,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -332,7 +338,6 @@ describe("bubblegum", () => {
commitment: "confirmed",
}
);

}

let [voucher] = await PublicKey.findProgramAddress(
Expand All @@ -350,6 +355,7 @@ describe("bubblegum", () => {
let redeemIx = createRedeemInstruction(
{
authority: treeAuthority,
candyWrapper: CANDY_WRAPPER_PROGRAM_ID,
owner: payer.publicKey,
delegate: payer.publicKey,
gummyrollProgram: GummyrollProgramId,
Expand Down Expand Up @@ -391,6 +397,7 @@ describe("bubblegum", () => {
const cancelRedeemIx = createCancelRedeemInstruction(
{
authority: treeAuthority,
candyWrapper: CANDY_WRAPPER_PROGRAM_ID,
owner: payer.publicKey,
gummyrollProgram: GummyrollProgramId,
merkleSlab: merkleRollKeypair.publicKey,
Expand All @@ -417,6 +424,7 @@ describe("bubblegum", () => {
{
authority: treeAuthority,
owner: payer.publicKey,
candyWrapper: CANDY_WRAPPER_PROGRAM_ID,
delegate: payer.publicKey,
gummyrollProgram: GummyrollProgramId,
merkleSlab: merkleRollKeypair.publicKey,
Expand All @@ -440,8 +448,6 @@ describe("bubblegum", () => {
);
}



console.log("Decompressing - ", asset.toBase58())

let [mintAuthority] = await PublicKey.findProgramAddress(
Expand Down
15 changes: 5 additions & 10 deletions contracts/tests/bubblegum-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e5192f9

Please sign in to comment.