From 3fc825f600d9ae28e498e7493e1ad16fdec0a61b Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 11 Sep 2024 18:57:49 +0700 Subject: [PATCH] more linting fixes --- .../platform_events/block_fee_processing/tests.rs | 9 +-------- packages/rs-drive/src/drive/identity/fetch/mod.rs | 3 +++ .../src/drive/identity/fetch/queries/mod.rs | 14 ++++++-------- .../mod.rs | 1 - .../v0/mod.rs | 1 - packages/rs-sdk/src/platform/fetch_many.rs | 2 +- packages/rs-sdk/src/platform/types/identity.rs | 8 +++----- 7 files changed, 14 insertions(+), 24 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/platform_events/block_fee_processing/tests.rs b/packages/rs-drive-abci/src/execution/platform_events/block_fee_processing/tests.rs index d48d9c30473..0e50baab4f6 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/block_fee_processing/tests.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/block_fee_processing/tests.rs @@ -18,28 +18,21 @@ mod refund_tests { use dpp::data_contract::document_type::DocumentTypeRef; use dpp::document::document_methods::DocumentMethodsV0; use dpp::document::serialization_traits::DocumentPlatformConversionMethodsV0; - use dpp::document::{Document, DocumentV0Getters, DocumentV0Setters}; - use dpp::fee::default_costs::CachedEpochIndexFeeVersions; + use dpp::document::{Document, DocumentV0Setters}; use dpp::fee::fee_result::FeeResult; use dpp::fee::Credits; use dpp::identity::accessors::IdentityGettersV0; use dpp::identity::{Identity, IdentityPublicKey}; use dpp::platform_value::Bytes32; - use dpp::prelude::CoreBlockHeight; use dpp::state_transition::documents_batch_transition::methods::v0::DocumentsBatchTransitionMethodsV0; use dpp::state_transition::documents_batch_transition::DocumentsBatchTransition; use drive::util::test_helpers::setup_contract; - use once_cell::sync::Lazy; use platform_version::version::PlatformVersion; use rand::prelude::StdRng; use rand::SeedableRng; use simple_signer::signer::SimpleSigner; - use std::collections::BTreeMap; use std::ops::Deref; - static EPOCH_CHANGE_FEE_VERSION_TEST: Lazy = - Lazy::new(|| BTreeMap::from([(0, PlatformVersion::first().fee_version.clone())])); - // There's a fee for the first document that a user creates on a contract as they add space // For the identity data contract nonce fn setup_join_contract_document<'a>( diff --git a/packages/rs-drive/src/drive/identity/fetch/mod.rs b/packages/rs-drive/src/drive/identity/fetch/mod.rs index b4b084f61f1..78bdd9c90fd 100644 --- a/packages/rs-drive/src/drive/identity/fetch/mod.rs +++ b/packages/rs-drive/src/drive/identity/fetch/mod.rs @@ -29,7 +29,10 @@ use grovedb::TransactionArg; #[cfg(any(feature = "server", feature = "verify"))] use grovedb::{PathQuery, SizedQuery}; +#[cfg(feature = "server")] use dpp::fee::Credits; + +#[cfg(feature = "server")] use platform_version::version::PlatformVersion; #[cfg(feature = "server")] use std::collections::BTreeMap; diff --git a/packages/rs-drive/src/drive/identity/fetch/queries/mod.rs b/packages/rs-drive/src/drive/identity/fetch/queries/mod.rs index 97770144330..f7832d2274f 100644 --- a/packages/rs-drive/src/drive/identity/fetch/queries/mod.rs +++ b/packages/rs-drive/src/drive/identity/fetch/queries/mod.rs @@ -166,16 +166,14 @@ impl Drive { } else { query.insert_item(QueryItem::RangeFull(RangeFull)) } - } else { - if let Some((start_at, start_at_included)) = start_at { - if start_at_included { - query.insert_item(QueryItem::RangeToInclusive(..=start_at.to_vec())) - } else { - query.insert_item(QueryItem::RangeTo(..start_at.to_vec())) - } + } else if let Some((start_at, start_at_included)) = start_at { + if start_at_included { + query.insert_item(QueryItem::RangeToInclusive(..=start_at.to_vec())) } else { - query.insert_item(QueryItem::RangeFull(RangeFull)) + query.insert_item(QueryItem::RangeTo(..start_at.to_vec())) } + } else { + query.insert_item(QueryItem::RangeFull(RangeFull)) } PathQuery { path: balance_path, diff --git a/packages/rs-drive/src/verify/identity/verify_identity_balances_for_identity_ids/mod.rs b/packages/rs-drive/src/verify/identity/verify_identity_balances_for_identity_ids/mod.rs index 304a834b0a5..553f64661c6 100644 --- a/packages/rs-drive/src/verify/identity/verify_identity_balances_for_identity_ids/mod.rs +++ b/packages/rs-drive/src/verify/identity/verify_identity_balances_for_identity_ids/mod.rs @@ -11,7 +11,6 @@ use crate::verify::RootHash; use dpp::version::PlatformVersion; -use dpp::identifier::Identifier; use std::iter::FromIterator; impl Drive { diff --git a/packages/rs-drive/src/verify/identity/verify_identity_balances_for_identity_ids/v0/mod.rs b/packages/rs-drive/src/verify/identity/verify_identity_balances_for_identity_ids/v0/mod.rs index 397b878d42e..b7742ebbb3c 100644 --- a/packages/rs-drive/src/verify/identity/verify_identity_balances_for_identity_ids/v0/mod.rs +++ b/packages/rs-drive/src/verify/identity/verify_identity_balances_for_identity_ids/v0/mod.rs @@ -6,7 +6,6 @@ use dpp::fee::Credits; use crate::verify::RootHash; -use dpp::identifier::Identifier; use grovedb::GroveDb; use platform_version::version::PlatformVersion; diff --git a/packages/rs-sdk/src/platform/fetch_many.rs b/packages/rs-sdk/src/platform/fetch_many.rs index bb514c2807a..491e3f4067c 100644 --- a/packages/rs-sdk/src/platform/fetch_many.rs +++ b/packages/rs-sdk/src/platform/fetch_many.rs @@ -4,7 +4,7 @@ //! //! ## Traits //! - `[FetchMany]`: An async trait that fetches multiple items of a specific type from Platform. -use super::{Fetch, LimitQuery}; +use super::LimitQuery; use crate::{ error::Error, mock::MockResponse, diff --git a/packages/rs-sdk/src/platform/types/identity.rs b/packages/rs-sdk/src/platform/types/identity.rs index 44ce334ce06..d710afd08de 100644 --- a/packages/rs-sdk/src/platform/types/identity.rs +++ b/packages/rs-sdk/src/platform/types/identity.rs @@ -1,8 +1,6 @@ //! Identity related types and functions use crate::delegate_enum; -use crate::platform::types::epoch::EpochQuery; -use crate::platform::LimitQuery; use crate::{ platform::{proto, Query}, Error, @@ -19,9 +17,9 @@ use dapi_grpc::platform::v0::{ get_identities_balances_request, get_identity_balance_and_revision_request, get_identity_balance_request, get_identity_by_public_key_hash_request, get_identity_contract_nonce_request, get_identity_nonce_request, get_identity_request, - GetEpochsInfoRequest, GetIdentitiesBalancesRequest, GetIdentityBalanceAndRevisionRequest, - GetIdentityBalanceRequest, GetIdentityByPublicKeyHashRequest, GetIdentityContractNonceRequest, - GetIdentityNonceRequest, GetIdentityRequest, ResponseMetadata, + GetIdentitiesBalancesRequest, GetIdentityBalanceAndRevisionRequest, GetIdentityBalanceRequest, + GetIdentityByPublicKeyHashRequest, GetIdentityContractNonceRequest, GetIdentityNonceRequest, + GetIdentityRequest, ResponseMetadata, }; use dpp::prelude::Identity;