From 7da57b9698619e1d0a9eb0298e610ae0d57cdd79 Mon Sep 17 00:00:00 2001 From: n00m4d Date: Thu, 28 Nov 2024 14:08:15 +0100 Subject: [PATCH 1/8] feat: fix a few issues with cNFT assets --- entities/src/models.rs | 2 +- grpc/src/mapper.rs | 5 +- integration_tests/src/cnft_tests.rs | 7 +- integration_tests/src/common.rs | 16 ++- ...n_tests__cnft_tests__asset_decompress.snap | 20 ++- ...s__cnft_tests__cnft_owners_table-base.snap | 7 +- ...n_tests__cnft_tests__mint_no_json_uri.snap | 7 +- ...ration_tests__cnft_tests__mint_redeem.snap | 7 +- ...tests__cnft_tests__mint_transfer_noop.snap | 7 +- ...s__cnft_tests__mint_verify_collection.snap | 7 +- .../src/api/dapi/rpc_asset_convertors.rs | 126 +++++++++++------- .../account_based/mpl_core_processor.rs | 7 +- .../account_based/mplx_updates_processor.rs | 7 +- .../bubblegum_updates_processor.rs | 3 +- rocks-db/src/asset.rs | 14 +- rocks-db/src/migrations/external_plugins.rs | 4 +- rocks-db/src/migrations/spl2022.rs | 4 +- 17 files changed, 162 insertions(+), 88 deletions(-) diff --git a/entities/src/models.rs b/entities/src/models.rs index 3907e661e..170f98f01 100644 --- a/entities/src/models.rs +++ b/entities/src/models.rs @@ -128,7 +128,7 @@ pub struct CompleteAssetDetails { pub supply: Option>, pub seq: Option>, pub is_burnt: Updated, - pub was_decompressed: Updated, + pub was_decompressed: Option>, pub onchain_data: Option>, pub creators: Updated>, pub royalty_amount: Updated, diff --git a/grpc/src/mapper.rs b/grpc/src/mapper.rs index 02ab48dfa..be76d478e 100644 --- a/grpc/src/mapper.rs +++ b/grpc/src/mapper.rs @@ -47,7 +47,7 @@ impl From for AssetDetails { supply: value.supply.map(|v| v.into()), seq: value.seq.map(|v| v.into()), is_burnt: Some(value.is_burnt.into()), - was_decompressed: Some(value.was_decompressed.into()), + was_decompressed: value.was_decompressed.map(|v| v.into()), creators: Some(value.creators.into()), royalty_amount: Some(value.royalty_amount.into()), authority: Some(value.authority.into()), @@ -138,8 +138,7 @@ impl TryFrom for CompleteAssetDetails { .ok_or(GrpcError::MissingField("is_burnt".to_string()))?, was_decompressed: value .was_decompressed - .map(Into::into) - .ok_or(GrpcError::MissingField("was_decompressed".to_string()))?, + .map(Into::into), creators: value .creators .map(TryInto::try_into) diff --git a/integration_tests/src/cnft_tests.rs b/integration_tests/src/cnft_tests.rs index 918d1a11c..4bf7ada3c 100644 --- a/integration_tests/src/cnft_tests.rs +++ b/integration_tests/src/cnft_tests.rs @@ -275,7 +275,12 @@ async fn test_mint_redeem() { let seeds: Vec = seed_txns([ "55tQCoLUtHyu4i6Dny6SMdq4dVD61nuuLxXvRLeeQqE6xdm66Ajm4so39MXcJ2VaTmCNDEFBpitzLkiFaF7rNtHi", "4FQRV38NSP6gDo8qDbTBfy8UDHUd6Lzu4GXbHtfvWbtCArkVcbGQwinZ7M61eCmPEF5L8xu4tLAXL7ozbh5scfRi", - "3Ct9n9hv5PWEYbsrgDdUDqegzsnX2n5jYRxkq5YafFAueup8mTYmN4nHhNCaEwVyVAVqNssr4fizdg9wRavT7ydE", + // Purpose of this test is to check flow mint, redeem. But this last transaction is decompress. + // Doesn't make sense to execute it and also such as Aura node implementation is deleting data from asset leaf + // column family API response is different from expected, after parsing this last tx. + // For comparison reference implementation doesn't drop asset leaf data. + // Leave this signature hash here for future in case we need it. + // "3Ct9n9hv5PWEYbsrgDdUDqegzsnX2n5jYRxkq5YafFAueup8mTYmN4nHhNCaEwVyVAVqNssr4fizdg9wRavT7ydE", ]); run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; diff --git a/integration_tests/src/common.rs b/integration_tests/src/common.rs index 0d30c075c..5a725fd0b 100644 --- a/integration_tests/src/common.rs +++ b/integration_tests/src/common.rs @@ -442,7 +442,13 @@ pub async fn index_account_bytes(setup: &TestSetup, account_bytes: Vec) { let (_shutdown_tx, shutdown_rx) = broadcast::channel::<()>(1); setup .synchronizer - .synchronize_asset_indexes(&shutdown_rx, 1000) + .synchronize_nft_asset_indexes(&shutdown_rx, 1000) + .await + .unwrap(); + + setup + .synchronizer + .synchronize_fungible_asset_indexes(&shutdown_rx, 1000) .await .unwrap(); } @@ -519,7 +525,13 @@ pub async fn index_transaction(setup: &TestSetup, sig: Signature) { let (_shutdown_tx, shutdown_rx) = broadcast::channel::<()>(1); setup .synchronizer - .synchronize_asset_indexes(&shutdown_rx, 1000) + .synchronize_nft_asset_indexes(&shutdown_rx, 1000) + .await + .unwrap(); + + setup + .synchronizer + .synchronize_fungible_asset_indexes(&shutdown_rx, 1000) .await .unwrap(); } diff --git a/integration_tests/src/snapshots/integration_tests__cnft_tests__asset_decompress.snap b/integration_tests/src/snapshots/integration_tests__cnft_tests__asset_decompress.snap index adaf63596..ca04465a0 100644 --- a/integration_tests/src/snapshots/integration_tests__cnft_tests__asset_decompress.snap +++ b/integration_tests/src/snapshots/integration_tests__cnft_tests__asset_decompress.snap @@ -1,6 +1,8 @@ --- -source: integration_tests/tests/integration_tests/cnft_tests.rs +source: integration_tests/src/cnft_tests.rs +assertion_line: 41 expression: response +snapshot_kind: text --- { "interface": "V1_NFT", @@ -37,7 +39,8 @@ expression: response "grouping": [ { "group_key": "collection", - "group_value": "2MJeqBXcRmy3PXvQP5RRPqeig2CTfnXv5nGT3wRD1xW5" + "group_value": "2MJeqBXcRmy3PXvQP5RRPqeig2CTfnXv5nGT3wRD1xW5", + "verified": true } ], "royalty": { @@ -78,5 +81,16 @@ expression: response "edition_nonce": 253 }, "mutable": true, - "burnt": false + "burnt": false, + "lamports": 5616720, + "executable": false, + "metadata_owner": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", + "rent_epoch": 0, + "token_info": { + "supply": 1, + "decimals": 0, + "token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "mint_authority": "Efi1oabSQtJ2uNC83d6yjKW4Z94FuxoX9nYmadJFSRSe", + "freeze_authority": "Efi1oabSQtJ2uNC83d6yjKW4Z94FuxoX9nYmadJFSRSe" + } } diff --git a/integration_tests/src/snapshots/integration_tests__cnft_tests__cnft_owners_table-base.snap b/integration_tests/src/snapshots/integration_tests__cnft_tests__cnft_owners_table-base.snap index 048809c0d..5f3728cc4 100644 --- a/integration_tests/src/snapshots/integration_tests__cnft_tests__cnft_owners_table-base.snap +++ b/integration_tests/src/snapshots/integration_tests__cnft_tests__cnft_owners_table-base.snap @@ -1,6 +1,8 @@ --- -source: integration_tests/tests/integration_tests/cnft_tests.rs +source: integration_tests/src/cnft_tests.rs +assertion_line: 180 expression: response +snapshot_kind: text --- { "total": 1, @@ -42,7 +44,8 @@ expression: response "grouping": [ { "group_key": "collection", - "group_value": "STKM3PzeFc6kdJiMXyQ3pRDa3ERCEGgM9NbPPGb2Rft" + "group_value": "STKM3PzeFc6kdJiMXyQ3pRDa3ERCEGgM9NbPPGb2Rft", + "verified": true } ], "royalty": { diff --git a/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_no_json_uri.snap b/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_no_json_uri.snap index b166b6375..953926347 100644 --- a/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_no_json_uri.snap +++ b/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_no_json_uri.snap @@ -1,6 +1,8 @@ --- -source: integration_tests/tests/integration_tests/cnft_tests.rs +source: integration_tests/src/cnft_tests.rs +assertion_line: 41 expression: response +snapshot_kind: text --- { "interface": "V1_NFT", @@ -37,7 +39,8 @@ expression: response "grouping": [ { "group_key": "collection", - "group_value": "GG6KuiAjG4hhg2AYdtjSoCG1QesgRFjTaok5MLxmAF3k" + "group_value": "GG6KuiAjG4hhg2AYdtjSoCG1QesgRFjTaok5MLxmAF3k", + "verified": true } ], "royalty": { diff --git a/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_redeem.snap b/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_redeem.snap index 7e01ca6ed..d0e777d7c 100644 --- a/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_redeem.snap +++ b/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_redeem.snap @@ -1,6 +1,8 @@ --- -source: integration_tests/tests/integration_tests/cnft_tests.rs +source: integration_tests/src/cnft_tests.rs +assertion_line: 41 expression: response +snapshot_kind: text --- { "interface": "V1_NFT", @@ -37,7 +39,8 @@ expression: response "grouping": [ { "group_key": "collection", - "group_value": "2MJeqBXcRmy3PXvQP5RRPqeig2CTfnXv5nGT3wRD1xW5" + "group_value": "2MJeqBXcRmy3PXvQP5RRPqeig2CTfnXv5nGT3wRD1xW5", + "verified": true } ], "royalty": { diff --git a/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_transfer_noop.snap b/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_transfer_noop.snap index ba10ce477..c2083dfac 100644 --- a/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_transfer_noop.snap +++ b/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_transfer_noop.snap @@ -1,6 +1,8 @@ --- -source: integration_tests/tests/integration_tests/cnft_tests.rs +source: integration_tests/src/cnft_tests.rs +assertion_line: 41 expression: response +snapshot_kind: text --- { "interface": "V1_NFT", @@ -37,7 +39,8 @@ expression: response "grouping": [ { "group_key": "collection", - "group_value": "BwwjnxTHeVWdFieDWmoezta19q1NiwcNNyoon9S38bkM" + "group_value": "BwwjnxTHeVWdFieDWmoezta19q1NiwcNNyoon9S38bkM", + "verified": true } ], "royalty": { diff --git a/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_verify_collection.snap b/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_verify_collection.snap index 806741e32..9897cd283 100644 --- a/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_verify_collection.snap +++ b/integration_tests/src/snapshots/integration_tests__cnft_tests__mint_verify_collection.snap @@ -1,6 +1,8 @@ --- -source: integration_tests/tests/integration_tests/cnft_tests.rs +source: integration_tests/src/cnft_tests.rs +assertion_line: 41 expression: response +snapshot_kind: text --- { "interface": "V1_NFT", @@ -37,7 +39,8 @@ expression: response "grouping": [ { "group_key": "collection", - "group_value": "4zapNXifB7Lz5XGUtsYQ3gsEujK2dqFw4mE9NY57NrtD" + "group_value": "4zapNXifB7Lz5XGUtsYQ3gsEujK2dqFw4mE9NY57NrtD", + "verified": true } ], "royalty": { diff --git a/nft_ingester/src/api/dapi/rpc_asset_convertors.rs b/nft_ingester/src/api/dapi/rpc_asset_convertors.rs index c8cf247b2..1126eef6b 100644 --- a/nft_ingester/src/api/dapi/rpc_asset_convertors.rs +++ b/nft_ingester/src/api/dapi/rpc_asset_convertors.rs @@ -367,7 +367,8 @@ pub fn asset_to_rpc( &full_asset .asset_dynamic .onchain_data - .map(|onchain_data| onchain_data.value) + .as_ref() + .map(|onchain_data| onchain_data.value.clone()) .unwrap_or_default(), ) .unwrap_or(serde_json::Value::Null); @@ -381,29 +382,36 @@ pub fn asset_to_rpc( let mpl_core_info = match interface { Interface::MplCoreAsset | Interface::MplCoreCollection => Some(MplCoreInfo { - num_minted: full_asset.asset_dynamic.num_minted.map(|u| u.value), - current_size: full_asset.asset_dynamic.current_size.map(|u| u.value), + num_minted: full_asset.asset_dynamic.num_minted.as_ref().map(|u| u.value), + current_size: full_asset.asset_dynamic.current_size.as_ref().map(|u| u.value), plugins_json_version: full_asset .asset_dynamic .plugins_json_version + .as_ref() .map(|u| u.value), }), _ => None, }; let supply = match interface { - Interface::V1NFT => full_asset.edition_data.map(|e| Supply { - edition_nonce, - print_current_supply: e.supply, - print_max_supply: e.max_supply, - edition_number: e.edition_number, - }), + Interface::V1NFT => { + if let Some(edition_info) = &full_asset.edition_data { + Some(Supply { + edition_nonce, + print_current_supply: edition_info.supply, + print_max_supply: edition_info.max_supply, + edition_number: edition_info.edition_number, + }) + } else { + Some(Supply{ + edition_nonce, + print_current_supply: 0, + print_max_supply: Some(0), + edition_number: None, + }) + } + }, _ => None, }; - let tree = if full_asset.asset_leaf.tree_id == Pubkey::default() { - None - } else { - Some(full_asset.asset_leaf.tree_id.to_bytes().to_vec()) - }; Ok(Some(RpcAsset { interface, @@ -417,38 +425,7 @@ pub fn asset_to_rpc( .map(|m| m.value.into()) .unwrap_or(ChainMutability::Unknown) .into(), - compression: Some(Compression { - eligible: full_asset.asset_dynamic.is_compressible.value, - compressed: full_asset.asset_dynamic.is_compressed.value, - leaf_id: full_asset.asset_leaf.nonce.unwrap_or(0) as i64, - seq: std::cmp::max( - full_asset - .asset_dynamic - .seq - .clone() - .and_then(|u| u.value.try_into().ok()) - .unwrap_or(0) as i64, - full_asset.asset_leaf.leaf_seq.unwrap_or(0) as i64, - ), - tree: tree - .map(|s| bs58::encode(s).into_string()) - .unwrap_or_default(), - asset_hash: full_asset - .asset_leaf - .leaf - .map(|s| bs58::encode(s).into_string()) - .unwrap_or_default(), - data_hash: full_asset - .asset_leaf - .data_hash - .map(|e| e.to_string()) - .unwrap_or_default(), - creator_hash: full_asset - .asset_leaf - .creator_hash - .map(|e| e.to_string()) - .unwrap_or_default(), - }), + compression: Some(get_compression_info(&full_asset)), grouping, royalty: Some(Royalty { royalty_model: full_asset.asset_static.royalty_target_type.into(), @@ -547,6 +524,63 @@ pub fn asset_to_rpc( })) } +pub fn get_compression_info(full_asset: &FullAsset) -> Compression { + let tree = if full_asset.asset_leaf.tree_id == Pubkey::default() { + None + } else { + Some(full_asset.asset_leaf.tree_id.to_bytes().to_vec()) + }; + + if let Some(was_decompressed) = &full_asset.asset_dynamic.was_decompressed { + if was_decompressed.value { + return Compression { + eligible: false, + compressed: false, + data_hash: "".to_string(), + creator_hash: "".to_string(), + asset_hash: "".to_string(), + tree: "".to_string(), + seq: 0, + leaf_id: 0, + }; + } + } + + Compression { + eligible: full_asset.asset_dynamic.is_compressible.value, + compressed: full_asset.asset_dynamic.is_compressed.value, + leaf_id: full_asset.asset_leaf.nonce.unwrap_or(0) as i64, + seq: std::cmp::max( + full_asset + .asset_dynamic + .seq + .clone() + .and_then(|u| u.value.try_into().ok()) + .unwrap_or(0) as i64, + full_asset.asset_leaf.leaf_seq.unwrap_or(0) as i64, + ), + tree: tree + .map(|s| bs58::encode(s).into_string()) + .unwrap_or_default(), + asset_hash: full_asset + .asset_leaf + .leaf + .as_ref() + .map(|s| bs58::encode(s).into_string()) + .unwrap_or_default(), + data_hash: full_asset + .asset_leaf + .data_hash + .map(|e| e.to_string()) + .unwrap_or_default(), + creator_hash: full_asset + .asset_leaf + .creator_hash + .map(|e| e.to_string()) + .unwrap_or_default(), + } +} + pub fn build_transaction_signatures_response( signatures: AssetSignatureWithPagination, limit: u64, diff --git a/nft_ingester/src/processors/account_based/mpl_core_processor.rs b/nft_ingester/src/processors/account_based/mpl_core_processor.rs index a3f2729a8..0b3f8bb81 100644 --- a/nft_ingester/src/processors/account_based/mpl_core_processor.rs +++ b/nft_ingester/src/processors/account_based/mpl_core_processor.rs @@ -330,11 +330,8 @@ impl MplCoreProcessor { Some(UpdateVersion::WriteVersion(account_data.write_version)), false, ), - was_decompressed: Updated::new( - account_data.slot_updated, - Some(UpdateVersion::WriteVersion(account_data.write_version)), - false, - ), + // should not set this value for Core assets + was_decompressed: None, onchain_data: Some(Updated::new( account_data.slot_updated, Some(UpdateVersion::WriteVersion(account_data.write_version)), diff --git a/nft_ingester/src/processors/account_based/mplx_updates_processor.rs b/nft_ingester/src/processors/account_based/mplx_updates_processor.rs index d98951bb2..8967bc12c 100644 --- a/nft_ingester/src/processors/account_based/mplx_updates_processor.rs +++ b/nft_ingester/src/processors/account_based/mplx_updates_processor.rs @@ -161,11 +161,8 @@ impl MplxAccountsProcessor { false, ), seq: None, - was_decompressed: Updated::new( - metadata_info.slot_updated, - Some(UpdateVersion::WriteVersion(metadata_info.write_version)), - false, - ), + // should not set this value for regular NFT updates + was_decompressed: None, onchain_data: Some(Updated::new( metadata_info.slot_updated, Some(UpdateVersion::WriteVersion(metadata_info.write_version)), diff --git a/nft_ingester/src/processors/transaction_based/bubblegum_updates_processor.rs b/nft_ingester/src/processors/transaction_based/bubblegum_updates_processor.rs index 415cd0c5b..da2571826 100644 --- a/nft_ingester/src/processors/transaction_based/bubblegum_updates_processor.rs +++ b/nft_ingester/src/processors/transaction_based/bubblegum_updates_processor.rs @@ -742,9 +742,10 @@ impl BubblegumTxProcessor { pk: *asset_id, details: AssetDynamicDetails { pubkey: *asset_id, - was_decompressed: Updated::new(bundle.slot, None, true), + was_decompressed: Some(Updated::new(bundle.slot, None, true)), is_compressible: Updated::new(bundle.slot, None, false), supply: Some(Updated::new(bundle.slot, None, 1)), + seq: Some(Updated::new(bundle.slot, None, 0)), ..Default::default() }, } diff --git a/rocks-db/src/asset.rs b/rocks-db/src/asset.rs index e2dc6a83e..f49e96a66 100644 --- a/rocks-db/src/asset.rs +++ b/rocks-db/src/asset.rs @@ -142,7 +142,7 @@ impl<'a> From> for AssetDynamicDetails { let supply = value.supply().map(updated_u64_from_fb); let seq = value.seq().map(updated_u64_from_fb); let is_burnt = value.is_burnt().map(updated_bool_from_fb).unwrap(); - let was_decompressed = value.was_decompressed().map(updated_bool_from_fb).unwrap(); + let was_decompressed = value.was_decompressed().map(updated_bool_from_fb); let onchain_data = value.onchain_data().and_then(updated_string_from_fb); let creators = value.creators().map(updated_creators_from_fb).unwrap(); let royalty_amount = value.royalty_amount().map(updated_u16_from_fb).unwrap(); @@ -424,7 +424,7 @@ fn asset_dynamic_details_to_fb<'a>( .as_ref() .map(|seq| updated_u64_to_fb(builder, seq)); let is_burnt_fb = updated_bool_to_fb(builder, &dynamic_details.is_burnt); - let was_decompressed_fb = updated_bool_to_fb(builder, &dynamic_details.was_decompressed); + let was_decompressed_fb = dynamic_details.was_decompressed.as_ref().map(|was_dec| updated_bool_to_fb(builder, was_dec)); let onchain_data_fb = dynamic_details .onchain_data .as_ref() @@ -502,7 +502,7 @@ fn asset_dynamic_details_to_fb<'a>( supply: supply_fb, seq: seq_fb, is_burnt: Some(is_burnt_fb), - was_decompressed: Some(was_decompressed_fb), + was_decompressed: was_decompressed_fb, onchain_data: onchain_data_fb, creators: Some(creators_fb), royalty_amount: Some(royalty_amount_fb), @@ -1144,7 +1144,7 @@ pub struct AssetDynamicDetails { pub supply: Option>, pub seq: Option>, pub is_burnt: Updated, - pub was_decompressed: Updated, + pub was_decompressed: Option>, pub onchain_data: Option>, pub creators: Updated>, pub royalty_amount: Updated, @@ -3028,7 +3028,7 @@ impl AssetDynamicDetails { update_field(&mut self.is_burnt, &new_val.is_burnt); update_field(&mut self.creators, &new_val.creators); update_field(&mut self.royalty_amount, &new_val.royalty_amount); - update_field(&mut self.was_decompressed, &new_val.was_decompressed); + update_optional_field(&mut self.was_decompressed, &new_val.was_decompressed); update_optional_field(&mut self.onchain_data, &new_val.onchain_data); update_field(&mut self.url, &new_val.url); update_optional_field(&mut self.chain_mutability, &new_val.chain_mutability); @@ -3103,7 +3103,7 @@ impl AssetDynamicDetails { self.supply.clone().map_or(0, |supply| supply.slot_updated), self.seq.clone().map_or(0, |seq| seq.slot_updated), self.is_burnt.slot_updated, - self.was_decompressed.slot_updated, + self.was_decompressed.clone().map_or(0, |was_decompressed| was_decompressed.slot_updated), self.onchain_data .clone() .map_or(0, |onchain_data| onchain_data.slot_updated), @@ -3553,7 +3553,7 @@ mod tests { supply: Some(Updated::new(50, None, 1)), seq: Some(Updated::new(580, Some(UpdateVersion::Sequence(530)), 530)), is_burnt: Updated::new(50, None, false), - was_decompressed: Updated::new(50, None, false), + was_decompressed: Some(Updated::new(50, None, false)), onchain_data: Some(Updated::new( 50, Some(UpdateVersion::Sequence(530)), diff --git a/rocks-db/src/migrations/external_plugins.rs b/rocks-db/src/migrations/external_plugins.rs index b7a8babac..13eebaa4a 100644 --- a/rocks-db/src/migrations/external_plugins.rs +++ b/rocks-db/src/migrations/external_plugins.rs @@ -18,7 +18,7 @@ pub struct AssetDynamicDetailsV0 { pub supply: Option>, pub seq: Option>, pub is_burnt: Updated, - pub was_decompressed: Updated, + pub was_decompressed: Option>, pub onchain_data: Option>, pub creators: Updated>, pub royalty_amount: Updated, @@ -101,7 +101,7 @@ impl AssetDynamicDetailsV0 { update_field(&mut current_val.is_burnt, &new_val.is_burnt); update_field(&mut current_val.creators, &new_val.creators); update_field(&mut current_val.royalty_amount, &new_val.royalty_amount); - update_field(&mut current_val.was_decompressed, &new_val.was_decompressed); + update_optional_field(&mut current_val.was_decompressed, &new_val.was_decompressed); update_optional_field(&mut current_val.onchain_data, &new_val.onchain_data); update_field(&mut current_val.url, &new_val.url); update_optional_field( diff --git a/rocks-db/src/migrations/spl2022.rs b/rocks-db/src/migrations/spl2022.rs index e99dadcaf..3af41a1ca 100644 --- a/rocks-db/src/migrations/spl2022.rs +++ b/rocks-db/src/migrations/spl2022.rs @@ -52,7 +52,7 @@ pub struct AssetDynamicDetailsWithoutExtentions { pub supply: Option>, pub seq: Option>, pub is_burnt: Updated, - pub was_decompressed: Updated, + pub was_decompressed: Option>, pub onchain_data: Option>, pub creators: Updated>, pub royalty_amount: Updated, @@ -119,7 +119,7 @@ impl AssetDynamicDetailsWithoutExtentions { update_field(&mut current_val.is_burnt, &new_val.is_burnt); update_field(&mut current_val.creators, &new_val.creators); update_field(&mut current_val.royalty_amount, &new_val.royalty_amount); - update_field(&mut current_val.was_decompressed, &new_val.was_decompressed); + update_optional_field(&mut current_val.was_decompressed, &new_val.was_decompressed); update_optional_field(&mut current_val.onchain_data, &new_val.onchain_data); update_field(&mut current_val.url, &new_val.url); update_optional_field( From 1c7a2e969ef5362747e96c8d4ab3260bc7e90312 Mon Sep 17 00:00:00 2001 From: n00m4d Date: Thu, 28 Nov 2024 21:35:08 +0100 Subject: [PATCH 2/8] feat: comments fixes --- grpc/src/mapper.rs | 2 +- .../src/api/dapi/rpc_asset_convertors.rs | 17 ++++------------- nft_ingester/src/api/dapi/rpc_asset_models.rs | 6 +++--- rocks-db/src/asset.rs | 16 ++++++++-------- 4 files changed, 16 insertions(+), 25 deletions(-) diff --git a/grpc/src/mapper.rs b/grpc/src/mapper.rs index be76d478e..4ce799624 100644 --- a/grpc/src/mapper.rs +++ b/grpc/src/mapper.rs @@ -47,7 +47,7 @@ impl From for AssetDetails { supply: value.supply.map(|v| v.into()), seq: value.seq.map(|v| v.into()), is_burnt: Some(value.is_burnt.into()), - was_decompressed: value.was_decompressed.map(|v| v.into()), + was_decompressed: value.was_decompressed.map(Into::into), creators: Some(value.creators.into()), royalty_amount: Some(value.royalty_amount.into()), authority: Some(value.authority.into()), diff --git a/nft_ingester/src/api/dapi/rpc_asset_convertors.rs b/nft_ingester/src/api/dapi/rpc_asset_convertors.rs index 1126eef6b..e970c1094 100644 --- a/nft_ingester/src/api/dapi/rpc_asset_convertors.rs +++ b/nft_ingester/src/api/dapi/rpc_asset_convertors.rs @@ -533,31 +533,22 @@ pub fn get_compression_info(full_asset: &FullAsset) -> Compression { if let Some(was_decompressed) = &full_asset.asset_dynamic.was_decompressed { if was_decompressed.value { - return Compression { - eligible: false, - compressed: false, - data_hash: "".to_string(), - creator_hash: "".to_string(), - asset_hash: "".to_string(), - tree: "".to_string(), - seq: 0, - leaf_id: 0, - }; + return Compression::default(); } } Compression { eligible: full_asset.asset_dynamic.is_compressible.value, compressed: full_asset.asset_dynamic.is_compressed.value, - leaf_id: full_asset.asset_leaf.nonce.unwrap_or(0) as i64, + leaf_id: full_asset.asset_leaf.nonce.unwrap_or(0), seq: std::cmp::max( full_asset .asset_dynamic .seq .clone() .and_then(|u| u.value.try_into().ok()) - .unwrap_or(0) as i64, - full_asset.asset_leaf.leaf_seq.unwrap_or(0) as i64, + .unwrap_or(0), + full_asset.asset_leaf.leaf_seq.unwrap_or(0), ), tree: tree .map(|s| bs58::encode(s).into_string()) diff --git a/nft_ingester/src/api/dapi/rpc_asset_models.rs b/nft_ingester/src/api/dapi/rpc_asset_models.rs index f851d5211..efb6fef47 100644 --- a/nft_ingester/src/api/dapi/rpc_asset_models.rs +++ b/nft_ingester/src/api/dapi/rpc_asset_models.rs @@ -131,7 +131,7 @@ pub struct Authority { pub scopes: Vec, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema, Default)] pub struct Compression { pub eligible: bool, pub compressed: bool, @@ -139,8 +139,8 @@ pub struct Compression { pub creator_hash: String, pub asset_hash: String, pub tree: String, - pub seq: i64, - pub leaf_id: i64, + pub seq: u64, + pub leaf_id: u64, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] diff --git a/rocks-db/src/asset.rs b/rocks-db/src/asset.rs index f49e96a66..2a8f9d965 100644 --- a/rocks-db/src/asset.rs +++ b/rocks-db/src/asset.rs @@ -3100,26 +3100,26 @@ impl AssetDynamicDetails { self.is_compressible.slot_updated, self.is_compressed.slot_updated, self.is_frozen.slot_updated, - self.supply.clone().map_or(0, |supply| supply.slot_updated), - self.seq.clone().map_or(0, |seq| seq.slot_updated), + self.supply.as_ref().map_or(0, |supply| supply.slot_updated), + self.seq.as_ref().map_or(0, |seq| seq.slot_updated), self.is_burnt.slot_updated, - self.was_decompressed.clone().map_or(0, |was_decompressed| was_decompressed.slot_updated), + self.was_decompressed.as_ref().map_or(0, |was_decompressed| was_decompressed.slot_updated), self.onchain_data - .clone() + .as_ref() .map_or(0, |onchain_data| onchain_data.slot_updated), self.creators.slot_updated, self.royalty_amount.slot_updated, self.chain_mutability - .clone() + .as_ref() .map_or(0, |onchain_data| onchain_data.slot_updated), self.lamports - .clone() + .as_ref() .map_or(0, |onchain_data| onchain_data.slot_updated), self.executable - .clone() + .as_ref() .map_or(0, |onchain_data| onchain_data.slot_updated), self.metadata_owner - .clone() + .as_ref() .map_or(0, |onchain_data| onchain_data.slot_updated), ] .into_iter() From c92cad7e7736fa95b58072add7a37bc1929497a8 Mon Sep 17 00:00:00 2001 From: Vadim <31490938+n00m4d@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:29:07 +0100 Subject: [PATCH 3/8] feat: add new 2 test cases for cNFT (#328) --- integration_tests/src/cnft_tests.rs | 185 ++++++++++++++++-- integration_tests/src/common.rs | 2 +- ...tLKXYE84jWzm7AC4G1fpa831GaXuXcn5n5ybWqB4e5 | Bin 0 -> 3792 bytes ...nyBHXJnf7PdqebGNsSTwx6CEWpDCP5oLoCDcmbP35B | Bin 0 -> 5560 bytes ...5kbvaqD2gyeHbdja1f22ypmzouRNpuo6sbyGDSSgya | Bin 0 -> 3824 bytes ...tvM8P16WouCZtnkhRCyKyQHSgHKyTY92t9aq2tyLdd | Bin 0 -> 3824 bytes ...Z6jeuN9w5jZvKrduMDu4zKyQU7A3JtswhKxE3hjKBk | Bin 0 -> 5032 bytes ...int_to_collection_unverify_collection.snap | 80 ++++++++ ...verify_collection_unverify_collection.snap | 80 ++++++++ 9 files changed, 333 insertions(+), 14 deletions(-) create mode 100644 integration_tests/src/data/transactions/mint_to_collection_unverify_collection/7nK9a2DSDZ4Gh6DatmxGJmuLiDEswaY9bYSSPTtQppk7PtLKXYE84jWzm7AC4G1fpa831GaXuXcn5n5ybWqB4e5 create mode 100644 integration_tests/src/data/transactions/mint_to_collection_unverify_collection/tzXASugk8578bmtA3JAFQLEfcVQp3Np3rU9fyFas2Svk8nyBHXJnf7PdqebGNsSTwx6CEWpDCP5oLoCDcmbP35B create mode 100644 integration_tests/src/data/transactions/mint_verify_collection_unverify_collection/4hQQsDKgDx5PpZR7nGvxKsLSvX4J7voaiJC3ag7dPuu4HY5kbvaqD2gyeHbdja1f22ypmzouRNpuo6sbyGDSSgya create mode 100644 integration_tests/src/data/transactions/mint_verify_collection_unverify_collection/5k71fZRpRagY45ZYu13Q8C3Bmw6KFPBkRmbBx2NuYk7roVtvM8P16WouCZtnkhRCyKyQHSgHKyTY92t9aq2tyLdd create mode 100644 integration_tests/src/data/transactions/mint_verify_collection_unverify_collection/5uWXt8JAhuP2XQ2nYJTq8Ndp34fdG3vmJ7DJnb3bE6iyrZZ6jeuN9w5jZvKrduMDu4zKyQU7A3JtswhKxE3hjKBk create mode 100644 integration_tests/src/snapshots/integration_tests__cnft_tests__mint_to_collection_unverify_collection.snap create mode 100644 integration_tests/src/snapshots/integration_tests__cnft_tests__mint_verify_collection_unverify_collection.snap diff --git a/integration_tests/src/cnft_tests.rs b/integration_tests/src/cnft_tests.rs index 4bf7ada3c..861e7e771 100644 --- a/integration_tests/src/cnft_tests.rs +++ b/integration_tests/src/cnft_tests.rs @@ -18,6 +18,7 @@ pub async fn run_get_asset_scenario_test( asset_id: &str, seeds: Vec, order: Order, + options: Options, ) { let seed_permutations: Vec> = match order { Order::AllPermutations => seeds.iter().permutations(seeds.len()).collect::>(), @@ -30,7 +31,7 @@ pub async fn run_get_asset_scenario_test( index_seed_events(setup, events).await; let request = GetAsset { id: asset_id.to_string(), - options: Options::default(), + options: options.clone(), }; let response = setup @@ -70,7 +71,14 @@ async fn test_asset_decompress() { seed_nft("Az9QTysJj1LW1F7zkYF21HgBj3FRpq3zpxTFdPnAJYm8"), ]; - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -96,7 +104,14 @@ async fn test_cnft_scenario_mint_update_metadata() { seed_txn("3bsL5zmLKvhN9Je4snTKxjFSpmXEEg2cvMHm2rCNgaEYkNXBqJTA4N7QmvBSWPiNUQPtzJSYzpQYX92NowV3L7vN"), ]; - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -124,7 +139,14 @@ async fn test_cnft_scenario_mint_update_metadata_remove_creators() { seed_txn("41YW187sn6Z2dXfqz6zSbnPtQoE826cCSgTLnMLKa9rH1xrCqAXBQNwKnzjGc9wjU5RtMCqKhy2eMN2TjuYC8veB"), ]; - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -202,6 +224,7 @@ async fn test_mint_no_json_uri() { "DFRJ4PwAze1mMQccRmdyc46yQpEVd4FPiwtAVgzGCs7g", seeds, Order::Forward, + Options::default(), ) .await; } @@ -228,7 +251,14 @@ async fn test_mint_delegate_transfer() { "5Q8TAMMkMTHEM2BHyD2fp2sVdYKByFeATzM2mHF6Xbbar33WaeuygPKGYCWiDEt3MZU1mUrq1ePnT9o4Pa318p8w", ]); - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -253,7 +283,14 @@ async fn test_mint_redeem_cancel_redeem() { "32FpSe6r9jnFNjjvbx2PPQdZqs5KpMoF6yawiRW1F6ctu1kmx2B4sLDBGjsthVQtmnhaJVrqdtmUP893FwXCbqY5", ]); - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -283,7 +320,14 @@ async fn test_mint_redeem() { // "3Ct9n9hv5PWEYbsrgDdUDqegzsnX2n5jYRxkq5YafFAueup8mTYmN4nHhNCaEwVyVAVqNssr4fizdg9wRavT7ydE", ]); - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -308,7 +352,14 @@ async fn test_mint_transfer_burn() { "KHNhLijkAMeKeKm6kpbk3go6q9uMF3zmfCoYSBgERe8qJDW8q5ANpnkyBuyVkychXCeWzRY8i5EtKfeGaDDU23w", ]); - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -333,7 +384,14 @@ async fn test_mint_transfer_noop() { "5bNyZfmxLVP9cKc6GjvozExrSt4F1QFt4PP992pQwT8FFHdWsX3ZFNvwurfU2xpDYtQ7qAUxVahGCraXMevRH8p1", ]); - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -358,7 +416,14 @@ async fn test_mint_transfer_transfer() { "34xjcNf3rZFKz381hKpFLqxpojaDgXEpCqH5qcpTXLaJnDbtqRz35wiuMF1cAgvJGLzYYrwaMvCK1D7LxYsdpMU1", ]); - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -382,7 +447,14 @@ async fn test_mint_verify_creator() { "4xrw5UwQSxxPzVxge6fbtmgLNsT2amaGrwpZFE95peRbnHGpxWtS2fF7whXW2xma4i2KDXdneztJZCAtgGZKTw11", ]); - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -406,7 +478,14 @@ async fn test_mint_verify_collection() { "5ZKjPxm3WAZzuqqkCDjgKpm9b5XjB9cuvv68JvXxWThvJaJxcMJgpSbYs4gDA9dGJyeLzsgNtnS6oubANF1KbBmt", ]); - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; } #[tokio::test] @@ -431,5 +510,85 @@ async fn test_mint_transfer_mpl_programs() { "T571TWE76frw6mWxYoHDrTdxYq7hJSyCtVEG4qmemPPtsc1CCKdknn9rTMAVcdeukLfwB1G97LZLH8eHLvuByoA", ]); - run_get_asset_scenario_test(&setup, asset_id, seeds, Order::AllPermutations).await; + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options::default(), + ) + .await; +} + +#[tokio::test] +#[serial] +#[named] +async fn test_mint_to_collection_unverify_collection() { + let name = trim_test_name(function_name!()); + let setup = TestSetup::new_with_options( + name.clone(), + TestSetupOptions { + network: Some(Network::Devnet), + clear_db: true, + }, + ) + .await; + + let asset_id = "2gEbvG3Cb6JRaGWAx5e85Bf5z4u37EURBeyPBqXDzZoY"; + + let seeds: Vec = seed_txns([ + "tzXASugk8578bmtA3JAFQLEfcVQp3Np3rU9fyFas2Svk8nyBHXJnf7PdqebGNsSTwx6CEWpDCP5oLoCDcmbP35B", + "7nK9a2DSDZ4Gh6DatmxGJmuLiDEswaY9bYSSPTtQppk7PtLKXYE84jWzm7AC4G1fpa831GaXuXcn5n5ybWqB4e5", + ]); + + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options { + show_unverified_collections: true, + show_collection_metadata: false, + show_inscription: false, + show_fungible: false, + }, + ) + .await; +} + +#[tokio::test] +#[serial] +#[named] +async fn test_mint_verify_collection_unverify_collection() { + let name = trim_test_name(function_name!()); + let setup = TestSetup::new_with_options( + name.clone(), + TestSetupOptions { + network: Some(Network::Devnet), + clear_db: true, + }, + ) + .await; + + let asset_id = "BiHHJ1gKV4exTjPe7PE6aydgMVqRUzzz8aeWYCGhZJ4s"; + + let seeds: Vec = seed_txns([ + "5uWXt8JAhuP2XQ2nYJTq8Ndp34fdG3vmJ7DJnb3bE6iyrZZ6jeuN9w5jZvKrduMDu4zKyQU7A3JtswhKxE3hjKBk", + "4hQQsDKgDx5PpZR7nGvxKsLSvX4J7voaiJC3ag7dPuu4HY5kbvaqD2gyeHbdja1f22ypmzouRNpuo6sbyGDSSgya", + "5k71fZRpRagY45ZYu13Q8C3Bmw6KFPBkRmbBx2NuYk7roVtvM8P16WouCZtnkhRCyKyQHSgHKyTY92t9aq2tyLdd", + ]); + + run_get_asset_scenario_test( + &setup, + asset_id, + seeds, + Order::AllPermutations, + Options { + show_unverified_collections: true, + show_collection_metadata: false, + show_inscription: false, + show_fungible: false, + }, + ) + .await; } diff --git a/integration_tests/src/common.rs b/integration_tests/src/common.rs index 5a725fd0b..9edd93645 100644 --- a/integration_tests/src/common.rs +++ b/integration_tests/src/common.rs @@ -35,7 +35,6 @@ use tokio::{ }; use usecase::proofs::MaybeProofChecker; -use tracing::{error, info}; use serde::de::DeserializeOwned; use solana_account_decoder::{UiAccount, UiAccountEncoding}; use solana_client::{ @@ -51,6 +50,7 @@ use solana_sdk::{ }; use solana_transaction_status::{EncodedConfirmedTransactionWithStatusMeta, UiTransactionEncoding}; use std::{fmt, time::Duration}; +use tracing::{error, info}; use std::path::PathBuf; diff --git a/integration_tests/src/data/transactions/mint_to_collection_unverify_collection/7nK9a2DSDZ4Gh6DatmxGJmuLiDEswaY9bYSSPTtQppk7PtLKXYE84jWzm7AC4G1fpa831GaXuXcn5n5ybWqB4e5 b/integration_tests/src/data/transactions/mint_to_collection_unverify_collection/7nK9a2DSDZ4Gh6DatmxGJmuLiDEswaY9bYSSPTtQppk7PtLKXYE84jWzm7AC4G1fpa831GaXuXcn5n5ybWqB4e5 new file mode 100644 index 0000000000000000000000000000000000000000..48d77a3b6e6ad2aa8ad3afcbf81ebd76953e7003 GIT binary patch literal 3792 zcmb_f30Mm4kdOgU2n1pXU?32VdQFna0l8-)0S{c4>UvSF zSaeHO6mP|9)#Xz0+}De{Ti> z?QIYk0Uw+I6ZRfpkbQ9g@U}mV?hC*OX8J72m0f4I~8sKVsOM?SfFABw3daY||P*Xtn@V8gVQb z72xTXbh)0R=j6)LOi^rt1E46V6##`VY&JN!_`(Hx-XD%H+5)o1EUDVACR4`Uk*{yg zA)JuRh}`?N(!og4uf?{zkG@zv%lDs8r21OFBVI^T-QOc8RaNdAytlj}ddI=_;dvJ< z&Y=ZkJ+NC>>yLm;);HgxHG>I7R`a;IvXvUB1p;+jwzB9 z+8t_&GLm6|fjWZ1jatGwL2l5|^bWv*;owkx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fz?F!QCI~}< z0HEus!?$+cQ5L0=Fe4I89ubDHfM56b$r_cK(iupqg9!?JyVLOGlx8;ZmH@tgkB=}k z2z$ro(eLo2C_)GQ3eBSoh*G1~LNnVfhooR+cY2|oq|6qm2px!I!l=dN1Z_K{>l*Xk z)JsRqSuo~ZYpypr*>NoVQ8~>CW?{j9a87r(kN)U1$*k5?!mKc{FnJc5EaRnRXC&!@ zb7gs1vJf1TQ5+PrqGV^yc0E&iv%j-u(GWH)R{BigvQZAZn~5Ogop`5*AyF2YOiQRN zI;10|B?N^;8?;)&o(T4={(by=qg&Vbk9$Xc*L+LW&nCrr@QQ zTWj5`i5yHhO1|3R;z-f?y_%yzi5KpyuZeZd^mukCaJAx|bK!|c<%cKOwz_03^x5)! z&EYT6nAca9H5IFzk3C3T>HmG4;LL+*lfyQB?9OXQ6mIxrPific+O^9T{F=)dt=T_< znwjzA(WRr(&w4eg|KdN2<6G`>Y|9qc0I!E@PWo0cx8`S_p1OM(+x2r}u&O^qMjJLg#EGrVrTb?$HZLh)<> literal 0 HcmV?d00001 diff --git a/integration_tests/src/data/transactions/mint_to_collection_unverify_collection/tzXASugk8578bmtA3JAFQLEfcVQp3Np3rU9fyFas2Svk8nyBHXJnf7PdqebGNsSTwx6CEWpDCP5oLoCDcmbP35B b/integration_tests/src/data/transactions/mint_to_collection_unverify_collection/tzXASugk8578bmtA3JAFQLEfcVQp3Np3rU9fyFas2Svk8nyBHXJnf7PdqebGNsSTwx6CEWpDCP5oLoCDcmbP35B new file mode 100644 index 0000000000000000000000000000000000000000..24a6aaff635772c0f75d3c8bc3a325977183e1dd GIT binary patch literal 5560 zcmd5=30PCt629yNP*7|YMZE~3RTM&YL}f=-!xn*BHOmdekcH$10_6!(t5xfYidL&d z#k!*?C~kl#Ex1*&;(`jcyjom%Zh$MD6NDG>z4GDf_r9L*`*Y5@XJ*dKoS8ZI2FE(u zAj}B{#+W($T49594{fjkx{=KQ48tiHM#57VVrLC7>`KLzJ~|@!nFb)!W4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Brbuf1 zthv$kIM6(=o0M7qaXq*B@hsZZLHU>8aE4}69POU1nL2*_q4J7+R0G=fdj#FdZlP2R z+)jJBBv;liB4gUn{tlaoOYyDR`)w;xB+!>vp1N4-4p1g;y*T1I3#1t6xPsAC)+z}f&JS#vZB;7 z)$E|OPTqNEcIG?=To!M65gi6I8(oB3!ARHMyGOC=fx3lR9qZWI#aZ{#7^5YHPUOtE zo284KW2&QKz?d*^B_}YMC5iUeNYc~j%4EJ)9i0~A>l4Cchxv&^ zSPXYHKav|0hpRP0A)!_SJND^^$`C5#YK@E#;Vc@H#l#h2oPh=`9Nx;58j`>@atW!% zCg{l*%1FPISdA>uSC#Bb^-dsIbZ;IvF)ET58yqHLbAzKe)KGSaAlx^kOU3vP5ru zizM;{TqQ|JBxMRUi6;?!G0=_GqwUa7NlFxQ51h`TG2mo%CyJ{G8DAm?0e?!*WVyXZ zkM8_VU+Hv#ZwPXnSfNVgt8^MERSJdJ1y_@N6^S&I$VG$}cLO$TaChEN&>0Ux1RjWD zNcVLgjaW>m@F+<-;ek`J;oa9GyR7dLg6hya`gsdUNeZF23x?s{X@cZxQl$Yx@1B2ebkp~b%X|Cl$6A;~PDU&Ky)lo9 z;%>4YPp|HT&W)*`{Y~x_Ce58jLx;n3L#E}jo@~bm9^kb(t{9Um_XSlIBy4YdU z+*sX9_unOV88kMX!|CR`|222fy)sTO&UCf>ojMo7}SgmIa?qpbqha#cjK`D zO1xETv1^W~$#iK&^WNj*+qap`&K{iqeD(1)RR1?udwTEh>HoE!{#vwD68nF-nBmX< zHZoIcTyZY;aFTlPcdv_riZ32BYWpO>@|bnm(ZFg~@>IX^t9IF5*iuPvtQ**L#^~H& K$8&SE8GisY^coxh literal 0 HcmV?d00001 diff --git a/integration_tests/src/data/transactions/mint_verify_collection_unverify_collection/4hQQsDKgDx5PpZR7nGvxKsLSvX4J7voaiJC3ag7dPuu4HY5kbvaqD2gyeHbdja1f22ypmzouRNpuo6sbyGDSSgya b/integration_tests/src/data/transactions/mint_verify_collection_unverify_collection/4hQQsDKgDx5PpZR7nGvxKsLSvX4J7voaiJC3ag7dPuu4HY5kbvaqD2gyeHbdja1f22ypmzouRNpuo6sbyGDSSgya new file mode 100644 index 0000000000000000000000000000000000000000..fbed702daf2b896f8f824435304d964dd72c7250 GIT binary patch literal 3824 zcmb_f2~-o;8ounZ6%Z;EunaDURhGnoBvh*y_T2SG=i3i^Q95Y8GH#%6sOgqVLZPKK_*`nM3rP=VFFP)pCYDGvy}2| zT+514YH@#!AS*P8&6Z^GNej>%^bCMCz5V@gGIfOuRb^LlddWPmK`OVXNb%QEg`%)-dJS#gt;Yj7_s#x>CH?70jWrpsl!LPeH zrw#>wx~$}1g?;tOtZS`f>*Bg2VqKjd8u%KOJpHJ|#nF7%*TvA>&>(FSn1(Qdb38kq zOi3C+C^Z2-K5~rUD`l9@TZqd^c>`czXaG85w%op#Yxnuu>=d{8=oF$ek&(Bwv@7W* z<=zu5|5h^qhETSXjm`||ZZA7F=84WQUoh72X$B83i7B>7shzloWAhNuJR*{(aG%6n zx_+fSS?-?nY4y&0k5`*-MA-}5SM=ZCb_;j`Tc~J^g@pmI0H)@KCdO7~mPTa$tjKkJ zbq8up#z4XWUL0T`I_LrU{Q6aYKRNfl)aTl2!JG9M(nB!+#*$tU^I}5Xb{n(ipSzPT zPR?JsyZS}_`juO5to%at$Og)U`D}Oj+M}kcY(t@6)psj4ZW~`cD@|(8Gf#JJnS1pp z1HhO@gWM$J2iNrB-7$VTU^z>c=5&#gcRMle2TCU6QsO%ZLsNKRB*_uj>N(n#ucc zodFr}7FM0L!q&SpyQN#5?6R*{Tv+}roeW!aC8oS=!he`vD0@Oc zuypK2W5w)$8<(v~cPMvF?#}Tf>odi(t?HlArG?jcsAFw=TTy}AFHCN#ePv710h_Ka z+Io_v4l|o38`x)!TXwdX`9hHV$?eOgK0zDrUYOvu$i;MBqDLOgkEwfI)BZl8O5?gmW&ahMY*4!0C+9q|pwq|0e-@L#FW9 z7>J!@4}ed$zzpWY3f}35CHc!h*2f%T5?RtWgIqHN=Eg2?u7%0VgP=n^Hvym+A`W5< z#4ac(f^da+0Fzz^@h!vx2o%B=;sK<|9tiSG3W9hA?QDYJLOg-`_d`TMkTz#R#Hn$K znlDG@h9*P@DjA_FnlwIGE6vVAl`6hY6Q7m9oEzy+j}8(?()_3zJ}WMPhiJ4yA*Rv5 z?O^_g>JZ`zjaH6{5QZS1S)?s#Q!% zpai3#ftq zi;-|rAOP_Nfb6G1e(QD5)r!TK8evPbu>gb$+(y1{b3k@*~8@D z>vv?(C?y$?e~4K2c4gDf6&!LdE}gsOZ2+YzMy|x683m= z@dM+-^x9twSPj*a1KZ8qc;Sg%ZcUF05B9uDX-MFwq? zBb%$F^}aFZ?`}Doa)$9@**TxHA04cB`M6-wgVODLQMJqnGmKBSaO-3m=WTrl!Vk6{HF`cZ#PX=ki6fyu`4A0u-o@YB|Gd2s?e28E P-(=L{Jh5eoZt;HsIU5Uc literal 0 HcmV?d00001 diff --git a/integration_tests/src/data/transactions/mint_verify_collection_unverify_collection/5k71fZRpRagY45ZYu13Q8C3Bmw6KFPBkRmbBx2NuYk7roVtvM8P16WouCZtnkhRCyKyQHSgHKyTY92t9aq2tyLdd b/integration_tests/src/data/transactions/mint_verify_collection_unverify_collection/5k71fZRpRagY45ZYu13Q8C3Bmw6KFPBkRmbBx2NuYk7roVtvM8P16WouCZtnkhRCyKyQHSgHKyTY92t9aq2tyLdd new file mode 100644 index 0000000000000000000000000000000000000000..b0ec5f4a0093435e0b86f2e38908690377289174 GIT binary patch literal 3824 zcmb_f2~<;88omL9AhdwsvBRRz%I1QQkd>+x5Cpl0AG6maJcFUagYQ6d&Q4%6#xMQUB#rxMO+s zor9V`&2KteeBfNwVQ-&JEZRAyr=l}(=9jhl*hMy`w9tb4cW3j@JURKx)yd&sevmN3 zE2cwS!Bs{mmiiWywrqS|lfk`pd0cgJdt8#Y=Mz$hZRzt5OT8vI?q68~%?&ofHjWx` zTR5hsqq>)I3v)X$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_VwusV;SzX*y4rRLx7O+gWH^d%>~EVkk%HeYZ5gK7WEn4-{jez5+4FQteS}zXxijm#n)A3tf6smWyxo<}%z%EycaEm1kHxyO+Fd;t zQBALnKhauS|C{dO^|v}x%PreXntqhF_?3K;JCu1d>c`K~2g3hs29P9u%mC()rY}ZD zYuoz873A|_$kHBL0DmnuZ!xa-fqXLw@@c!F0ga6K52Nlv=n)UvcDKQ9A4H`z|Ro2OMoqa z)hL93FX4rp0U!X>;7l@r4ESmqFb6;fSOOZsm?VG$pbH$S1iTO60q6j0fEx521>gW5 zz%vNlM*tS!0jN6#2mm0zmH|TKl6W~sMDSk44D^!HR>>&Ba9^b`HH9pdagr6`Da;k# z40mdvkAOjOb5(FcLzqzng_6tVD-^ICi+7Mvw>yZX`EXcM1W% zrld-oPf&`5xB`1uYk#f?_ffHwqE##8vK2(Hcs_;f6%mpU78=3w59Cop{KII(04gIc zXa!^3MD}a0A2*LkBax^Y^IRydWa0$#Ub0Utkx1icafyKu0tge;OA#jxXU0>#)+DaR z85;tl*us^}^+BO{peSP8zDOZRgy$LA(|93%H1)J zBuU~u2wqYtU(6GV;|X$Md;%_#C~!g&pCbTWj#~Og?UUj{iP(ccrn!@-l+lb5zMXK@bIMG`JvwY3FV#ydTS*E96eQcBaCuvGV?txameDx{_Qc6pprkQ?X6kzgNdH zP$ Date: Fri, 29 Nov 2024 18:34:30 +0100 Subject: [PATCH 4/8] feat: fix collection verification check for API requests --- ...EyNkrrcqFjVF1Ntgcm1jd3FYPyAa7QwG77rRWRtmsT | Bin 0 -> 312 bytes ...tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo | Bin 0 -> 224 bytes ...rAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh | Bin 0 -> 224 bytes ...qexZSPcuiYGJuTM68tC48bhC4ZSRK9Gk178wcopo42 | Bin 0 -> 248 bytes ...NACMVZfG6VhYNDkZsXSbo2irKWc8vRvNfr657858q9 | Bin 0 -> 752 bytes ...tKm6jVypMzSMvaKWbKx43PdW3tctvj2ac34P3vj1XY | Bin 0 -> 752 bytes ...skkg9hzZFzNkQ55sQy6R4uozqfkQ8MRMmnCV7hgq5q | Bin 0 -> 232 bytes ...vfFq9VgSeHVsED8GmGPw6mK4mUeuFndZgE4w82RXNR | Bin 0 -> 312 bytes ...tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo | 1 + ...rAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh | 1 + .../src/general_scenario_tests.rs | 77 +++++ ..._tests__get_different_assets_by_owner.snap | 209 +++++++++++++ ...ent_assets_by_owner_show_unverif_coll.snap | 283 ++++++++++++++++++ ...sts__mpl_core_get_assets_by_authority.snap | 14 +- postgre-client/src/asset_filter_client.rs | 3 +- 15 files changed, 584 insertions(+), 4 deletions(-) create mode 100644 integration_tests/src/data/accounts/get_different_assets_by_owner/7vEyNkrrcqFjVF1Ntgcm1jd3FYPyAa7QwG77rRWRtmsT create mode 100644 integration_tests/src/data/accounts/get_different_assets_by_owner/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo create mode 100644 integration_tests/src/data/accounts/get_different_assets_by_owner/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh create mode 100644 integration_tests/src/data/accounts/get_different_assets_by_owner/CRqexZSPcuiYGJuTM68tC48bhC4ZSRK9Gk178wcopo42 create mode 100644 integration_tests/src/data/accounts/get_different_assets_by_owner/CeNACMVZfG6VhYNDkZsXSbo2irKWc8vRvNfr657858q9 create mode 100644 integration_tests/src/data/accounts/get_different_assets_by_owner/DqtKm6jVypMzSMvaKWbKx43PdW3tctvj2ac34P3vj1XY create mode 100644 integration_tests/src/data/accounts/get_different_assets_by_owner/J9skkg9hzZFzNkQ55sQy6R4uozqfkQ8MRMmnCV7hgq5q create mode 100644 integration_tests/src/data/accounts/get_different_assets_by_owner/fvfFq9VgSeHVsED8GmGPw6mK4mUeuFndZgE4w82RXNR create mode 100644 integration_tests/src/data/largest_token_account_ids/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo create mode 100644 integration_tests/src/data/largest_token_account_ids/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh create mode 100644 integration_tests/src/snapshots/integration_tests__general_scenario_tests__get_different_assets_by_owner.snap create mode 100644 integration_tests/src/snapshots/integration_tests__general_scenario_tests__get_different_assets_by_owner_show_unverif_coll.snap diff --git a/integration_tests/src/data/accounts/get_different_assets_by_owner/7vEyNkrrcqFjVF1Ntgcm1jd3FYPyAa7QwG77rRWRtmsT b/integration_tests/src/data/accounts/get_different_assets_by_owner/7vEyNkrrcqFjVF1Ntgcm1jd3FYPyAa7QwG77rRWRtmsT new file mode 100644 index 0000000000000000000000000000000000000000..f3bc770bd9b5d8411d8e1849cc49f15fc1425c9d GIT binary patch literal 312 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQOgp*xUdEBKZ(8dZ&*)FtD*I=_Hq%d~ zzm5f4>sGSNaNEXq_uIqksS79HJpIt^-0R9UGFw{T#z&h^wCefVTKAt}r3TQ953=$= zl7Znr6f~Mtih%eA%d9FUGlEzQ3`>EyT>Qe9eL~-Y=GV#=)ZO};FzNUK<7>O<}2Pj^g~J!Ok7t2gACTAM5YH41DVA%YaO=w<-` Dj$u`t literal 0 HcmV?d00001 diff --git a/integration_tests/src/data/accounts/get_different_assets_by_owner/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo b/integration_tests/src/data/accounts/get_different_assets_by_owner/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo new file mode 100644 index 0000000000000000000000000000000000000000..0ca6630227309ecf91c7a37326cae28559d32f5c GIT binary patch literal 224 zcmY#jfB*@G3?UYhMPy8HNPu#A~4M?m_H Se=fgS&Vtl{0V6T085jT}{8RS; literal 0 HcmV?d00001 diff --git a/integration_tests/src/data/accounts/get_different_assets_by_owner/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh b/integration_tests/src/data/accounts/get_different_assets_by_owner/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh new file mode 100644 index 0000000000000000000000000000000000000000..78015557ea9b54e4845a1401deca53b5e8c83bde GIT binary patch literal 224 zcmY#jfB*@G3#7y4HrWp(WNU#()zd+i~TOo}V6 zzqUH)JLkd?sS9j(zdgL3x^VK%(+}Owy{=p%v!(TIe6;yQtDdi|b^jSwg3L_t6$6qC z4F92k-?&l)#1HJTsF=*izz_sv11W~ri=)0*I(|M_{jKf)ITF%FG^KN dEG|wh5d;cll#~<{Tj}eU0HySDGV_3z0RZDCT!{bx literal 0 HcmV?d00001 diff --git a/integration_tests/src/data/accounts/get_different_assets_by_owner/CeNACMVZfG6VhYNDkZsXSbo2irKWc8vRvNfr657858q9 b/integration_tests/src/data/accounts/get_different_assets_by_owner/CeNACMVZfG6VhYNDkZsXSbo2irKWc8vRvNfr657858q9 new file mode 100644 index 0000000000000000000000000000000000000000..fa966e00e68bcb2c060cde3e6db0fa50b7690bbd GIT binary patch literal 752 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQT+8$$R=quY+0;`}SKJGarM2EVAUl)o zkqYm;((UZG4x4Znq;7nCvBuS6Zcu$T%i*&TJ93Jp7X01nx$WW}<{z4F8Xz;5J_C{r z4F92k5zJ#?i2ZL{F&WBC`wH)%}Fd$ z@N)}++6AY$fUF=__jriZ2_P?{q@;M1& literal 0 HcmV?d00001 diff --git a/integration_tests/src/data/accounts/get_different_assets_by_owner/DqtKm6jVypMzSMvaKWbKx43PdW3tctvj2ac34P3vj1XY b/integration_tests/src/data/accounts/get_different_assets_by_owner/DqtKm6jVypMzSMvaKWbKx43PdW3tctvj2ac34P3vj1XY new file mode 100644 index 0000000000000000000000000000000000000000..1e732179b5685f34a170e80d2ead44669f182cd7 GIT binary patch literal 752 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQ+;>SmK*siFXl26Aeb4LCRxPhT7QI{e z>m0$y;YH4s*SNV0Qa3)nSmSCjH>f_Ff zmEr=aadnS}$e#f6GD=DcimmkZ^U_LCl@383BjbNY21bT=|8>+IHJx7?p53tGUjNz; dr*2DgHJI$WV$qrA{ZVqa&k*z(#ZG2q006L^Y5f2I literal 0 HcmV?d00001 diff --git a/integration_tests/src/data/accounts/get_different_assets_by_owner/J9skkg9hzZFzNkQ55sQy6R4uozqfkQ8MRMmnCV7hgq5q b/integration_tests/src/data/accounts/get_different_assets_by_owner/J9skkg9hzZFzNkQ55sQy6R4uozqfkQ8MRMmnCV7hgq5q new file mode 100644 index 0000000000000000000000000000000000000000..b7645e0e53d77d84959a2fae56e839701b31b441 GIT binary patch literal 232 zcmY#jfB*@G3U+T1A-uKNjI`8sap0ec3%lpgDo~+xas~o-D17xOvlQ@uM zVE7LOe8!a`Aih?&Ma5)B28L)Ln^jf*gZ1TJ53O z)+P&pbcCc9mnbCX7o`G;oSf9;lFa-(F`#%xNlAf~zCJ=wFDElE8)z~E2r~cxe6LS$ literal 0 HcmV?d00001 diff --git a/integration_tests/src/data/accounts/get_different_assets_by_owner/fvfFq9VgSeHVsED8GmGPw6mK4mUeuFndZgE4w82RXNR b/integration_tests/src/data/accounts/get_different_assets_by_owner/fvfFq9VgSeHVsED8GmGPw6mK4mUeuFndZgE4w82RXNR new file mode 100644 index 0000000000000000000000000000000000000000..18604695f38a5ca21bcbae2b6828d3b5e4876180 GIT binary patch literal 312 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQPs^_?K+&f6X-*H`7KZJn{A z=tWk>;?~%6+D>eDzdgL3x^VK%(+}Owy{=p%v!(TIe6;yQtDdi|b^jSwY5>jnAS(|f z85sUUL8D2f2#BA*%&KBCBZ$SouoQ@!9ee&)t61}1dx#{H;)?69tq%Im zxo|}4f~x!n>&q#VSoT;g);SaPq4x5pJ0{DXvPGBG8}dx8O%{L}1vZZmL5f;*vjE>r BP}~3j literal 0 HcmV?d00001 diff --git a/integration_tests/src/data/largest_token_account_ids/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo b/integration_tests/src/data/largest_token_account_ids/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo new file mode 100644 index 000000000..337cef041 --- /dev/null +++ b/integration_tests/src/data/largest_token_account_ids/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo/91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo @@ -0,0 +1 @@ +fɳÞhÄvö*®Ì/”µü ¶5òuúÆS;-y˜F¶ \ No newline at end of file diff --git a/integration_tests/src/data/largest_token_account_ids/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh b/integration_tests/src/data/largest_token_account_ids/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh new file mode 100644 index 000000000..150087f30 --- /dev/null +++ b/integration_tests/src/data/largest_token_account_ids/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh/9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh @@ -0,0 +1 @@ + ø¾kh Kî ¹ÛHdתn&µ˜¨rèjh£…]Î+B \ No newline at end of file diff --git a/integration_tests/src/general_scenario_tests.rs b/integration_tests/src/general_scenario_tests.rs index 70f0aa738..bff9d0b2b 100644 --- a/integration_tests/src/general_scenario_tests.rs +++ b/integration_tests/src/general_scenario_tests.rs @@ -1,10 +1,13 @@ use crate::common::index_seed_events; +use crate::common::seed_accounts; use crate::common::seed_nfts; use crate::common::trim_test_name; +use crate::common::Network; use crate::common::SeedEvent; use crate::common::TestSetup; use crate::common::TestSetupOptions; use entities::api_req_params::GetAsset; +use entities::api_req_params::GetAssetsByOwner; use function_name::named; use itertools::Itertools; use serial_test::serial; @@ -46,3 +49,77 @@ async fn test_asset_parsing() { .unwrap(); insta::assert_json_snapshot!(name, response); } + +#[tokio::test] +#[serial] +#[named] +async fn test_get_different_assets_by_owner() { + let name = trim_test_name(function_name!()); + let setup = TestSetup::new_with_options( + name.clone(), + TestSetupOptions { + network: Some(Network::Devnet), + clear_db: true, + }, + ) + .await; + + let seeds: Vec = seed_nfts([ + "91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo", // NFT without collection + "9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh", // NFT with unverified collection + ]); + + index_seed_events(&setup, seeds.iter().collect_vec()).await; + + let seeds: Vec = seed_accounts([ + "J9skkg9hzZFzNkQ55sQy6R4uozqfkQ8MRMmnCV7hgq5q", // Core collection + "CRqexZSPcuiYGJuTM68tC48bhC4ZSRK9Gk178wcopo42", // Core asset + ]); + + index_seed_events(&setup, seeds.iter().collect_vec()).await; + + let request = r#" + { + "ownerAddress": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM", + "sortBy": { + "sortBy": "updated", + "sortDirection": "asc" + }, + "page": 1, + "limit": 50 + } + "#; + + let mutexed_tasks = Arc::new(Mutex::new(JoinSet::new())); + + let request: GetAssetsByOwner = serde_json::from_str(request).unwrap(); + let response = setup + .das_api + .get_assets_by_owner(request, mutexed_tasks.clone()) + .await + .unwrap(); + insta::assert_json_snapshot!(name.clone(), response); + + let request = r#" + { + "ownerAddress": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM", + "sortBy": { + "sortBy": "updated", + "sortDirection": "asc" + }, + "options": { + "showUnverifiedCollections": true + }, + "page": 1, + "limit": 50 + } + "#; + + let request: GetAssetsByOwner = serde_json::from_str(request).unwrap(); + let response = setup + .das_api + .get_assets_by_owner(request, mutexed_tasks.clone()) + .await + .unwrap(); + insta::assert_json_snapshot!(format!("{}_show_unverif_coll", name), response); +} diff --git a/integration_tests/src/snapshots/integration_tests__general_scenario_tests__get_different_assets_by_owner.snap b/integration_tests/src/snapshots/integration_tests__general_scenario_tests__get_different_assets_by_owner.snap new file mode 100644 index 000000000..0a1cb86dc --- /dev/null +++ b/integration_tests/src/snapshots/integration_tests__general_scenario_tests__get_different_assets_by_owner.snap @@ -0,0 +1,209 @@ +--- +source: integration_tests/src/general_scenario_tests.rs +assertion_line: 101 +expression: response +snapshot_kind: text +--- +{ + "total": 3, + "limit": 50, + "page": 1, + "items": [ + { + "interface": "MplCoreAsset", + "id": "CRqexZSPcuiYGJuTM68tC48bhC4ZSRK9Gk178wcopo42", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://test.link", + "files": [], + "metadata": { + "name": "Test core asset", + "symbol": "" + }, + "links": {} + }, + "authorities": [ + { + "address": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM", + "scopes": [ + "full" + ] + } + ], + "compression": { + "eligible": false, + "compressed": false, + "data_hash": "", + "creator_hash": "", + "asset_hash": "", + "tree": "", + "seq": 0, + "leaf_id": 0 + }, + "grouping": [ + { + "group_key": "collection", + "group_value": "J9skkg9hzZFzNkQ55sQy6R4uozqfkQ8MRMmnCV7hgq5q", + "verified": true + } + ], + "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": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM" + }, + "supply": null, + "mutable": true, + "burnt": false, + "lamports": 3135600, + "executable": false, + "rent_epoch": 18446744073709551615, + "plugins": {}, + "mpl_core_info": { + "plugins_json_version": 1 + }, + "external_plugins": [] + }, + { + "interface": "MplCoreCollection", + "id": "J9skkg9hzZFzNkQ55sQy6R4uozqfkQ8MRMmnCV7hgq5q", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "http://collection.link", + "files": [], + "metadata": { + "name": "Test core collection", + "symbol": "" + }, + "links": {} + }, + "authorities": [ + { + "address": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM", + "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": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM" + }, + "supply": null, + "mutable": true, + "burnt": false, + "lamports": 1524240, + "executable": false, + "rent_epoch": 18446744073709551615, + "plugins": {}, + "mpl_core_info": { + "num_minted": 1, + "current_size": 1, + "plugins_json_version": 1 + }, + "external_plugins": [] + }, + { + "interface": "V1_NFT", + "id": "91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://nft", + "files": [], + "metadata": { + "name": "Test regular NFT", + "symbol": "REG_NFT", + "token_standard": "NonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM", + "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": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM" + }, + "supply": { + "print_max_supply": 0, + "print_current_supply": 0, + "edition_nonce": 252 + }, + "mutable": true, + "burnt": false, + "lamports": 15115600, + "executable": false, + "metadata_owner": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", + "rent_epoch": 18446744073709551615, + "token_info": { + "supply": 1, + "decimals": 0, + "token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "mint_authority": "EKadZQBg35Kst9qzkm7fLXzGPFeCQMaAhuiYttVzgYv8", + "freeze_authority": "EKadZQBg35Kst9qzkm7fLXzGPFeCQMaAhuiYttVzgYv8" + } + } + ] +} diff --git a/integration_tests/src/snapshots/integration_tests__general_scenario_tests__get_different_assets_by_owner_show_unverif_coll.snap b/integration_tests/src/snapshots/integration_tests__general_scenario_tests__get_different_assets_by_owner_show_unverif_coll.snap new file mode 100644 index 000000000..0e05aca8e --- /dev/null +++ b/integration_tests/src/snapshots/integration_tests__general_scenario_tests__get_different_assets_by_owner_show_unverif_coll.snap @@ -0,0 +1,283 @@ +--- +source: integration_tests/src/general_scenario_tests.rs +assertion_line: 124 +expression: response +snapshot_kind: text +--- +{ + "total": 4, + "limit": 50, + "page": 1, + "items": [ + { + "interface": "MplCoreAsset", + "id": "CRqexZSPcuiYGJuTM68tC48bhC4ZSRK9Gk178wcopo42", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://test.link", + "files": [], + "metadata": { + "name": "Test core asset", + "symbol": "" + }, + "links": {} + }, + "authorities": [ + { + "address": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM", + "scopes": [ + "full" + ] + } + ], + "compression": { + "eligible": false, + "compressed": false, + "data_hash": "", + "creator_hash": "", + "asset_hash": "", + "tree": "", + "seq": 0, + "leaf_id": 0 + }, + "grouping": [ + { + "group_key": "collection", + "group_value": "J9skkg9hzZFzNkQ55sQy6R4uozqfkQ8MRMmnCV7hgq5q", + "verified": true + } + ], + "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": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM" + }, + "supply": null, + "mutable": true, + "burnt": false, + "lamports": 3135600, + "executable": false, + "rent_epoch": 18446744073709551615, + "plugins": {}, + "mpl_core_info": { + "plugins_json_version": 1 + }, + "external_plugins": [] + }, + { + "interface": "MplCoreCollection", + "id": "J9skkg9hzZFzNkQ55sQy6R4uozqfkQ8MRMmnCV7hgq5q", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "http://collection.link", + "files": [], + "metadata": { + "name": "Test core collection", + "symbol": "" + }, + "links": {} + }, + "authorities": [ + { + "address": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM", + "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": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM" + }, + "supply": null, + "mutable": true, + "burnt": false, + "lamports": 1524240, + "executable": false, + "rent_epoch": 18446744073709551615, + "plugins": {}, + "mpl_core_info": { + "num_minted": 1, + "current_size": 1, + "plugins_json_version": 1 + }, + "external_plugins": [] + }, + { + "interface": "V1_NFT", + "id": "91tabY8dzm3HfSgDujeyEfT6p94sV39iW2T8R9u5CMMo", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://nft", + "files": [], + "metadata": { + "name": "Test regular NFT", + "symbol": "REG_NFT", + "token_standard": "NonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM", + "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": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM" + }, + "supply": { + "print_max_supply": 0, + "print_current_supply": 0, + "edition_nonce": 252 + }, + "mutable": true, + "burnt": false, + "lamports": 15115600, + "executable": false, + "metadata_owner": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", + "rent_epoch": 18446744073709551615, + "token_info": { + "supply": 1, + "decimals": 0, + "token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "mint_authority": "EKadZQBg35Kst9qzkm7fLXzGPFeCQMaAhuiYttVzgYv8", + "freeze_authority": "EKadZQBg35Kst9qzkm7fLXzGPFeCQMaAhuiYttVzgYv8" + } + }, + { + "interface": "V1_NFT", + "id": "9prAPyPdbd75U5uLvACjPpyfSp7EbHPwPdtxZihYetjh", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://nft", + "files": [], + "metadata": { + "name": "Regular NFT", + "symbol": "REG_NFT", + "token_standard": "NonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM", + "scopes": [ + "full" + ] + } + ], + "compression": { + "eligible": false, + "compressed": false, + "data_hash": "", + "creator_hash": "", + "asset_hash": "", + "tree": "", + "seq": 0, + "leaf_id": 0 + }, + "grouping": [ + { + "group_key": "collection", + "group_value": "H5wi4N9Ve8o3s58wCFdWHS6seQaEjWvToyvtJjBsvMX9", + "verified": false + } + ], + "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": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM" + }, + "supply": { + "print_max_supply": 0, + "print_current_supply": 0, + "edition_nonce": 255 + }, + "mutable": true, + "burnt": false, + "lamports": 15115600, + "executable": false, + "metadata_owner": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", + "rent_epoch": 18446744073709551615, + "token_info": { + "supply": 1, + "decimals": 0, + "token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "mint_authority": "GrqHKAtKcYNFBYM43wUEtahKVwWp6iiyTdyoePtduKkL", + "freeze_authority": "GrqHKAtKcYNFBYM43wUEtahKVwWp6iiyTdyoePtduKkL" + } + } + ] +} diff --git a/integration_tests/src/snapshots/integration_tests__mpl_core_tests__mpl_core_get_assets_by_authority.snap b/integration_tests/src/snapshots/integration_tests__mpl_core_tests__mpl_core_get_assets_by_authority.snap index 5acbdeb5d..cf30c99f4 100644 --- a/integration_tests/src/snapshots/integration_tests__mpl_core_tests__mpl_core_get_assets_by_authority.snap +++ b/integration_tests/src/snapshots/integration_tests__mpl_core_tests__mpl_core_get_assets_by_authority.snap @@ -1,7 +1,8 @@ --- -source: integration_tests/tests/integration_tests/mpl_core_tests.rs -assertion_line: 108 +source: integration_tests/src/mpl_core_tests.rs +assertion_line: 129 expression: response +snapshot_kind: text --- { "total": 2, @@ -42,7 +43,8 @@ expression: response "grouping": [ { "group_key": "collection", - "group_value": "9CSyGBw1DCVZfx621nb7UBM9SpVDsX1m9MaN6APCf1Ci" + "group_value": "9CSyGBw1DCVZfx621nb7UBM9SpVDsX1m9MaN6APCf1Ci", + "verified": true } ], "royalty": { @@ -64,6 +66,9 @@ expression: response "supply": null, "mutable": true, "burnt": false, + "lamports": 3156480, + "executable": false, + "rent_epoch": 18446744073709551615, "plugins": {}, "mpl_core_info": { "plugins_json_version": 1 @@ -121,6 +126,9 @@ expression: response "supply": null, "mutable": true, "burnt": false, + "lamports": 1545120, + "executable": false, + "rent_epoch": 18446744073709551615, "plugins": {}, "mpl_core_info": { "num_minted": 1, diff --git a/postgre-client/src/asset_filter_client.rs b/postgre-client/src/asset_filter_client.rs index d129c87c3..d5f5bb14d 100644 --- a/postgre-client/src/asset_filter_client.rs +++ b/postgre-client/src/asset_filter_client.rs @@ -303,7 +303,8 @@ fn add_filter_clause<'a>( } if !options.show_unverified_collections { - query_builder.push(" AND assets_v3.ast_is_collection_verified = true"); + // if there is no collection for asset it doesn't mean that it's unverified + query_builder.push(" AND (assets_v3.ast_is_collection_verified is null or assets_v3.ast_is_collection_verified = true)"); } if let Some(delegate) = &filter.delegate { From 6a18d6b724cb82ebd49a29779c8b0dfd0658dcd2 Mon Sep 17 00:00:00 2001 From: n00m4d Date: Thu, 12 Dec 2024 12:06:51 +0100 Subject: [PATCH 5/8] feat: added new index for is_collection_verified --- migrations/10_is_collection_verified_index.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 migrations/10_is_collection_verified_index.sql diff --git a/migrations/10_is_collection_verified_index.sql b/migrations/10_is_collection_verified_index.sql new file mode 100644 index 000000000..0a7c68f16 --- /dev/null +++ b/migrations/10_is_collection_verified_index.sql @@ -0,0 +1 @@ +CREATE INDEX assets_v3_is_collection_verified ON assets_v3 (ast_is_collection_verified) WHERE ast_is_collection_verified IS NULL OR ast_is_collection_verified = TRUE; \ No newline at end of file From 8ed50f92d866a147464a64076664b2929ca6e224 Mon Sep 17 00:00:00 2001 From: n00m4d Date: Thu, 12 Dec 2024 12:43:49 +0100 Subject: [PATCH 6/8] feat: add drop and recreate index --- postgre-client/src/load_client.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/postgre-client/src/load_client.rs b/postgre-client/src/load_client.rs index 4d2d345e7..8000fa455 100644 --- a/postgre-client/src/load_client.rs +++ b/postgre-client/src/load_client.rs @@ -193,6 +193,7 @@ impl PgClient { "assets_v3_specification_asset_class", "assets_v3_specification_version", "assets_v3_supply", + "assets_v3_is_collection_verified", ] { self.drop_index(transaction, index).await?; } @@ -231,6 +232,7 @@ impl PgClient { ("assets_v3_specification_asset_class", "assets_v3 (ast_specification_asset_class) WHERE ast_specification_asset_class IS NOT NULL AND ast_specification_asset_class <> 'unknown'::specification_asset_class"), ("assets_v3_specification_version", "assets_v3 (ast_specification_version) WHERE ast_specification_version <> 'v1'::specification_versions"), ("assets_v3_supply", "assets_v3(ast_supply) WHERE ast_supply IS NOT NULL"), + ("assets_v3_is_collection_verified", "assets_v3(ast_is_collection_verified) WHERE ast_is_collection_verified IS NULL OR ast_is_collection_verified = TRUE"), ]{ self.create_index(transaction, index, on_query_string).await?; } From b3aaf02bb8195426cc8dc37161c89cb0d21dfbb7 Mon Sep 17 00:00:00 2001 From: n00m4d Date: Mon, 23 Dec 2024 21:57:46 +0100 Subject: [PATCH 7/8] feat: drop new index and change sql query --- migrations/10_is_collection_verified_index.sql | 1 - postgre-client/src/asset_filter_client.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 migrations/10_is_collection_verified_index.sql diff --git a/migrations/10_is_collection_verified_index.sql b/migrations/10_is_collection_verified_index.sql deleted file mode 100644 index 0a7c68f16..000000000 --- a/migrations/10_is_collection_verified_index.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX assets_v3_is_collection_verified ON assets_v3 (ast_is_collection_verified) WHERE ast_is_collection_verified IS NULL OR ast_is_collection_verified = TRUE; \ No newline at end of file diff --git a/postgre-client/src/asset_filter_client.rs b/postgre-client/src/asset_filter_client.rs index d5f5bb14d..b41f48e32 100644 --- a/postgre-client/src/asset_filter_client.rs +++ b/postgre-client/src/asset_filter_client.rs @@ -304,7 +304,7 @@ fn add_filter_clause<'a>( if !options.show_unverified_collections { // if there is no collection for asset it doesn't mean that it's unverified - query_builder.push(" AND (assets_v3.ast_is_collection_verified is null or assets_v3.ast_is_collection_verified = true)"); + query_builder.push(" AND assets_v3.ast_is_collection_verified IS DISTINCT FROM FALSE"); } if let Some(delegate) = &filter.delegate { From 84136e0e376816f33ac40ed11ddecf25aefeed49 Mon Sep 17 00:00:00 2001 From: n00m4d Date: Thu, 26 Dec 2024 12:50:36 +0100 Subject: [PATCH 8/8] fix: drop index creation from synchronizer --- postgre-client/src/load_client.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/postgre-client/src/load_client.rs b/postgre-client/src/load_client.rs index 8000fa455..4d2d345e7 100644 --- a/postgre-client/src/load_client.rs +++ b/postgre-client/src/load_client.rs @@ -193,7 +193,6 @@ impl PgClient { "assets_v3_specification_asset_class", "assets_v3_specification_version", "assets_v3_supply", - "assets_v3_is_collection_verified", ] { self.drop_index(transaction, index).await?; } @@ -232,7 +231,6 @@ impl PgClient { ("assets_v3_specification_asset_class", "assets_v3 (ast_specification_asset_class) WHERE ast_specification_asset_class IS NOT NULL AND ast_specification_asset_class <> 'unknown'::specification_asset_class"), ("assets_v3_specification_version", "assets_v3 (ast_specification_version) WHERE ast_specification_version <> 'v1'::specification_versions"), ("assets_v3_supply", "assets_v3(ast_supply) WHERE ast_supply IS NOT NULL"), - ("assets_v3_is_collection_verified", "assets_v3(ast_is_collection_verified) WHERE ast_is_collection_verified IS NULL OR ast_is_collection_verified = TRUE"), ]{ self.create_index(transaction, index, on_query_string).await?; }