Skip to content

Commit

Permalink
Add compute ix to migrate mpl command (#82)
Browse files Browse the repository at this point in the history
* Add compute ix to migrate mpl command

* Update version

* fix tests
  • Loading branch information
mi-yu authored Sep 12, 2023
1 parent 63fd8a4 commit 7a7746b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 33 deletions.
42 changes: 20 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magiceden-oss/open_creator_protocol",
"version": "0.3.5",
"version": "0.3.6",
"description": "SDK for open_creator_protocol",
"scripts": {
"build": "tsc"
Expand All @@ -24,4 +24,4 @@
"@solana/web3.js": "^1.65.0",
"borsh": "^0.7.0"
}
}
}
3 changes: 2 additions & 1 deletion sdk/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from "./generated";
import {
CMT_PROGRAM,
computeBudgetIx,
findFreezeAuthorityPk,
findMintStatePk,
findPolicyPk,
Expand Down Expand Up @@ -118,7 +119,7 @@ async function migrate_to_mpl() {
metadataProgram: TokenMetadataProgram.publicKey,
payer: CLI_UPDATE_AUTHORITY.publicKey,
});
await process_tx(conn, [ix], [CLI_UPDATE_AUTHORITY]);
await process_tx(conn, [computeBudgetIx, ix], [CLI_UPDATE_AUTHORITY]);
console.log("migrated to mpl, mint: ", CLI_MINT.toBase58());
}

Expand Down
17 changes: 11 additions & 6 deletions tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
walletAdapterIdentity,
} from "@metaplex-foundation/js";
import {
createCreateMetadataAccountV2Instruction,
createCreateMetadataAccountV3Instruction,
DataV2,
} from "@metaplex-foundation/mpl-token-metadata";
import * as anchor from "@project-serum/anchor";
Expand Down Expand Up @@ -172,7 +172,7 @@ const createNewMintTransaction = async (
freezeAuthority, //Freeze Authority
TOKEN_PROGRAM_ID
),
createCreateMetadataAccountV2Instruction(
createCreateMetadataAccountV3Instruction(
{
metadata: metadataPDA,
mint: mintKeypair.publicKey,
Expand All @@ -181,9 +181,10 @@ const createNewMintTransaction = async (
updateAuthority: mintAuthority,
},
{
createMetadataAccountArgsV2: {
createMetadataAccountArgsV3: {
data: ON_CHAIN_METADATA,
isMutable: true,
collectionDetails: null,
},
}
)
Expand Down Expand Up @@ -214,9 +215,13 @@ export const createPolicyFixture = async (conn: Connection, payer: Keypair) => {
{
and: [
{
field: "program_ids",
operator: "string_does_not_contain_any",
value: ["aaaa111111111111111111111111", "bbbb111111111111111111111111", "cccc111111111111111111111111"],
field: "program_ids",
operator: "string_does_not_contain_any",
value: [
"aaaa111111111111111111111111",
"bbbb111111111111111111111111",
"cccc111111111111111111111111",
],
},
{
or: [
Expand Down

0 comments on commit 7a7746b

Please sign in to comment.