Skip to content

Commit f1a1ae6

Browse files
authored
Use latest mpl-core and mpl-bubblegum crates (#258)
* Update mpl-core and mpl-bubblegum to latest crates * Add test
1 parent 81d2991 commit f1a1ae6

File tree

6 files changed

+118
-6
lines changed

6 files changed

+118
-6
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ 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.7"
70+
mpl-bubblegum = "2.0.0"
7171
mpl-account-compression = "0.4.2"
72-
mpl-core = {version = "0.10.0-alpha.1", features = ["serde"]}
72+
mpl-core = {version = "0.10.0", features = ["serde"]}
7373
mpl-noop = "0.2.1"
7474
mpl-token-metadata = "4.1.1"
7575
nft_ingester = { path = "nft_ingester" }
344 Bytes
Binary file not shown.

integration_tests/tests/integration_tests/mpl_core_tests.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,3 +838,32 @@ async fn test_mpl_core_get_asset_with_data_section_with_msg_pack_data() {
838838
let response = setup.das_api.get_asset(request).await.unwrap();
839839
insta::assert_json_snapshot!(name, response);
840840
}
841+
842+
#[tokio::test]
843+
#[serial]
844+
#[named]
845+
async fn test_mpl_core_get_collection_with_bubblegum_v2_plugin() {
846+
let name = trim_test_name(function_name!());
847+
let setup = TestSetup::new_with_options(
848+
name.clone(),
849+
TestSetupOptions {
850+
network: Some(Network::Devnet),
851+
},
852+
)
853+
.await;
854+
855+
let seeds: Vec<SeedEvent> = seed_accounts(["5SW7HyPZx2vsVnA2vxxzAMZi51Tkc5v2LkXTxzx8ULAm"]);
856+
857+
apply_migrations_and_delete_data(setup.db.clone()).await;
858+
index_seed_events(&setup, seeds.iter().collect_vec()).await;
859+
860+
let request = r#"
861+
{
862+
"id": "5SW7HyPZx2vsVnA2vxxzAMZi51Tkc5v2LkXTxzx8ULAm"
863+
}
864+
"#;
865+
866+
let request: api::GetAsset = serde_json::from_str(request).unwrap();
867+
let response = setup.das_api.get_asset(request).await.unwrap();
868+
insta::assert_json_snapshot!(name, response);
869+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
source: integration_tests/tests/integration_tests/mpl_core_tests.rs
3+
assertion_line: 868
4+
expression: response
5+
---
6+
{
7+
"interface": "MplCoreCollection",
8+
"id": "5SW7HyPZx2vsVnA2vxxzAMZi51Tkc5v2LkXTxzx8ULAm",
9+
"content": {
10+
"$schema": "https://schema.metaplex.com/nft1.0.json",
11+
"json_uri": "https://example.com/collection.json",
12+
"files": [],
13+
"metadata": {
14+
"name": "Test Collection",
15+
"symbol": ""
16+
},
17+
"links": {}
18+
},
19+
"authorities": [
20+
{
21+
"address": "gvBpr3GF6BqNBYHsuv8bscJjQ8RMe2DF2AgDHSBXJmU",
22+
"scopes": [
23+
"full"
24+
]
25+
}
26+
],
27+
"compression": {
28+
"eligible": false,
29+
"compressed": false,
30+
"data_hash": "",
31+
"creator_hash": "",
32+
"asset_hash": "",
33+
"tree": "",
34+
"seq": 0,
35+
"leaf_id": 0
36+
},
37+
"grouping": [],
38+
"royalty": {
39+
"royalty_model": "creators",
40+
"target": null,
41+
"percent": 0.0,
42+
"basis_points": 0,
43+
"primary_sale_happened": false,
44+
"locked": false
45+
},
46+
"creators": [],
47+
"ownership": {
48+
"frozen": false,
49+
"delegated": false,
50+
"delegate": null,
51+
"ownership_model": "single",
52+
"owner": "gvBpr3GF6BqNBYHsuv8bscJjQ8RMe2DF2AgDHSBXJmU"
53+
},
54+
"mutable": true,
55+
"burnt": false,
56+
"plugins": {
57+
"bubblegum_v2": {
58+
"data": {},
59+
"index": 0,
60+
"offset": 108,
61+
"authority": {
62+
"type": "Address",
63+
"address": "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY"
64+
}
65+
},
66+
"permanent_burn_delegate": {
67+
"data": {},
68+
"index": 1,
69+
"offset": 109,
70+
"authority": {
71+
"type": "Address",
72+
"address": "E3BmcMqXbVNaneX7gZhShAPLXEUJCA9o6vP2zfqdCbr5"
73+
}
74+
}
75+
},
76+
"mpl_core_info": {
77+
"num_minted": 1,
78+
"current_size": 1,
79+
"plugins_json_version": 1
80+
},
81+
"external_plugins": []
82+
}

program_transformers/src/bubblegum/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ where
5959
InstructionName::SetDecompressibleState => "SetDecompressibleState",
6060
InstructionName::UpdateMetadata => "UpdateMetadata",
6161
InstructionName::BurnV2 => "BurnV2",
62+
InstructionName::CollectV2 => "CollectV2",
6263
InstructionName::CreateTreeV2 => "CreateTreeV2",
6364
InstructionName::DelegateAndFreezeV2 => "DelegateAndFreezeV2",
6465
InstructionName::DelegateV2 => "DelegateV2",

0 commit comments

Comments
 (0)