Skip to content

Commit

Permalink
Add MetadataArgs to UpdateMetadata payload
Browse files Browse the repository at this point in the history
  • Loading branch information
danenbm committed Oct 12, 2023
1 parent d34ac7c commit f5f7a3d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 30 deletions.
39 changes: 19 additions & 20 deletions 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 blockbuster/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ readme = "../README.md"
[dependencies]
spl-account-compression = { version = "0.2.0", features = ["no-entrypoint"] }
spl-noop = { version = "0.2.0", features = ["no-entrypoint"] }
mpl-bubblegum = "1.0.1-beta.2"
mpl-bubblegum = "1.0.1-beta.3"
mpl-candy-guard = { version = "2.0.0", features = ["no-entrypoint"] }
mpl-candy-machine-core = { version = "2.0.0", features = ["no-entrypoint"] }
mpl-token-metadata = { version = "2.0.0-beta.1", features = ["no-entrypoint", "serde-feature"] }
Expand Down
35 changes: 26 additions & 9 deletions blockbuster/src/programs/bubblegum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,27 @@ use spl_noop;
#[derive(Eq, PartialEq)]
pub enum Payload {
Unknown,
MintV1 { args: MetadataArgs },
Decompress { args: MetadataArgs },
CancelRedeem { root: [u8; 32] },
CreatorVerification { creator: Pubkey, verify: bool },
CollectionVerification { collection: Pubkey, verify: bool },
UpdateMetadata { update_args: UpdateArgs },
MintV1 {
args: MetadataArgs,
},
Decompress {
args: MetadataArgs,
},
CancelRedeem {
root: [u8; 32],
},
CreatorVerification {
creator: Pubkey,
verify: bool,
},
CollectionVerification {
collection: Pubkey,
verify: bool,
},
UpdateMetadata {
current_metadata: MetadataArgs,
update_args: UpdateArgs,
},
}
//TODO add more of the parsing here to minimize program transformer code
pub struct BubblegumInstruction {
Expand Down Expand Up @@ -201,8 +216,10 @@ impl ProgramParser for BubblegumParser {
}
InstructionName::UpdateMetadata => {
let args = UpdateMetadataInstructionArgs::try_from_slice(&outer_ix_data)?;
let update_args = args.update_args;
b_inst.payload = Some(Payload::UpdateMetadata { update_args });
b_inst.payload = Some(Payload::UpdateMetadata {
current_metadata: args.current_metadata,
update_args: args.update_args,
});
}
_ => {}
};
Expand Down Expand Up @@ -231,7 +248,7 @@ fn build_creator_verification_payload(

// See Bubblegum for offsets and positions:
// https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md#-verify_collection-unverify_collection-and-set_and_verify_collection
// NOTE: Unverfication does not include collection. This needs to be fixed in the README.
// This uses the account. The collection is only provided as an argument for `set_and_verify_collection`.
fn build_collection_verification_payload(
keys: &[plerkle_serialization::Pubkey],
verify: bool,
Expand Down

0 comments on commit f5f7a3d

Please sign in to comment.