diff --git a/postgre-client/tests/asset_filter_client_test.rs b/postgre-client/tests/asset_filter_client_test.rs index 4dd695a4..a4ddb33d 100644 --- a/postgre-client/tests/asset_filter_client_test.rs +++ b/postgre-client/tests/asset_filter_client_test.rs @@ -371,7 +371,11 @@ mod tests { None, None, None, - &GetByMethodsOptions { show_zero_balance: true, ..Default::default() }, + &GetByMethodsOptions { + show_zero_balance: true, + show_unverified_collections: true, + ..Default::default() + }, ) .await .unwrap(); diff --git a/postgre-client/tests/asset_index_client_test.rs b/postgre-client/tests/asset_index_client_test.rs index bfe5d2f9..1779dc31 100644 --- a/postgre-client/tests/asset_index_client_test.rs +++ b/postgre-client/tests/asset_index_client_test.rs @@ -8,6 +8,7 @@ mod tests { use postgre_client::storage_traits::AssetIndexStorage; use rand::Rng; use setup::pg::*; + use solana_sdk::pubkey::Pubkey; use testcontainers::clients::Cli; #[tokio::test] @@ -86,12 +87,12 @@ mod tests { // every asset_index will have 3 creators for asset_index in asset_indexes.iter_mut() { asset_index.creators.push(Creator { - creator: generate_random_pubkey(), + creator: Pubkey::new_unique(), creator_verified: rand::thread_rng().gen_bool(0.5), creator_share: 30, }); asset_index.creators.push(Creator { - creator: generate_random_pubkey(), + creator: Pubkey::new_unique(), creator_verified: rand::thread_rng().gen_bool(0.5), creator_share: 30, }); @@ -119,7 +120,7 @@ mod tests { .map(|asset_index| { let mut ai = asset_index.clone(); ai.creators.pop(); - ai.creators[1].creator = generate_random_pubkey(); + ai.creators[1].creator = Pubkey::new_unique(); ai.creators[0].creator_verified = !ai.creators[0].creator_verified; ai }) diff --git a/tests/setup/src/pg.rs b/tests/setup/src/pg.rs index 30865d33..1e117889 100644 --- a/tests/setup/src/pg.rs +++ b/tests/setup/src/pg.rs @@ -187,24 +187,20 @@ pub fn generate_random_vec(n: usize) -> Vec { random_vector } -pub fn generate_random_pubkey() -> Pubkey { - Pubkey::new_unique() -} - pub fn generate_asset_index_records(n: usize) -> Vec { let mut asset_indexes = Vec::new(); for i in 0..n { let asset_index = AssetIndex { - pubkey: generate_random_pubkey(), + pubkey: Pubkey::new_unique(), specification_version: SpecificationVersions::V1, specification_asset_class: SpecificationAssetClass::Nft, royalty_target_type: RoyaltyTargetType::Creators, royalty_amount: 1, slot_created: (n - i) as i64, - owner: Some(generate_random_pubkey()), - delegate: Some(generate_random_pubkey()), - authority: Some(generate_random_pubkey()), - collection: Some(generate_random_pubkey()), + owner: Some(Pubkey::new_unique()), + delegate: Some(Pubkey::new_unique()), + authority: Some(Pubkey::new_unique()), + collection: Some(Pubkey::new_unique()), is_collection_verified: Some(rand::thread_rng().gen_bool(0.5)), is_burnt: false, is_compressible: false, @@ -218,7 +214,7 @@ pub fn generate_asset_index_records(n: usize) -> Vec { update_authority: None, slot_updated: (n + 10 + i) as i64, creators: vec![Creator { - creator: generate_random_pubkey(), + creator: Pubkey::new_unique(), creator_verified: rand::thread_rng().gen_bool(0.5), creator_share: 100, }], @@ -235,8 +231,8 @@ pub fn generate_fungible_asset_index_records(n: usize) -> Vec