From 7a7e13e70dc0491a70c300281f259f4a121385d9 Mon Sep 17 00:00:00 2001 From: AhzamAkhtar Date: Wed, 8 Jan 2025 20:12:32 +0530 Subject: [PATCH] token_type filter added in search_asset rpc method --- das_api/src/api/api_impl.rs | 5 +- das_api/src/api/mod.rs | 3 +- .../src/dao/extensions/asset.rs | 12 + digital_asset_types/src/dao/extensions/mod.rs | 1 + .../src/dao/extensions/token_accounts.rs | 26 +++ digital_asset_types/src/dao/mod.rs | 119 ++++++++-- digital_asset_types/src/rpc/filter.rs | 10 + ...AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB | Bin 0 -> 224 bytes ...SzJpyztTuK124EyPAw2nbF4Vaj2P9MU9vww1QN1k8p | Bin 0 -> 312 bytes ...VGLDmpnYqX5EvTg7i3tpRNEugeaUyDC9HtPSb3V3DS | Bin 0 -> 824 bytes ...77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo | Bin 0 -> 224 bytes ...HQquD7pQFUsBoPpW816CU8zQrQCua9mw4Znh9FyKZJ | Bin 0 -> 824 bytes ...oN9TsoMSKJAp388G752pSUscb8iZwgdH459KSJxbZT | Bin 0 -> 312 bytes ...RNfDfdq1nKyU1TQiCEQLWyPtD8EwUH9Kt2ahsbidUx | Bin 0 -> 312 bytes ...ajpcYgnxmWK91RhrfsdB3Tm83PcDwPvMC8ZinvtTY6 | Bin 0 -> 824 bytes ...YnhQoR9YM3N7UoaKRoA44Uy8JeaZV3qyouov87awMs | Bin 0 -> 224 bytes ...ackukZJRBkQSufwFnhTkmTzB11Ww8375EDXTwY75wk | Bin 0 -> 312 bytes ...77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo | Bin 0 -> 224 bytes ...6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk | Bin 0 -> 224 bytes ...HQquD7pQFUsBoPpW816CU8zQrQCua9mw4Znh9FyKZJ | Bin 0 -> 824 bytes ...NshcVjEgQ6nSsogWEQjRTr9EaEHJzKcSenqe2kyx5J | Bin 0 -> 824 bytes ...oN9TsoMSKJAp388G752pSUscb8iZwgdH459KSJxbZT | Bin 0 -> 312 bytes ...81QrLYTwSDkNwXgCqKAwrC1Tu6R9mh9BHcxys2Bup2 | Bin 0 -> 224 bytes ...AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB | Bin 0 -> 224 bytes ...SzJpyztTuK124EyPAw2nbF4Vaj2P9MU9vww1QN1k8p | Bin 0 -> 312 bytes ...VGLDmpnYqX5EvTg7i3tpRNEugeaUyDC9HtPSb3V3DS | Bin 0 -> 824 bytes ...yZ43boZTaP4mJsbTVUpinFJGMQXSMstJvDeatpEo4S | Bin 0 -> 824 bytes ...RjBSW4tnw42qxf3tycTYKki1d4bcETt9AfjEwoHYgy | Bin 0 -> 312 bytes ...81QrLYTwSDkNwXgCqKAwrC1Tu6R9mh9BHcxys2Bup2 | 2 + ...AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB | 2 + ...77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo | Bin 0 -> 32 bytes ...6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk | 1 + ...bbYh9NkGw15tEp16LLasmJX5VQR4Seh8gDjTrtdpoC | Bin 0 -> 4008 bytes ...Gu3bu5WnAdpcLbjQ4iyX6BQ5QGF69wevE8ZeeY5poA | Bin 0 -> 3240 bytes ...bbYh9NkGw15tEp16LLasmJX5VQR4Seh8gDjTrtdpoC | Bin 0 -> 4008 bytes ...Gu3bu5WnAdpcLbjQ4iyX6BQ5QGF69wevE8ZeeY5poA | Bin 0 -> 3240 bytes .../tests/integration_tests/main.rs | 1 + ..._asset_with_token_type_all_scenario_1.snap | 148 ++++++++++++ ..._asset_with_token_type_all_scenario_2.snap | 80 +++++++ ...arch_asset_with_token_type_compressed.snap | 80 +++++++ ...search_asset_with_token_type_fungible.snap | 64 +++++ ...ch_asset_with_token_type_non_fungible.snap | 148 ++++++++++++ ...rch_asset_with_token_type_regular_nft.snap | 148 ++++++++++++ .../token_type_filter_test.rs | 220 ++++++++++++++++++ 44 files changed, 1053 insertions(+), 17 deletions(-) create mode 100644 digital_asset_types/src/dao/extensions/token_accounts.rs create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/7oSzJpyztTuK124EyPAw2nbF4Vaj2P9MU9vww1QN1k8p create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/7sVGLDmpnYqX5EvTg7i3tpRNEugeaUyDC9HtPSb3V3DS create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/DVHQquD7pQFUsBoPpW816CU8zQrQCua9mw4Znh9FyKZJ create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/HboN9TsoMSKJAp388G752pSUscb8iZwgdH459KSJxbZT create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_fungible/6BRNfDfdq1nKyU1TQiCEQLWyPtD8EwUH9Kt2ahsbidUx create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_fungible/7BajpcYgnxmWK91RhrfsdB3Tm83PcDwPvMC8ZinvtTY6 create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_fungible/7EYnhQoR9YM3N7UoaKRoA44Uy8JeaZV3qyouov87awMs create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/47ackukZJRBkQSufwFnhTkmTzB11Ww8375EDXTwY75wk create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/DVHQquD7pQFUsBoPpW816CU8zQrQCua9mw4Znh9FyKZJ create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/ELNshcVjEgQ6nSsogWEQjRTr9EaEHJzKcSenqe2kyx5J create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/HboN9TsoMSKJAp388G752pSUscb8iZwgdH459KSJxbZT create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/2w81QrLYTwSDkNwXgCqKAwrC1Tu6R9mh9BHcxys2Bup2 create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/7oSzJpyztTuK124EyPAw2nbF4Vaj2P9MU9vww1QN1k8p create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/7sVGLDmpnYqX5EvTg7i3tpRNEugeaUyDC9HtPSb3V3DS create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/CyyZ43boZTaP4mJsbTVUpinFJGMQXSMstJvDeatpEo4S create mode 100644 integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/iRjBSW4tnw42qxf3tycTYKki1d4bcETt9AfjEwoHYgy create mode 100644 integration_tests/tests/data/largest_token_account_ids/2w81QrLYTwSDkNwXgCqKAwrC1Tu6R9mh9BHcxys2Bup2/2w81QrLYTwSDkNwXgCqKAwrC1Tu6R9mh9BHcxys2Bup2 create mode 100644 integration_tests/tests/data/largest_token_account_ids/42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB/42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB create mode 100644 integration_tests/tests/data/largest_token_account_ids/8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo/8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo create mode 100644 integration_tests/tests/data/largest_token_account_ids/AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk/AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk create mode 100644 integration_tests/tests/data/transactions/search_asset_with_token_type_all_scenario_2/4URwUGBjbsF7UBUYdSC546tnBy7nD67txsso8D9CR9kGLtbbYh9NkGw15tEp16LLasmJX5VQR4Seh8gDjTrtdpoC create mode 100644 integration_tests/tests/data/transactions/search_asset_with_token_type_all_scenario_2/4nKDSvw2kGpccZWLEPnfdP7J1SEexQFRP3xWc9NBtQ1qQeGu3bu5WnAdpcLbjQ4iyX6BQ5QGF69wevE8ZeeY5poA create mode 100644 integration_tests/tests/data/transactions/search_asset_with_token_type_compressed/4URwUGBjbsF7UBUYdSC546tnBy7nD67txsso8D9CR9kGLtbbYh9NkGw15tEp16LLasmJX5VQR4Seh8gDjTrtdpoC create mode 100644 integration_tests/tests/data/transactions/search_asset_with_token_type_compressed/4nKDSvw2kGpccZWLEPnfdP7J1SEexQFRP3xWc9NBtQ1qQeGu3bu5WnAdpcLbjQ4iyX6BQ5QGF69wevE8ZeeY5poA create mode 100644 integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_all_scenario_1.snap create mode 100644 integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_all_scenario_2.snap create mode 100644 integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_compressed.snap create mode 100644 integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_fungible.snap create mode 100644 integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_non_fungible.snap create mode 100644 integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_regular_nft.snap create mode 100644 integration_tests/tests/integration_tests/token_type_filter_test.rs diff --git a/das_api/src/api/api_impl.rs b/das_api/src/api/api_impl.rs index 9aac04b2c..89eff118c 100644 --- a/das_api/src/api/api_impl.rs +++ b/das_api/src/api/api_impl.rs @@ -374,6 +374,7 @@ impl ApiContract for DasApi { negate, condition_type, interface, + token_type, owner_address, owner_type, creator_address, @@ -403,7 +404,7 @@ impl ApiContract for DasApi { // Deserialize search assets query let spec: Option<(SpecificationVersions, SpecificationAssetClass)> = - interface.map(|x| x.into()); + interface.clone().map(|x| x.into()); let specification_version = spec.clone().map(|x| x.0); let specification_asset_class = spec.map(|x| x.1); let condition_type = condition_type.map(|x| match x { @@ -431,8 +432,10 @@ impl ApiContract for DasApi { let saq = SearchAssetsQuery { negate, condition_type, + interface, specification_version, specification_asset_class, + token_type, owner_address, owner_type, creator_address, diff --git a/das_api/src/api/mod.rs b/das_api/src/api/mod.rs index b98fe2cbe..2addbdfac 100644 --- a/das_api/src/api/mod.rs +++ b/das_api/src/api/mod.rs @@ -1,6 +1,6 @@ use crate::error::DasApiError; use async_trait::async_trait; -use digital_asset_types::rpc::filter::{AssetSortDirection, SearchConditionType}; +use digital_asset_types::rpc::filter::{AssetSortDirection, SearchConditionType, TokenTypeClass}; use digital_asset_types::rpc::options::Options; use digital_asset_types::rpc::response::{ AssetList, NftEditions, TokenAccountList, TransactionSignatureList, @@ -96,6 +96,7 @@ pub struct SearchAssets { pub negate: Option, pub condition_type: Option, pub interface: Option, + pub token_type: Option, pub owner_address: Option, pub owner_type: Option, pub creator_address: Option, diff --git a/digital_asset_types/src/dao/extensions/asset.rs b/digital_asset_types/src/dao/extensions/asset.rs index ace692d7e..1d8e7f1d3 100644 --- a/digital_asset_types/src/dao/extensions/asset.rs +++ b/digital_asset_types/src/dao/extensions/asset.rs @@ -4,6 +4,7 @@ use crate::dao::{ asset, asset_authority, asset_creators, asset_data, asset_grouping, asset_v1_account_attachments, sea_orm_active_enums::{OwnerType, RoyaltyTargetType}, + token_accounts, }; #[derive(Copy, Clone, Debug, EnumIter)] @@ -13,6 +14,7 @@ pub enum Relation { AssetAuthority, AssetCreators, AssetGrouping, + TokenAccounts, } impl RelationTrait for Relation { @@ -22,6 +24,10 @@ impl RelationTrait for Relation { .from(asset::Column::AssetData) .to(asset_data::Column::Id) .into(), + Self::TokenAccounts => asset::Entity::belongs_to(token_accounts::Entity) + .from(asset::Column::Id) + .to(token_accounts::Column::Mint) + .into(), Self::AssetV1AccountAttachments => { asset::Entity::has_many(asset_v1_account_attachments::Entity).into() } @@ -62,6 +68,12 @@ impl Related for asset::Entity { } } +impl Related for asset::Entity { + fn to() -> RelationDef { + Relation::TokenAccounts.def() + } +} + impl Default for RoyaltyTargetType { fn default() -> Self { Self::Creators diff --git a/digital_asset_types/src/dao/extensions/mod.rs b/digital_asset_types/src/dao/extensions/mod.rs index bcfc3e130..af3baad66 100644 --- a/digital_asset_types/src/dao/extensions/mod.rs +++ b/digital_asset_types/src/dao/extensions/mod.rs @@ -5,3 +5,4 @@ pub mod asset_data; pub mod asset_grouping; pub mod asset_v1_account_attachment; pub mod instruction; +pub mod token_accounts; diff --git a/digital_asset_types/src/dao/extensions/token_accounts.rs b/digital_asset_types/src/dao/extensions/token_accounts.rs new file mode 100644 index 000000000..a8c8f60eb --- /dev/null +++ b/digital_asset_types/src/dao/extensions/token_accounts.rs @@ -0,0 +1,26 @@ +use sea_orm::{EntityTrait, EnumIter, Related, RelationDef, RelationTrait}; + +use crate::dao::{asset, token_accounts}; + +#[derive(Copy, Clone, Debug, EnumIter)] + +pub enum Relation { + Asset, +} + +impl RelationTrait for Relation { + fn def(&self) -> RelationDef { + match self { + Self::Asset => token_accounts::Entity::belongs_to(asset::Entity) + .from(token_accounts::Column::Mint) + .to(asset::Column::Id) + .into(), + } + } +} + +impl Related for token_accounts::Entity { + fn to() -> RelationDef { + Relation::Asset.def() + } +} diff --git a/digital_asset_types/src/dao/mod.rs b/digital_asset_types/src/dao/mod.rs index bf1e540ab..dfa9476f2 100644 --- a/digital_asset_types/src/dao/mod.rs +++ b/digital_asset_types/src/dao/mod.rs @@ -2,6 +2,8 @@ mod full_asset; mod generated; pub mod scopes; +use crate::rpc::{filter::TokenTypeClass, Interface}; + use self::sea_orm_active_enums::{ OwnerType, RoyaltyTargetType, SpecificationAssetClass, SpecificationVersions, }; @@ -52,8 +54,10 @@ pub struct SearchAssetsQuery { pub negate: Option, /// Defaults to [ConditionType::All] pub condition_type: Option, + pub interface: Option, pub specification_version: Option, pub specification_asset_class: Option, + pub token_type: Option, pub owner_address: Option>, pub owner_type: Option, pub creator_address: Option>, @@ -75,6 +79,28 @@ pub struct SearchAssetsQuery { } impl SearchAssetsQuery { + pub fn validation_checks(&self) -> Result<(), DbErr> { + if self.token_type.is_some() { + if self.owner_type.is_some() { + return Err(DbErr::Custom( + "`owner_type` is not supported when using `token_type` field".to_string(), + )); + } + if self.owner_address.is_none() { + return Err(DbErr::Custom( + "Must provide `owner_address` when using `token_type` field".to_string(), + )); + } + if self.interface.is_some() { + return Err(DbErr::Custom( + "`specification_asset_class` is not supported when using `token_type` field" + .to_string(), + )); + } + } + Ok(()) + } + pub fn conditions(&self) -> Result<(Condition, Vec), DbErr> { let mut conditions = match self.condition_type { // None --> default to all when no option is provided @@ -88,16 +114,36 @@ impl SearchAssetsQuery { .clone() .map(|x| asset::Column::SpecificationVersion.eq(x)), ) + .add_option({ + self.validation_checks()?; + self.token_type.as_ref().map(|x| match x { + TokenTypeClass::Compressed => asset::Column::TreeId.is_not_null(), + TokenTypeClass::Nft => asset::Column::TreeId.is_null().and( + asset::Column::SpecificationAssetClass + .eq(SpecificationAssetClass::Nft) + .or(asset::Column::SpecificationAssetClass + .eq(SpecificationAssetClass::MplCoreAsset)) + .or(asset::Column::SpecificationAssetClass + .eq(SpecificationAssetClass::ProgrammableNft)), + ), + TokenTypeClass::NonFungible => asset::Column::SpecificationAssetClass + .eq(SpecificationAssetClass::Nft) + .or(asset::Column::SpecificationAssetClass + .eq(SpecificationAssetClass::ProgrammableNft)) + .or(asset::Column::SpecificationAssetClass + .eq(SpecificationAssetClass::MplCoreAsset)), + TokenTypeClass::Fungible => asset::Column::SpecificationAssetClass + .eq(SpecificationAssetClass::FungibleAsset) + .or(asset::Column::SpecificationAssetClass + .eq(SpecificationAssetClass::FungibleToken)), + TokenTypeClass::All => asset::Column::SpecificationAssetClass.is_not_null(), + }) + }) .add_option( self.specification_asset_class .clone() .map(|x| asset::Column::SpecificationAssetClass.eq(x)), ) - .add_option( - self.owner_address - .to_owned() - .map(|x| asset::Column::Owner.eq(x)), - ) .add_option( self.delegate .to_owned() @@ -145,16 +191,34 @@ impl SearchAssetsQuery { if let Some(o) = self.owner_type.clone() { conditions = conditions.add(asset::Column::OwnerType.eq(o)); } else { - // Default to NFTs - // - // In theory, the owner_type=single check should be sufficient, - // however there is an old bug that has marked some non-NFTs as "single" with supply > 1. - // The supply check guarentees we do not include those. - conditions = conditions.add_option(Some( - asset::Column::OwnerType - .eq(OwnerType::Single) - .and(asset::Column::Supply.lte(1)), - )); + match self.token_type { + Some(TokenTypeClass::Fungible) => { + conditions = conditions.add_option(Some( + asset::Column::OwnerType.eq(OwnerType::Token).and( + (asset::Column::SpecificationAssetClass + .eq(SpecificationAssetClass::FungibleToken)) + .or(asset::Column::SpecificationAssetClass + .eq(SpecificationAssetClass::FungibleAsset)), + ), + )); + } + Some(TokenTypeClass::All) => { + conditions = conditions + .add_option(Some(asset::Column::SpecificationAssetClass.is_not_null())); + } + _ => { + // Default to NFTs + // + // In theory, the owner_type=single check should be sufficient, + // however there is an old bug that has marked some non-NFTs as "single" with supply > 1. + // The supply check guarentees we do not include those. + conditions = conditions.add_option(Some( + asset::Column::OwnerType + .eq(OwnerType::Single) + .and(asset::Column::Supply.lte(1)), + )); + } + } } if let Some(c) = self.creator_address.to_owned() { @@ -194,6 +258,31 @@ impl SearchAssetsQuery { joins.push(rel); } + if let Some(o) = self.owner_address.to_owned() { + if self.token_type == Some(TokenTypeClass::Fungible) + || self.token_type == Some(TokenTypeClass::All) + { + conditions = conditions.add( + asset::Column::Owner + .eq(o.clone()) + .or(token_accounts::Column::Owner.eq(o)), + ); + + let rel = extensions::token_accounts::Relation::Asset + .def() + .rev() + .on_condition(|left, right| { + Expr::tbl(right, token_accounts::Column::Mint) + .eq(Expr::tbl(left, asset::Column::Id)) + .into_condition() + }); + println!("rel: {:?}", rel); + joins.push(rel); + } else { + conditions = conditions.add(asset::Column::Owner.eq(o)); + } + } + if let Some(g) = self.grouping.to_owned() { let cond = Condition::all() .add(asset_grouping::Column::GroupKey.eq(g.0)) diff --git a/digital_asset_types/src/rpc/filter.rs b/digital_asset_types/src/rpc/filter.rs index a471f21fb..e90b4a158 100644 --- a/digital_asset_types/src/rpc/filter.rs +++ b/digital_asset_types/src/rpc/filter.rs @@ -1,4 +1,5 @@ use schemars::JsonSchema; +use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] @@ -31,6 +32,15 @@ pub enum AssetSortBy { None, } +#[derive(Debug, Clone, PartialEq, Eq, EnumIter, Serialize, Deserialize, JsonSchema)] +pub enum TokenTypeClass { + Fungible, + NonFungible, + Compressed, + Nft, + All, +} + #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] pub enum AssetSortDirection { #[serde(rename = "asc")] diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB b/integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB new file mode 100644 index 0000000000000000000000000000000000000000..a5c0f00fb1b9e458a1a0bd8024e761207528d393 GIT binary patch literal 224 zcmY#jfB*@G30CV5m+3NHA9`{(DOstGrfbW!~ebR-0OPt zm(+RF#I+%R^W0QUdp)TB_ss8vOxx!zAH{k&I}%?kl+cEm3!=9qcCUyL*?(W`$QtLL j?;oa5?Uc#)h*~4b*!X+RfftIKn4oR|Q!tIlVtCj9_~BrI literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/7sVGLDmpnYqX5EvTg7i3tpRNEugeaUyDC9HtPSb3V3DS b/integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/7sVGLDmpnYqX5EvTg7i3tpRNEugeaUyDC9HtPSb3V3DS new file mode 100644 index 0000000000000000000000000000000000000000..126ffe8372de876b0fbd6d3794be5de1aa42dd75 GIT binary patch literal 824 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQOcRy6pJDZPYW44B#S_XiPA~*sUUkaw z$0QS}_f8wvK9uAxNZt7OVvVcC+@ShwmcwTwcH|UGE%>|DbKAu|%s({UG(cu<2?df2 z4F92k5zJ#?Snn6@HU-LA&cwjL(k2?_ZISM9;ndBeOOI{3dTVaV`RO0M4T6J{n0J=y zO^?#KUy!EX#lLe#U~xp&40V=6&ktqK^bW2L|M$9cuj|cU3P6K{J$*c#{rwb_jVz2! zp%x)iTu?O-u@gWlqokyu*h*hNIVDdoBQ+-{KQ})=PcJiHzo0ZJCo@^UI1@!f g^DA>W-v8*xoO93jh|Jnw>K5^<6p98sV5sc?0I43UPXGV_ literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo b/integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo new file mode 100644 index 0000000000000000000000000000000000000000..d032c8605415817567c02137e33e2b4d6a1a8ceb GIT binary patch literal 224 zcmY#jfB*@G3ZZjryshVdtJFkW=rea_-ONqRy|)^>;5yW1euxOD+VMP z82&>6Bbdj)AQ2GlHU-ED0`fs(jqPly*VeF1pV;)|Sx2Xb(v` z@E-~o!8`_r2?5b=Q=pvXObiSxZK7e`7U>QbPTf4Z^w_4Wx8|mtpZ?L?AUHUQd1tBK z^r%wFuy-k)Tx)~Er6)O0Uirad>FqQ@1F2Y7nCODWG3quX9CImykh;_ z)RM%M#F9jPkkNWs#rb*21`jy<3nL>i5E=3}i`g5;?q^d?k=`7CY{G@rO!o8aHm=Nm zYhw7{aQ8!9Mg|wBHFoMb*T2|luG}j1C5c%jB>m}1lg{T%e_IkCh;YwiNMU4T{KLq? z$oNG$*X>_}L}*&@iHD8>KiKllT>odLY%%9^@t*2ue5N4`42%qn{xNf#Z)~hNVVCoG geq|2F`yU;dbME;bky-mo-6DRKLeYQ+47D8q05iy_t^fc4 literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/HboN9TsoMSKJAp388G752pSUscb8iZwgdH459KSJxbZT b/integration_tests/tests/data/accounts/search_asset_with_token_type_all_scenario_1/HboN9TsoMSKJAp388G752pSUscb8iZwgdH459KSJxbZT new file mode 100644 index 0000000000000000000000000000000000000000..297d1399760b094a0ab72c4e5015d5939de80a98 GIT binary patch literal 312 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQ{I*nc8^hMKhwXnhUHu_5)wSl|;%e_Z zAJ<-ST&T;=dh`|B-ER-Cr!Jg)^YlZvbFVAc$ZTnS8y{^x(W>WbYu$f_l^Q@ZKFG=g zNd|`hP{0W0F)$WbYu$f_l^Q@ZKFG=g zNd|`hP~fAxSO~-~Y>IZ9!U$q9Ff0Y)n0a&K7jw3Govm$@xU6PqbFaGXzQn`nlf0NE z^8d}Zt&%!#nz%OPZ=RdVX|D&>|DO4skZJq8<)c^+XGh|Tg%a8f-wNc!z@`xEX`>c+x{HNC{CADfZc`XRECz<;(ZD;at%BqD~e2mE34ex{8F>gZ5bdwBO~KKMqo&e0$PRu E0Dv=Z@Bjb+ literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_fungible/7EYnhQoR9YM3N7UoaKRoA44Uy8JeaZV3qyouov87awMs b/integration_tests/tests/data/accounts/search_asset_with_token_type_fungible/7EYnhQoR9YM3N7UoaKRoA44Uy8JeaZV3qyouov87awMs new file mode 100644 index 0000000000000000000000000000000000000000..6792b47e9633da907c59b15e580112fa30a21f84 GIT binary patch literal 224 zcmY#jfB*@G34$FTURSP>+0yzpKH7YuRnOPfy8jF-L1zB1-nCp4 zL_>j(?qVSzm!Y9C+HDFW149sq0|fFr!|&Z&@=9de@sBHhggJXo@%mchcR8(S^`umS9qh-I4x)mlLRm7ytkPK}l!; literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/47ackukZJRBkQSufwFnhTkmTzB11Ww8375EDXTwY75wk b/integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/47ackukZJRBkQSufwFnhTkmTzB11Ww8375EDXTwY75wk new file mode 100644 index 0000000000000000000000000000000000000000..8eed7a507ccdc840a354d2f4b2cef0289214c8ed GIT binary patch literal 312 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQ)N|?!oTgP!pu6<-snC;ee!rW?w7n($ z>1-zP&+pFL{S#-q`|aWN)P<98o_^?d?serFnJukv0PwkY+_lQ~}$=LXN&4Cw+o0y<(08=oH$YOZd04=L#MF0Q* literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo b/integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo new file mode 100644 index 0000000000000000000000000000000000000000..ad795443b5eb85b5eedbcb8fd5040ae3ec79758b GIT binary patch literal 224 zcmY#jfB*@G3ZZjryshVdtJFkW=rea_-ONqRy|)^>;5yW1euxOD+VMP z82&>6BbW!Yt0vlQ3Xl^7cYu4Pd{`!_quY8%$C--@zLfJt$Mz;*8OK#2{JRmR}4rp zF#LxCMlg?oVPRFY+Y}%t2*?MC{gln?R<2IHS$$VG?&U6*#GR$lciHR1xdUe{bXTsK OmI>3xz(|a01_l5fdr(>c literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/DVHQquD7pQFUsBoPpW816CU8zQrQCua9mw4Znh9FyKZJ b/integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/DVHQquD7pQFUsBoPpW816CU8zQrQCua9mw4Znh9FyKZJ new file mode 100644 index 0000000000000000000000000000000000000000..1d5d41a533d4823a8a5c92666db41b128a50bfb6 GIT binary patch literal 824 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQ+}X{4RsU1d9o|VrNsRUHkG|?P5S?rm zKAX`}k9l);#!v2o)QyiX*0@^C4XV#(Iea!^M^3TSg1=imw_V)B{6o`C17zlwP$0>` z@E-~o!8`_rJvGs8Q=pvXObiSxZK7e`7U>QbPTf4Z^w_4Wx8|mtpZ?L?AUHUQd1tBK z^r%wFuy-k)Tx)~Er6)O0Uirad>FqQ@1F2Y7nCODWG3quX9CImykh;_ z)RM%M#F9jPkkNWs#rb*21`jy<3nL>i5E=3}i`g5;?q^d?k=`7CY{G@rO!o8aHm=Nm zYhw7{aQ8!9Mg|wBHFoMb*T2|luG}j1C5c%jB>m}1lg{T%e_IkCh;YwiNMU4T{KLq? z$oNG$*X>_}L}*&@iHD8>KiKllT>odLY%%9^@t*2ue5N4`42%qn{xNf#Z)~hNVVCoG geq|2F`yU;dbME;bky-mo-6DRKLeYQ+47D8q03z$D1^@s6 literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/ELNshcVjEgQ6nSsogWEQjRTr9EaEHJzKcSenqe2kyx5J b/integration_tests/tests/data/accounts/search_asset_with_token_type_non_fungible/ELNshcVjEgQ6nSsogWEQjRTr9EaEHJzKcSenqe2kyx5J new file mode 100644 index 0000000000000000000000000000000000000000..b289d901c3007f12845f186f81720d691f110540 GIT binary patch literal 824 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQJSMm4T9b?W`Mu`TJ0EgBHI{h3|5wGc zV?x``+vbJ4?_=dINZt7OVvVcC+@ShwmcwTwcH|UGE%>|DbKAu|%s({UG(cu<2?df2 z4F92k5zJ#?;HZvvn*!x5XJTMrX%h|ewn%rlaO&pKrN=g1y)`%G{Pd6B2EoBe%sWf< zrbl(&SbyqEOLeJ>N7Kd6C*%cxJYFLt?cy8IvF_)zsp0R+6@Uf@d-`}f`}-*WbYu$f_l^Q@ZKFG=g zNd|`hP{0W0F)+l`M!QXca+U(cN+rYIrF3$w4GNc@<-h{K={r2#B>cYu4Pd{`!_quY8%$C--@zLfJt$Mz;*8OK#2{JRmR}4rp zF#LxCMlg?oAvPu2Z3>VR1muInJa&DN*Vz-hKQ8&rzSwP+{SW;v#~fag=iqlRaK>@D P3xY6x42;C6W?%pS2dPnF literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB b/integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB new file mode 100644 index 0000000000000000000000000000000000000000..3ddf0b59ea2f876da965d8e8eaef1c09dcbbc445 GIT binary patch literal 224 zcmY#jfB*@G30CV5m+3NHA9`{(DOstGrfbW!~ebR-0OPt zm(+RF#I+%R^W0QUdp)TB_ss8vOxx!zAH{k&I}%?kl+cEm3!=9qcCUyL*?(W`$QtLL j?;oa5?Uc#)h*~4b*!X+RfftIKn4oR|Q!tIlVtCj9?M+~D literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/7sVGLDmpnYqX5EvTg7i3tpRNEugeaUyDC9HtPSb3V3DS b/integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/7sVGLDmpnYqX5EvTg7i3tpRNEugeaUyDC9HtPSb3V3DS new file mode 100644 index 0000000000000000000000000000000000000000..3b1a7b0728aa663708c67cc1ba93477e80f09044 GIT binary patch literal 824 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQOcRy6pJDZPYW44B#S_XiPA~*sUUkaw z$0QS}_f8wvK9uAxNZt7OVvVcC+@ShwmcwTwcH|UGE%>|DbKAu|%s({UG(cu<2?df2 z4F92k5zJ#?2u+H1n*!x5XJTMrX%h|ewn%rlaO&pKrN=g1y)`%G{Pd6B2EoBe%sWf< zrbp@AFG$nx;@>$Vus9-XhC0ik=ZCUqdIwjB|9joJ*Y)Nv1)#yfo<5$={(cI|Mi$1V zP>YZ$E~pxa*a;w&QBqP+Y^ATCoRX)Pk(!f}pPQebrGK}PFk73b$68$96bFN}=9KxD|@EM{*UyPr)pMS64mu?ZJeGuh9x+qg3O zt%>1(!`%;c85vxh*4U}%T>oOHxpJ%2mn3GDko2c3O*)@5{cTBnAi_P5A%&5V@joLA zBjXq4T(^G>5}|3qCmuQm{9wyFbN!#0vc;Uw#e1rs@tKA&FfcMO`p3*|zOk|9gk8?# g`IR{w?|*b;&bjA%L}u+Tb&L2_3Pl4RFw}Mc0P3r&2><{9 literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/CyyZ43boZTaP4mJsbTVUpinFJGMQXSMstJvDeatpEo4S b/integration_tests/tests/data/accounts/search_asset_with_token_type_regular_nft/CyyZ43boZTaP4mJsbTVUpinFJGMQXSMstJvDeatpEo4S new file mode 100644 index 0000000000000000000000000000000000000000..4472fc8c03a68646bec5bd5c111f181b8503b5dc GIT binary patch literal 824 zcmY#jfB*@G90nE!4+a$=H-NzfNJap00)qsQ+{DQ?!zg9R=8oWJ`Nr>}1Ni4%yjO4A zAMtI?`le^ji>`AQq;7nCvBuS6Zcu$T%i*&TJ93Jp7X01nx$WW}<{z4F8Xz;bgaSzh zhW}8&2<9;`98HOKn*!x5XJTMrX%h|ewn%rlaO&pKrN=g1y)`%G{Pd6B2EoBe%sWf< zrbo%__-QS>Xu0@}HaD(C=`!z5U3$R!S%vq2eQvncaeuNLfm9eaxH?ze~6Qx{IYdHSK-x!09zWVW=vjgK~;Xw~zzweCN|N)4bHA7tf$ zBm={LC}0Hh7#KQIqur)JIZJ_JGCO`+%Pv|jexuEeYf-w)yHl4QuzptIJz$?3Zod1# zn{cV~rip7q{^q%9F;|U{-b+K-0`i{L7^=N1;y$%s1i5; literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/largest_token_account_ids/AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk/AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk b/integration_tests/tests/data/largest_token_account_ids/AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk/AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk new file mode 100644 index 000000000..7bc1e9a00 --- /dev/null +++ b/integration_tests/tests/data/largest_token_account_ids/AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk/AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk @@ -0,0 +1 @@ +.BŽQ–*pp-¥ëÊUÉìûîž·„gå›óîÏ>þ \ No newline at end of file diff --git a/integration_tests/tests/data/transactions/search_asset_with_token_type_all_scenario_2/4URwUGBjbsF7UBUYdSC546tnBy7nD67txsso8D9CR9kGLtbbYh9NkGw15tEp16LLasmJX5VQR4Seh8gDjTrtdpoC b/integration_tests/tests/data/transactions/search_asset_with_token_type_all_scenario_2/4URwUGBjbsF7UBUYdSC546tnBy7nD67txsso8D9CR9kGLtbbYh9NkGw15tEp16LLasmJX5VQR4Seh8gDjTrtdpoC new file mode 100644 index 0000000000000000000000000000000000000000..a9f81afe7eb5943d62b734b68c5c60f647ea46f0 GIT binary patch literal 4008 zcmd5;c|4T+8h;stlzqufy_O~|idmSM;}ph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Qt zp=}ah`dGf!r3g-lJZxImjw zC=3aXWOJfJGa~(1bgftrCrn1PI;j-XYTD*MdLKurF2Op?Z-{86J|C8$v@fF+V1n7?%|Gx*Kr{xm;^zmXk-LuE5wU>Eq3w&g0lItN2i8EF6@Gi)f- znE?n-rN#4fQe3W91t6$KgQ;Zj2$<<>E_IsnMTfp-)_N|vn3Cfkl}i?tO5^;&xqLA` zC5DT0B?SdSEKin8=SZ_@0tuRwlgw8#3MEC^61JEl!C5p;0Zlutm6RE^n9KcXt50Kbk-D#Sj5|hW*J}ivo~fokXI*GIdI1>Qxbs;Yf&Dp}>qHK;q>^*zfB<7j84_ zzw&?l&(vD9T!km7|LZuB29E>c3vY_poZewmj%jJY4%+Z2IrYvFhXCQ|y$#iS)2KK4 z{yr!uB{K`HAG|f@WGL=2aJRM0TkjgSn}(@K?mhuu1fA#~{&0BL!|w#OF1}3VY+qe< z9VMhkEyK<~;1PCi2J0>T;##|LDr~bV<*?m1_f6W;LP$w0?pe z>6;+_=;~;*%~>p;li?}dMf!Sa4URs4JM8pjT|4u; z8?W5$Aa}ZYbiP?oY_;6!UX{V^bIXGzDeZ5*{rKi}M@jlZnN!J*SdY!*5@#C?c4Dx* jn9Hdal;oIR=oFn+Xk9;idXm@J-9#Q;7Dm+a|Fz!$y1`aO literal 0 HcmV?d00001 diff --git a/integration_tests/tests/data/transactions/search_asset_with_token_type_compressed/4URwUGBjbsF7UBUYdSC546tnBy7nD67txsso8D9CR9kGLtbbYh9NkGw15tEp16LLasmJX5VQR4Seh8gDjTrtdpoC b/integration_tests/tests/data/transactions/search_asset_with_token_type_compressed/4URwUGBjbsF7UBUYdSC546tnBy7nD67txsso8D9CR9kGLtbbYh9NkGw15tEp16LLasmJX5VQR4Seh8gDjTrtdpoC new file mode 100644 index 0000000000000000000000000000000000000000..a9f81afe7eb5943d62b734b68c5c60f647ea46f0 GIT binary patch literal 4008 zcmd5;c|4T+8h;stlzqufy_O~|idmSM;}phlWX%{`rG{AyW-;?l=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lJZxImjw zC=3aXWOJfJGa~(1bgftrCrn1PI;j-XYTD*MdLKurF2Op?Z-{86J|C8$v@fF+V1n7?%|Gx*Kr{xm;^zmXk-LuE5wU>Eq3w&g0lItN2i8EF6@Gi)f- znE?n-rN#4fQe3W91t6$KgQ;Zj2$<<>E_IsnMTfp-)_N|vn3Cfkl}i?tO5^;&xqLA` zC5DT0B?SdSEKin8=SZ_@0tuRwlgw8#3MEC^61JEl!C5p;0Zlutm6RE^n9KcXt50Kbk-D#Sj5|hW*J}ivo~fokXI*GIdI1>Qxbs;Yf&Dp}>qHK;q>^*zfB<7j84_ zzw&?l&(vD9T!km7|LZuB29E>c3vY_poZewmj%jJY4%+Z2IrYvFhXCQ|y$#iS)2KK4 z{yr!uB{K`HAG|f@WGL=2aJRM0TkjgSn}(@K?mhuu1fA#~{&0BL!|w#OF1}3VY+qe< z9VMhkEyK<~;1PCi2J0>T;##|LDr~bV<*?m1_f6W;LP$w0?pe z>6;+_=;~;*%~>p;li?}dMf!Sa4URs4JM8pjT|4u; z8?W5$Aa}ZYbiP?oY_;6!UX{V^bIXGzDeZ5*{rKi}M@jlZnN!J*SdY!*5@#C?c4Dx* jn9Hdal;oIR=oFn+Xk9;idXm@J-9#Q;7Dm+a|Fz!$y1`aO literal 0 HcmV?d00001 diff --git a/integration_tests/tests/integration_tests/main.rs b/integration_tests/tests/integration_tests/main.rs index 01142197a..bdaab6bcb 100644 --- a/integration_tests/tests/integration_tests/main.rs +++ b/integration_tests/tests/integration_tests/main.rs @@ -9,3 +9,4 @@ mod regular_nft_tests; mod show_inscription_flag_tests; mod test_show_zero_balance_filter; mod token_accounts_tests; +mod token_type_filter_test; diff --git a/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_all_scenario_1.snap b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_all_scenario_1.snap new file mode 100644 index 000000000..5ec1ed76d --- /dev/null +++ b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_all_scenario_1.snap @@ -0,0 +1,148 @@ +--- +source: integration_tests/tests/integration_tests/token_type_filter_test.rs +expression: response +snapshot_kind: text +--- +{ + "total": 2, + "limit": 2, + "page": 1, + "items": [ + { + "interface": "ProgrammableNFT", + "id": "8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://cdn.hellomoon.io/public/silicons/metadata/1466.json", + "files": [], + "metadata": { + "name": "SILICON #1466", + "symbol": "SILI", + "token_standard": "ProgrammableNonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "A2QW89tFNDkkdvJv671tdknAyA21u6hvS7HTUyeMWnf3", + "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": "HS1oygRKNBG1nMqjSmaBXSQqQ7apWr14gUU4pW3aDMCP" + } + ], + "royalty": { + "royalty_model": "creators", + "target": null, + "percent": 0.05, + "basis_points": 500, + "primary_sale_happened": true, + "locked": false + }, + "creators": [ + { + "address": "8X2e7Lf3wmA9RPHpPH73kmTqqHHyZE9BcED6Y6TWaZCx", + "share": 0, + "verified": true + }, + { + "address": "5bTgyaCCRNCem3DZXxdRREyesduc6adqwks8rRWGXx8D", + "share": 100, + "verified": false + } + ], + "ownership": { + "frozen": true, + "delegated": true, + "delegate": "D98f1ebFe6kfZTcztLo1iPeKAwogbWHAgXzgSpdRDiu7", + "ownership_model": "single", + "owner": "2oerfxddTpK5hWAmCMYB6fr9WvNrjEH54CHCWK8sAq7g" + }, + "mutable": true, + "burnt": false + }, + { + "interface": "ProgrammableNFT", + "id": "42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://cdn.hellomoon.io/public/silicons/metadata/2835.json", + "files": [], + "metadata": { + "name": "SILICON #2835", + "symbol": "SILI", + "token_standard": "ProgrammableNonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "A2QW89tFNDkkdvJv671tdknAyA21u6hvS7HTUyeMWnf3", + "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": "HS1oygRKNBG1nMqjSmaBXSQqQ7apWr14gUU4pW3aDMCP" + } + ], + "royalty": { + "royalty_model": "creators", + "target": null, + "percent": 0.05, + "basis_points": 500, + "primary_sale_happened": true, + "locked": false + }, + "creators": [ + { + "address": "8X2e7Lf3wmA9RPHpPH73kmTqqHHyZE9BcED6Y6TWaZCx", + "share": 0, + "verified": true + }, + { + "address": "5bTgyaCCRNCem3DZXxdRREyesduc6adqwks8rRWGXx8D", + "share": 100, + "verified": false + } + ], + "ownership": { + "frozen": true, + "delegated": true, + "delegate": "D98f1ebFe6kfZTcztLo1iPeKAwogbWHAgXzgSpdRDiu7", + "ownership_model": "single", + "owner": "2oerfxddTpK5hWAmCMYB6fr9WvNrjEH54CHCWK8sAq7g" + }, + "mutable": true, + "burnt": false + } + ] +} diff --git a/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_all_scenario_2.snap b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_all_scenario_2.snap new file mode 100644 index 000000000..e04779119 --- /dev/null +++ b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_all_scenario_2.snap @@ -0,0 +1,80 @@ +--- +source: integration_tests/tests/integration_tests/token_type_filter_test.rs +expression: response +snapshot_kind: text +--- +{ + "total": 1, + "limit": 2, + "page": 1, + "items": [ + { + "interface": "V1_NFT", + "id": "7myVr8fEG52mZ3jAwgz88iQRWsuzuVR2nfH8n2AXnBxE", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://arweave.net/S40vvBVuCvZhAWI3kvk3QreUqVAvR0AaUDObOhB8WIY", + "files": [], + "metadata": { + "name": "Golden Azurite", + "symbol": "OEAs", + "token_standard": "NonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "EDAR6p4AUbv9SpD1pDm3gxdSAivdqsHxsf6V9pBc532U", + "scopes": [ + "full" + ] + } + ], + "compression": { + "eligible": false, + "compressed": true, + "data_hash": "B2tu4duCUPequnXh7DxbMnLeLcACHbDCQn3g34s5Cvbx", + "creator_hash": "6UiSCAv4r66MALaqhNE7qdTK84qKk1yJqR4UYtT8qEQ1", + "asset_hash": "8EBnZHUKKB2Vdef34H4L3nxYKkf5RPwCkoHBVLAAM2zN", + "tree": "4r2zZHZvC4Se1KUcCcyCM4ZoFQNGZm2M5FMmUypFocAP", + "seq": 39, + "leaf_id": 5 + }, + "grouping": [ + { + "group_key": "collection", + "group_value": "BwwjnxTHeVWdFieDWmoezta19q1NiwcNNyoon9S38bkM" + } + ], + "royalty": { + "royalty_model": "creators", + "target": null, + "percent": 0.05, + "basis_points": 500, + "primary_sale_happened": true, + "locked": false + }, + "creators": [ + { + "address": "4gETqgEwFLkXX9yk6qBszA6LMjC2kRyyERXsAr2rwhwf", + "share": 100, + "verified": false + } + ], + "ownership": { + "frozen": false, + "delegated": false, + "delegate": null, + "ownership_model": "single", + "owner": "53VVFtLzzi3nL2p1QF591PAB8rbcbsirYepwUphtHU9Q" + }, + "supply": { + "print_max_supply": 0, + "print_current_supply": 0, + "edition_nonce": null + }, + "mutable": true, + "burnt": false + } + ] +} diff --git a/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_compressed.snap b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_compressed.snap new file mode 100644 index 000000000..e04779119 --- /dev/null +++ b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_compressed.snap @@ -0,0 +1,80 @@ +--- +source: integration_tests/tests/integration_tests/token_type_filter_test.rs +expression: response +snapshot_kind: text +--- +{ + "total": 1, + "limit": 2, + "page": 1, + "items": [ + { + "interface": "V1_NFT", + "id": "7myVr8fEG52mZ3jAwgz88iQRWsuzuVR2nfH8n2AXnBxE", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://arweave.net/S40vvBVuCvZhAWI3kvk3QreUqVAvR0AaUDObOhB8WIY", + "files": [], + "metadata": { + "name": "Golden Azurite", + "symbol": "OEAs", + "token_standard": "NonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "EDAR6p4AUbv9SpD1pDm3gxdSAivdqsHxsf6V9pBc532U", + "scopes": [ + "full" + ] + } + ], + "compression": { + "eligible": false, + "compressed": true, + "data_hash": "B2tu4duCUPequnXh7DxbMnLeLcACHbDCQn3g34s5Cvbx", + "creator_hash": "6UiSCAv4r66MALaqhNE7qdTK84qKk1yJqR4UYtT8qEQ1", + "asset_hash": "8EBnZHUKKB2Vdef34H4L3nxYKkf5RPwCkoHBVLAAM2zN", + "tree": "4r2zZHZvC4Se1KUcCcyCM4ZoFQNGZm2M5FMmUypFocAP", + "seq": 39, + "leaf_id": 5 + }, + "grouping": [ + { + "group_key": "collection", + "group_value": "BwwjnxTHeVWdFieDWmoezta19q1NiwcNNyoon9S38bkM" + } + ], + "royalty": { + "royalty_model": "creators", + "target": null, + "percent": 0.05, + "basis_points": 500, + "primary_sale_happened": true, + "locked": false + }, + "creators": [ + { + "address": "4gETqgEwFLkXX9yk6qBszA6LMjC2kRyyERXsAr2rwhwf", + "share": 100, + "verified": false + } + ], + "ownership": { + "frozen": false, + "delegated": false, + "delegate": null, + "ownership_model": "single", + "owner": "53VVFtLzzi3nL2p1QF591PAB8rbcbsirYepwUphtHU9Q" + }, + "supply": { + "print_max_supply": 0, + "print_current_supply": 0, + "edition_nonce": null + }, + "mutable": true, + "burnt": false + } + ] +} diff --git a/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_fungible.snap b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_fungible.snap new file mode 100644 index 000000000..1548f35ba --- /dev/null +++ b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_fungible.snap @@ -0,0 +1,64 @@ +--- +source: integration_tests/tests/integration_tests/token_type_filter_test.rs +expression: response +snapshot_kind: text +--- +{ + "total": 1, + "limit": 1, + "page": 1, + "items": [ + { + "interface": "FungibleToken", + "id": "7EYnhQoR9YM3N7UoaKRoA44Uy8JeaZV3qyouov87awMs", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://gateway.irys.xyz/P8X64pGutyX5eyTpQmqZr3H4_Lqhm0IYxr5SyzFFNek", + "files": [], + "metadata": { + "name": "Silly Dragon", + "symbol": "SILLY", + "token_standard": "Fungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "38qZKCqcphT5wDrVNJGHYcuenjEtEFPitvrqvMFQkPu7", + "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": true, + "locked": false + }, + "creators": [], + "ownership": { + "frozen": false, + "delegated": false, + "delegate": null, + "ownership_model": "token", + "owner": "" + }, + "mutable": true, + "burnt": false + } + ] +} diff --git a/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_non_fungible.snap b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_non_fungible.snap new file mode 100644 index 000000000..106e0ca51 --- /dev/null +++ b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_non_fungible.snap @@ -0,0 +1,148 @@ +--- +source: integration_tests/tests/integration_tests/token_type_filter_test.rs +expression: response +snapshot_kind: text +--- +{ + "total": 2, + "limit": 2, + "page": 1, + "items": [ + { + "interface": "ProgrammableNFT", + "id": "AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://cdn.hellomoon.io/public/silicons/metadata/4515.json", + "files": [], + "metadata": { + "name": "SILICON #4515", + "symbol": "SILI", + "token_standard": "ProgrammableNonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "A2QW89tFNDkkdvJv671tdknAyA21u6hvS7HTUyeMWnf3", + "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": "HS1oygRKNBG1nMqjSmaBXSQqQ7apWr14gUU4pW3aDMCP" + } + ], + "royalty": { + "royalty_model": "creators", + "target": null, + "percent": 0.05, + "basis_points": 500, + "primary_sale_happened": true, + "locked": false + }, + "creators": [ + { + "address": "8X2e7Lf3wmA9RPHpPH73kmTqqHHyZE9BcED6Y6TWaZCx", + "share": 0, + "verified": true + }, + { + "address": "5bTgyaCCRNCem3DZXxdRREyesduc6adqwks8rRWGXx8D", + "share": 100, + "verified": false + } + ], + "ownership": { + "frozen": true, + "delegated": true, + "delegate": "D98f1ebFe6kfZTcztLo1iPeKAwogbWHAgXzgSpdRDiu7", + "ownership_model": "single", + "owner": "2oerfxddTpK5hWAmCMYB6fr9WvNrjEH54CHCWK8sAq7g" + }, + "mutable": true, + "burnt": false + }, + { + "interface": "ProgrammableNFT", + "id": "8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://cdn.hellomoon.io/public/silicons/metadata/1466.json", + "files": [], + "metadata": { + "name": "SILICON #1466", + "symbol": "SILI", + "token_standard": "ProgrammableNonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "A2QW89tFNDkkdvJv671tdknAyA21u6hvS7HTUyeMWnf3", + "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": "HS1oygRKNBG1nMqjSmaBXSQqQ7apWr14gUU4pW3aDMCP" + } + ], + "royalty": { + "royalty_model": "creators", + "target": null, + "percent": 0.05, + "basis_points": 500, + "primary_sale_happened": true, + "locked": false + }, + "creators": [ + { + "address": "8X2e7Lf3wmA9RPHpPH73kmTqqHHyZE9BcED6Y6TWaZCx", + "share": 0, + "verified": true + }, + { + "address": "5bTgyaCCRNCem3DZXxdRREyesduc6adqwks8rRWGXx8D", + "share": 100, + "verified": false + } + ], + "ownership": { + "frozen": true, + "delegated": true, + "delegate": "D98f1ebFe6kfZTcztLo1iPeKAwogbWHAgXzgSpdRDiu7", + "ownership_model": "single", + "owner": "2oerfxddTpK5hWAmCMYB6fr9WvNrjEH54CHCWK8sAq7g" + }, + "mutable": true, + "burnt": false + } + ] +} diff --git a/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_regular_nft.snap b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_regular_nft.snap new file mode 100644 index 000000000..9e4bed34d --- /dev/null +++ b/integration_tests/tests/integration_tests/snapshots/integration_tests__token_type_filter_test__search_asset_with_token_type_regular_nft.snap @@ -0,0 +1,148 @@ +--- +source: integration_tests/tests/integration_tests/token_type_filter_test.rs +expression: response +snapshot_kind: text +--- +{ + "total": 2, + "limit": 2, + "page": 1, + "items": [ + { + "interface": "ProgrammableNFT", + "id": "42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://cdn.hellomoon.io/public/silicons/metadata/2835.json", + "files": [], + "metadata": { + "name": "SILICON #2835", + "symbol": "SILI", + "token_standard": "ProgrammableNonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "A2QW89tFNDkkdvJv671tdknAyA21u6hvS7HTUyeMWnf3", + "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": "HS1oygRKNBG1nMqjSmaBXSQqQ7apWr14gUU4pW3aDMCP" + } + ], + "royalty": { + "royalty_model": "creators", + "target": null, + "percent": 0.05, + "basis_points": 500, + "primary_sale_happened": true, + "locked": false + }, + "creators": [ + { + "address": "8X2e7Lf3wmA9RPHpPH73kmTqqHHyZE9BcED6Y6TWaZCx", + "share": 0, + "verified": true + }, + { + "address": "5bTgyaCCRNCem3DZXxdRREyesduc6adqwks8rRWGXx8D", + "share": 100, + "verified": false + } + ], + "ownership": { + "frozen": true, + "delegated": true, + "delegate": "D98f1ebFe6kfZTcztLo1iPeKAwogbWHAgXzgSpdRDiu7", + "ownership_model": "single", + "owner": "2oerfxddTpK5hWAmCMYB6fr9WvNrjEH54CHCWK8sAq7g" + }, + "mutable": true, + "burnt": false + }, + { + "interface": "ProgrammableNFT", + "id": "2w81QrLYTwSDkNwXgCqKAwrC1Tu6R9mh9BHcxys2Bup2", + "content": { + "$schema": "https://schema.metaplex.com/nft1.0.json", + "json_uri": "https://cdn.hellomoon.io/public/silicons/metadata/4685.json", + "files": [], + "metadata": { + "name": "SILICON #4685", + "symbol": "SILI", + "token_standard": "ProgrammableNonFungible" + }, + "links": {} + }, + "authorities": [ + { + "address": "A2QW89tFNDkkdvJv671tdknAyA21u6hvS7HTUyeMWnf3", + "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": "HS1oygRKNBG1nMqjSmaBXSQqQ7apWr14gUU4pW3aDMCP" + } + ], + "royalty": { + "royalty_model": "creators", + "target": null, + "percent": 0.05, + "basis_points": 500, + "primary_sale_happened": true, + "locked": false + }, + "creators": [ + { + "address": "8X2e7Lf3wmA9RPHpPH73kmTqqHHyZE9BcED6Y6TWaZCx", + "share": 0, + "verified": true + }, + { + "address": "5bTgyaCCRNCem3DZXxdRREyesduc6adqwks8rRWGXx8D", + "share": 100, + "verified": false + } + ], + "ownership": { + "frozen": true, + "delegated": true, + "delegate": "D98f1ebFe6kfZTcztLo1iPeKAwogbWHAgXzgSpdRDiu7", + "ownership_model": "single", + "owner": "2oerfxddTpK5hWAmCMYB6fr9WvNrjEH54CHCWK8sAq7g" + }, + "mutable": true, + "burnt": false + } + ] +} diff --git a/integration_tests/tests/integration_tests/token_type_filter_test.rs b/integration_tests/tests/integration_tests/token_type_filter_test.rs new file mode 100644 index 000000000..28e83bebe --- /dev/null +++ b/integration_tests/tests/integration_tests/token_type_filter_test.rs @@ -0,0 +1,220 @@ +use function_name::named; + +use das_api::api::{self, ApiContract}; + +use itertools::Itertools; + +use serial_test::serial; + +use super::common::*; + +#[tokio::test] +#[serial] +#[named] +async fn test_search_asset_with_token_type_regular_nft() { + let name = trim_test_name(function_name!()); + let setup = TestSetup::new_with_options( + name.clone(), + TestSetupOptions { + network: Some(Network::Mainnet), + }, + ) + .await; + + let seeds: Vec = seed_nfts([ + "42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB", + "2w81QrLYTwSDkNwXgCqKAwrC1Tu6R9mh9BHcxys2Bup2", + ]); + + apply_migrations_and_delete_data(setup.db.clone()).await; + index_seed_events(&setup, seeds.iter().collect_vec()).await; + + let request = r#" + { + "ownerAddress": "2oerfxddTpK5hWAmCMYB6fr9WvNrjEH54CHCWK8sAq7g", + "page": 1, + "limit": 2, + "tokenType": "Nft" + } + "#; + + let request: api::SearchAssets = serde_json::from_str(request).unwrap(); + let response = setup.das_api.search_assets(request).await.unwrap(); + insta::assert_json_snapshot!(name, response); +} + +#[tokio::test] +#[serial] +#[named] +async fn test_search_asset_with_token_type_non_fungible() { + let name = trim_test_name(function_name!()); + let setup = TestSetup::new_with_options( + name.clone(), + TestSetupOptions { + network: Some(Network::Mainnet), + }, + ) + .await; + + let seeds: Vec = seed_nfts([ + "AH6VcoSbCGGv8BHeN7K766VUWMcdFRTaXpLvGTLSdAmk", + "8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo", + ]); + + apply_migrations_and_delete_data(setup.db.clone()).await; + index_seed_events(&setup, seeds.iter().collect_vec()).await; + + let request = r#" + { + "ownerAddress": "2oerfxddTpK5hWAmCMYB6fr9WvNrjEH54CHCWK8sAq7g", + "page": 1, + "limit": 2, + "tokenType": "NonFungible" + } + "#; + + let request: api::SearchAssets = serde_json::from_str(request).unwrap(); + let response = setup.das_api.search_assets(request).await.unwrap(); + insta::assert_json_snapshot!(name, response); +} + +#[tokio::test] +#[serial] +#[named] +async fn test_search_asset_with_token_type_compressed() { + let name = trim_test_name(function_name!()); + let setup = TestSetup::new_with_options( + name.clone(), + TestSetupOptions { + network: Some(Network::Mainnet), + }, + ) + .await; + + let seeds: Vec = seed_txns([ + "4nKDSvw2kGpccZWLEPnfdP7J1SEexQFRP3xWc9NBtQ1qQeGu3bu5WnAdpcLbjQ4iyX6BQ5QGF69wevE8ZeeY5poA", + "4URwUGBjbsF7UBUYdSC546tnBy7nD67txsso8D9CR9kGLtbbYh9NkGw15tEp16LLasmJX5VQR4Seh8gDjTrtdpoC", + ]); + + apply_migrations_and_delete_data(setup.db.clone()).await; + index_seed_events(&setup, seeds.iter().collect_vec()).await; + + let request = r#" + { + "ownerAddress": "53VVFtLzzi3nL2p1QF591PAB8rbcbsirYepwUphtHU9Q", + "page": 1, + "limit": 2, + "tokenType": "Compressed" + } + "#; + + let request: api::SearchAssets = serde_json::from_str(request).unwrap(); + let response = setup.das_api.search_assets(request).await.unwrap(); + insta::assert_json_snapshot!(name, response); +} + +#[tokio::test] +#[serial] +#[named] +async fn test_search_asset_with_token_type_all_scenario_1() { + let name = trim_test_name(function_name!()); + let setup = TestSetup::new_with_options( + name.clone(), + TestSetupOptions { + network: Some(Network::Mainnet), + }, + ) + .await; + + let seeds: Vec = seed_nfts([ + "42AYryUGNmJMe9ycBXZekkYvdTehgbtECHs7SLu5JJTB", + "8t77ShMViat27Sjphvi1FVPaGrhFcttPAkEnLCFp49Bo", + ]); + + apply_migrations_and_delete_data(setup.db.clone()).await; + index_seed_events(&setup, seeds.iter().collect_vec()).await; + + let request = r#" + { + "ownerAddress": "2oerfxddTpK5hWAmCMYB6fr9WvNrjEH54CHCWK8sAq7g", + "page": 1, + "limit": 2, + "tokenType": "All" + } + "#; + + let request: api::SearchAssets = serde_json::from_str(request).unwrap(); + let response = setup.das_api.search_assets(request).await.unwrap(); + insta::assert_json_snapshot!(name, response); +} + +#[tokio::test] +#[serial] +#[named] +async fn test_search_asset_with_token_type_all_scenario_2() { + let name = trim_test_name(function_name!()); + let setup = TestSetup::new_with_options( + name.clone(), + TestSetupOptions { + network: Some(Network::Mainnet), + }, + ) + .await; + + let seeds: Vec = seed_txns([ + "4nKDSvw2kGpccZWLEPnfdP7J1SEexQFRP3xWc9NBtQ1qQeGu3bu5WnAdpcLbjQ4iyX6BQ5QGF69wevE8ZeeY5poA", + "4URwUGBjbsF7UBUYdSC546tnBy7nD67txsso8D9CR9kGLtbbYh9NkGw15tEp16LLasmJX5VQR4Seh8gDjTrtdpoC", + ]); + + apply_migrations_and_delete_data(setup.db.clone()).await; + index_seed_events(&setup, seeds.iter().collect_vec()).await; + + let request = r#" + { + "ownerAddress": "53VVFtLzzi3nL2p1QF591PAB8rbcbsirYepwUphtHU9Q", + "page": 1, + "limit": 2, + "tokenType": "All" + } + "#; + + let request: api::SearchAssets = serde_json::from_str(request).unwrap(); + let response = setup.das_api.search_assets(request).await.unwrap(); + insta::assert_json_snapshot!(name, response); +} + +#[tokio::test] +#[serial] +#[named] +async fn test_search_asset_with_token_type_fungible() { + let name = trim_test_name(function_name!()); + let setup = TestSetup::new_with_options( + name.clone(), + TestSetupOptions { + network: Some(Network::Mainnet), + }, + ) + .await; + + let seeds: Vec = seed_accounts([ + "7EYnhQoR9YM3N7UoaKRoA44Uy8JeaZV3qyouov87awMs", + "7BajpcYgnxmWK91RhrfsdB3Tm83PcDwPvMC8ZinvtTY6", + "6BRNfDfdq1nKyU1TQiCEQLWyPtD8EwUH9Kt2ahsbidUx", + ]); + + apply_migrations_and_delete_data(setup.db.clone()).await; + index_seed_events(&setup, seeds.iter().collect_vec()).await; + + let request = r#" + { + "ownerAddress": "2oerfxddTpK5hWAmCMYB6fr9WvNrjEH54CHCWK8sAq7g", + "page": 1, + "limit": 1, + "tokenType": "Fungible" + } + "#; + + let request: api::SearchAssets = serde_json::from_str(request).unwrap(); + let response = setup.das_api.search_assets(request).await.unwrap(); + insta::assert_json_snapshot!(name, response); +}