Skip to content

Commit

Permalink
more linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumExplorer committed Sep 11, 2024
1 parent 42c6930 commit 3fc825f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<CachedEpochIndexFeeVersions> =
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>(
Expand Down
3 changes: 3 additions & 0 deletions packages/rs-drive/src/drive/identity/fetch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 6 additions & 8 deletions packages/rs-drive/src/drive/identity/fetch/queries/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::verify::RootHash;

use dpp::version::PlatformVersion;

use dpp::identifier::Identifier;
use std::iter::FromIterator;

impl Drive {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use dpp::fee::Credits;

use crate::verify::RootHash;

use dpp::identifier::Identifier;
use grovedb::GroveDb;
use platform_version::version::PlatformVersion;

Expand Down
2 changes: 1 addition & 1 deletion packages/rs-sdk/src/platform/fetch_many.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 3 additions & 5 deletions packages/rs-sdk/src/platform/types/identity.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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;

Expand Down

0 comments on commit 3fc825f

Please sign in to comment.