Skip to content

Commit 81d2991

Browse files
authored
Fix Bubblegum mintV2 (#254)
* Fix Bubblegum mintV2 blockbuster parsing * Remove existing V2 test data * Add some tests back * Fix one snapshot and add more tests * Add more tests back * Fix collection query of asset IDs * Add more tests and update test data * Update remaining Bubblegum V2 tests * Fix update_metadata_v2 tree parsing * Remove deprecated Ubuntu 20.04 runner from CI * Reorder some seeds for consistency
1 parent e1af38e commit 81d2991

File tree

121 files changed

+255
-200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+255
-200
lines changed

.github/workflows/build-api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
build-api:
2222
strategy:
2323
matrix:
24-
os: [ubuntu-20.04, ubuntu-22.04]
24+
os: [ubuntu-22.04]
2525
# This can be also be runned on self-hosted github runners
2626
runs-on: ["${{ matrix.os }}"]
2727

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ log = "0.4.17"
6767
metrics = "0.20.1"
6868
migration = { path = "migration" }
6969
mime_guess = "2.0.4"
70-
mpl-bubblegum = "2.0.0-beta.6"
70+
mpl-bubblegum = "2.0.0-beta.7"
7171
mpl-account-compression = "0.4.2"
7272
mpl-core = {version = "0.10.0-alpha.1", features = ["serde"]}
7373
mpl-noop = "0.2.1"

blockbuster/src/programs/bubblegum/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use log::warn;
99
use mpl_bubblegum::{
1010
get_instruction_type,
1111
instructions::{
12-
UnverifyCreatorInstructionArgs, UnverifyCreatorV2InstructionArgs,
12+
MintV2InstructionArgs, UnverifyCreatorInstructionArgs, UnverifyCreatorV2InstructionArgs,
1313
UpdateMetadataInstructionArgs, UpdateMetadataV2InstructionArgs,
1414
VerifyCreatorInstructionArgs, VerifyCreatorV2InstructionArgs,
1515
},
16-
types::{BubblegumEventType, MetadataArgs, MetadataArgsV2, UpdateArgs},
16+
types::{BubblegumEventType, MetadataArgs, UpdateArgs},
1717
};
1818
pub use mpl_bubblegum::{
1919
types::{LeafSchema, UseMethod},
@@ -369,7 +369,7 @@ fn build_update_metadata_payload(
369369
// See Bubblegum for offsets and positions:
370370
// https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md
371371
fn build_mint_v2_payload(keys: &[Pubkey], ix_data: &[u8]) -> Result<Payload, BlockbusterError> {
372-
let args: MetadataArgsV2 = MetadataArgsV2::try_from_slice(ix_data)?;
372+
let args: MintV2InstructionArgs = MintV2InstructionArgs::try_from_slice(ix_data)?;
373373

374374
let authority = *keys
375375
.first()
@@ -380,7 +380,7 @@ fn build_mint_v2_payload(keys: &[Pubkey], ix_data: &[u8]) -> Result<Payload, Blo
380380
.ok_or(BlockbusterError::InstructionParsingError)?;
381381

382382
Ok(Payload::Mint {
383-
args: args.into(),
383+
args: args.metadata.into(),
384384
authority,
385385
tree_id,
386386
})
@@ -420,7 +420,7 @@ fn build_creator_verification_v2_payload(
420420
.get(2)
421421
.ok_or(BlockbusterError::InstructionParsingError)?;
422422

423-
// Creator is optional in V2, None being signfied by the program ID.
423+
// Creator is optional in V2, None being signified by the program ID.
424424
// Creator defaults to the payer.
425425
let creator = if creator == mpl_bubblegum::ID {
426426
payer
@@ -444,7 +444,7 @@ fn build_update_metadata_v2_payload(
444444
let args = UpdateMetadataV2InstructionArgs::try_from_slice(ix_data)?;
445445

446446
let tree_id = *keys
447-
.get(8)
447+
.get(5)
448448
.ok_or(BlockbusterError::InstructionParsingError)?;
449449

450450
Ok(Payload::UpdateMetadata {
304 Bytes
Binary file not shown.
304 Bytes
Binary file not shown.
304 Bytes
Binary file not shown.
344 Bytes
Binary file not shown.
344 Bytes
Binary file not shown.
-344 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)