diff --git a/Cargo.lock b/Cargo.lock index bc2c1440a..90e706291 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1007,9 +1007,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blockbuster" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f1609d0c1d6d7f6b48bc470fd067f0d55dfdf6d84f7651b4a42a9666421755" +checksum = "d084afd6dc16dfcf46124dfa75c1f9589aa51ae7b7823574dac246f545ca8391" dependencies = [ "anchor-lang", "async-trait", @@ -3429,9 +3429,9 @@ dependencies = [ [[package]] name = "mpl-core" -version = "0.3.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12ab13d9c75156048c3e6d57717ec3ece59fdcae195124bf1cec82aef5295fa" +checksum = "de7477a52a59fe4db051c6a83077319288e8bfbd1aaf8511d4f733e3a77b6d24" dependencies = [ "base64 0.22.0", "borsh 0.10.3", diff --git a/Cargo.toml b/Cargo.toml index be1226970..769cf02a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/integration_tests/tests/data/accounts/mpl_core_get_asset_with_edition/AejY8LGKAbQsrGZS1qgN4uFu99dJD3f8Js9Yrt7K3tCc b/integration_tests/tests/data/accounts/mpl_core_get_asset_with_edition/AejY8LGKAbQsrGZS1qgN4uFu99dJD3f8Js9Yrt7K3tCc new file mode 100644 index 000000000..9c8ce6f00 Binary files /dev/null and b/integration_tests/tests/data/accounts/mpl_core_get_asset_with_edition/AejY8LGKAbQsrGZS1qgN4uFu99dJD3f8Js9Yrt7K3tCc differ diff --git a/integration_tests/tests/integration_tests/mpl_core_tests.rs b/integration_tests/tests/integration_tests/mpl_core_tests.rs index 052771e9b..6b1acd48c 100644 --- a/integration_tests/tests/integration_tests/mpl_core_tests.rs +++ b/integration_tests/tests/integration_tests/mpl_core_tests.rs @@ -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); +} diff --git a/integration_tests/tests/integration_tests/snapshots/integration_tests__mpl_core_tests__mpl_core_get_asset_with_edition.snap b/integration_tests/tests/integration_tests/snapshots/integration_tests__mpl_core_tests__mpl_core_get_asset_with_edition.snap new file mode 100644 index 000000000..e85099bdd --- /dev/null +++ b/integration_tests/tests/integration_tests/snapshots/integration_tests__mpl_core_tests__mpl_core_get_asset_with_edition.snap @@ -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 + } +}