Skip to content

Commit

Permalink
Update blockbuster for mpl-core editions (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
danenbm authored Apr 15, 2024
1 parent 3ad7037 commit 127bfca
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 5 deletions.
8 changes: 4 additions & 4 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ anyhow = "1.0.75"
async-std = "1.0.0"
async-trait = "0.1.60"
backon = "0.4.1"
blockbuster = "2.2.0"
blockbuster = "2.2.1"
borsh = "~0.10.3"
borsh-derive = "~0.10.3"
bs58 = "0.4.0"
Expand Down
Binary file not shown.
29 changes: 29 additions & 0 deletions integration_tests/tests/integration_tests/mpl_core_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,32 @@ async fn test_mpl_core_get_assets_by_owner() {
let response = setup.das_api.get_assets_by_owner(request).await.unwrap();
insta::assert_json_snapshot!(name, response);
}

#[tokio::test]
#[serial]
#[named]
async fn test_mpl_core_get_asset_with_edition() {
let name = trim_test_name(function_name!());
let setup = TestSetup::new_with_options(
name.clone(),
TestSetupOptions {
network: Some(Network::Devnet),
},
)
.await;

let seeds: Vec<SeedEvent> = seed_accounts(["AejY8LGKAbQsrGZS1qgN4uFu99dJD3f8Js9Yrt7K3tCc"]);

apply_migrations_and_delete_data(setup.db.clone()).await;
index_seed_events(&setup, seeds.iter().collect_vec()).await;

let request = r#"
{
"id": "AejY8LGKAbQsrGZS1qgN4uFu99dJD3f8Js9Yrt7K3tCc"
}
"#;

let request: api::GetAsset = serde_json::from_str(request).unwrap();
let response = setup.das_api.get_asset(request).await.unwrap();
insta::assert_json_snapshot!(name, response);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
source: integration_tests/tests/integration_tests/mpl_core_tests.rs
assertion_line: 216
expression: response
---
{
"interface": "MplCoreAsset",
"id": "AejY8LGKAbQsrGZS1qgN4uFu99dJD3f8Js9Yrt7K3tCc",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://example.com/asset",
"files": [],
"metadata": {
"name": "Test Asset",
"symbol": ""
},
"links": {}
},
"authorities": [
{
"address": "APrZTeVysBJqAznfLXS71NAzjr2fCVTSF1A66MeErzM7",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.0,
"basis_points": 0,
"primary_sale_happened": false,
"locked": false
},
"creators": [],
"ownership": {
"frozen": false,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "APrZTeVysBJqAznfLXS71NAzjr2fCVTSF1A66MeErzM7"
},
"supply": null,
"mutable": true,
"burnt": false,
"plugins": {
"edition": {
"data": {
"number": 1
},
"index": 0,
"offset": 119,
"authority": {
"type": "UpdateAuthority",
"address": null
}
}
},
"mpl_core_info": {
"plugins_json_version": 1
}
}

0 comments on commit 127bfca

Please sign in to comment.