Skip to content

Commit

Permalink
Move BubblegumSetCollectionSize to end of instruction vector
Browse files Browse the repository at this point in the history
- Also update token-metadata version (needed for Bubblegum)
- Also regenerate API.
  • Loading branch information
danenbm committed Aug 29, 2022
1 parent 8d0ac5b commit 00825fc
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 55 deletions.
2 changes: 1 addition & 1 deletion bubblegum/program/Cargo.lock

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

2 changes: 1 addition & 1 deletion bubblegum/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ anchor-lang = { version = "0.25.0", features = [ "init-if-needed" ] }
anchor-spl = { version = "0.25.0" }
spl-token = { version = "3.3.0", features = [ "no-entrypoint" ] }
spl-associated-token-account = { version = "1.0.5", features = [ "no-entrypoint" ] }
mpl-token-metadata = {path = "../../token-metadata/program" , features = ["no-entrypoint"] }
mpl-token-metadata = { version = "1.3.5", path = "../../token-metadata/program" , features = ["no-entrypoint"] }
gummyroll = { git = "https://github.com/jarry-xiao/candyland.git", features = ["cpi"] }
bytemuck = "1.8.0"

Expand Down
2 changes: 1 addition & 1 deletion token-metadata/Cargo.lock

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

68 changes: 34 additions & 34 deletions token-metadata/js/idl/mpl_token_metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.4",
"version": "1.3.5",
"name": "mpl_token_metadata",
"instructions": [
{
Expand Down Expand Up @@ -1963,83 +1963,83 @@
}
},
{
"name": "BubblegumSetCollectionSize",
"name": "SetTokenStandard",
"accounts": [
{
"name": "collectionMetadata",
"name": "metadata",
"isMut": true,
"isSigner": false,
"desc": "Collection Metadata account"
"desc": "Metadata account"
},
{
"name": "collectionAuthority",
"name": "updateAuthority",
"isMut": true,
"isSigner": true,
"desc": "Collection Update authority"
"desc": "Metadata update authority"
},
{
"name": "collectionMint",
"name": "mint",
"isMut": false,
"isSigner": false,
"desc": "Mint of the Collection"
},
{
"name": "bubblegumProgramAuthority",
"isMut": false,
"isSigner": true,
"desc": "Signing PDA of Bubblegum program"
"desc": "Mint account"
},
{
"name": "collectionAuthorityRecord",
"name": "edition",
"isMut": false,
"isSigner": false,
"desc": "Collection Authority Record PDA",
"desc": "Edition account",
"optional": true
}
],
"args": [
{
"name": "setCollectionSizeArgs",
"type": {
"defined": "SetCollectionSizeArgs"
}
}
],
"args": [],
"discriminant": {
"type": "u8",
"value": 35
}
},
{
"name": "SetTokenStandard",
"name": "BubblegumSetCollectionSize",
"accounts": [
{
"name": "metadata",
"name": "collectionMetadata",
"isMut": true,
"isSigner": false,
"desc": "Metadata account"
"desc": "Collection Metadata account"
},
{
"name": "updateAuthority",
"name": "collectionAuthority",
"isMut": true,
"isSigner": true,
"desc": "Metadata update authority"
"desc": "Collection Update authority"
},
{
"name": "mint",
"name": "collectionMint",
"isMut": false,
"isSigner": false,
"desc": "Mint account"
"desc": "Mint of the Collection"
},
{
"name": "edition",
"name": "bubblegumSigner",
"isMut": false,
"isSigner": true,
"desc": "Signing PDA of Bubblegum program"
},
{
"name": "collectionAuthorityRecord",
"isMut": false,
"isSigner": false,
"desc": "Edition account",
"desc": "Collection Authority Record PDA",
"optional": true
}
],
"args": [],
"args": [
{
"name": "setCollectionSizeArgs",
"type": {
"defined": "SetCollectionSizeArgs"
}
}
],
"discriminant": {
"type": "u8",
"value": 36
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const BubblegumSetCollectionSizeStruct = new beet.BeetArgsStruct<
* @property [_writable_] collectionMetadata Collection Metadata account
* @property [_writable_, **signer**] collectionAuthority Collection Update authority
* @property [] collectionMint Mint of the Collection
* @property [**signer**] bubblegumProgramAuthority Signing PDA of Bubblegum program
* @property [**signer**] bubblegumSigner Signing PDA of Bubblegum program
* @property [] collectionAuthorityRecord (optional) Collection Authority Record PDA
* @category Instructions
* @category BubblegumSetCollectionSize
Expand All @@ -49,11 +49,11 @@ export type BubblegumSetCollectionSizeInstructionAccounts = {
collectionMetadata: web3.PublicKey;
collectionAuthority: web3.PublicKey;
collectionMint: web3.PublicKey;
bubblegumProgramAuthority: web3.PublicKey;
bubblegumSigner: web3.PublicKey;
collectionAuthorityRecord?: web3.PublicKey;
};

export const bubblegumSetCollectionSizeInstructionDiscriminator = 35;
export const bubblegumSetCollectionSizeInstructionDiscriminator = 36;

/**
* Creates a _BubblegumSetCollectionSize_ instruction.
Expand Down Expand Up @@ -91,7 +91,7 @@ export function createBubblegumSetCollectionSizeInstruction(
isSigner: false,
},
{
pubkey: accounts.bubblegumProgramAuthority,
pubkey: accounts.bubblegumSigner,
isWritable: false,
isSigner: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export type SetTokenStandardInstructionAccounts = {
edition?: web3.PublicKey;
};

export const setTokenStandardInstructionDiscriminator = 36;
export const setTokenStandardInstructionDiscriminator = 35;

/**
* Creates a _SetTokenStandard_ instruction.
Expand Down
2 changes: 1 addition & 1 deletion token-metadata/program/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mpl-token-metadata"
version = "1.3.4"
version = "1.3.5"
description = "Metaplex Metadata"
authors = ["Metaplex Developers <[email protected]>"]
repository = "https://github.com/metaplex-foundation/metaplex-program-library"
Expand Down
17 changes: 9 additions & 8 deletions token-metadata/program/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,20 +510,21 @@ pub enum MetadataInstruction {
#[account(3, optional, name="collection_authority_record", desc="Collection Authority Record PDA")]
SetCollectionSize(SetCollectionSizeArgs),

/// Set size of an existing collection.
#[account(0, writable, name="collection_metadata", desc="Collection Metadata account")]
#[account(1, signer, writable, name="collection_authority", desc="Collection Update authority")]
#[account(2, name="collection_mint", desc="Mint of the Collection")]
#[account(3, signer, name="bubblegum_program_authority", desc="Signing PDA of Bubblegum program")]
#[account(4, optional, name="collection_authority_record", desc="Collection Authority Record PDA")]
BubblegumSetCollectionSize(SetCollectionSizeArgs),

/// Set the token standard of the asset.
#[account(0, writable, name="metadata", desc="Metadata account")]
#[account(1, signer, writable, name="update_authority", desc="Metadata update authority")]
#[account(2, name="mint", desc="Mint account")]
#[account(3, optional, name="edition", desc="Edition account")]
SetTokenStandard,

/// Set size of an existing collection using CPI from the Bubblegum program. This is how
/// collection size is incremented and decremented for compressed NFTs.
#[account(0, writable, name="collection_metadata", desc="Collection Metadata account")]
#[account(1, signer, writable, name="collection_authority", desc="Collection Update authority")]
#[account(2, name="collection_mint", desc="Mint of the Collection")]
#[account(3, signer, name="bubblegum_signer", desc="Signing PDA of Bubblegum program")]
#[account(4, optional, name="collection_authority_record", desc="Collection Authority Record PDA")]
BubblegumSetCollectionSize(SetCollectionSizeArgs),
}

/// Creates an CreateMetadataAccounts instruction
Expand Down
8 changes: 4 additions & 4 deletions token-metadata/program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ pub fn process_instruction<'a>(
msg!("Instruction: Set Collection Size");
set_collection_size(program_id, accounts, args)
}
MetadataInstruction::BubblegumSetCollectionSize(args) => {
msg!("Instruction: Bubblegum Program Set Collection Size");
set_collection_size(program_id, accounts, args)
}
MetadataInstruction::SetTokenStandard => {
msg!("Instruction: Set Token Standard");
set_token_standard(program_id, accounts)
}
MetadataInstruction::BubblegumSetCollectionSize(args) => {
msg!("Instruction: Bubblegum Program Set Collection Size");
bubblegum_set_collection_size(program_id, accounts, args)
}
}
}

Expand Down

0 comments on commit 00825fc

Please sign in to comment.