Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl DocumentTypeV0Methods for DocumentTypeV0 {
fn top_level_indices(&self) -> Vec<&IndexProperty> {
let mut index_properties: Vec<&IndexProperty> = Vec::with_capacity(self.indices.len());
for index in &self.indices {
if let Some(property) = index.properties.get(0) {
if let Some(property) = index.properties.first() {
index_properties.push(property);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ mod enrich_with_base_schema;
pub use enrich_with_base_schema::*;

mod find_identifier_and_binary_paths;
pub use find_identifier_and_binary_paths::*;

#[cfg(feature = "validation")]
mod recursive_schema_validator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ mod test {
PlatformVersion::first(),
)
.expect("expected traversal validator to succeed");
let consensus_error = result.errors.get(0).expect("the error should be returned");
let consensus_error = result.errors.first().expect("the error should be returned");

match consensus_error {
ConsensusError::BasicError(BasicError::IncompatibleRe2PatternError(err)) => {
Expand Down Expand Up @@ -145,7 +145,7 @@ mod test {
PlatformVersion::first(),
)
.expect("expected traversal validator to exist for first protocol version");
let consensus_error = result.errors.get(0).expect("the error should be returned");
let consensus_error = result.errors.first().expect("the error should be returned");

match consensus_error {
ConsensusError::BasicError(BasicError::IncompatibleRe2PatternError(err)) => {
Expand Down Expand Up @@ -175,7 +175,7 @@ mod test {
PlatformVersion::first(),
)
.expect("expected traversal validator to exist for first protocol version");
let consensus_error = result.errors.get(0).expect("the error should be returned");
let consensus_error = result.errors.first().expect("the error should be returned");

match consensus_error {
ConsensusError::BasicError(BasicError::IncompatibleRe2PatternError(err)) => {
Expand Down
2 changes: 0 additions & 2 deletions packages/rs-dpp/src/data_contract/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ use crate::serialization::{
PlatformLimitDeserializableFromVersionedStructure, PlatformSerializableWithPlatformVersion,
};

pub use data_contract::*;
use derive_more::From;

use bincode::config::{BigEndian, Configuration};
pub use generate_data_contract::*;

pub mod errors;
pub mod extra;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub use invalid_data_contract_version_error::*;
pub use invalid_index_property_type_error::*;
pub use invalid_indexed_property_constraint_error::*;
pub use invalid_json_schema_ref_error::*;
pub use invalid_json_schema_ref_error::*;

pub use system_property_index_already_present_error::*;
pub use undefined_index_property_error::*;
pub use unique_indices_limit_reached_error::*;
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ use thiserror::Error;
#[platform_serialize(unversioned)]
pub struct DocumentTransitionsAreAbsentError {}

impl Default for DocumentTransitionsAreAbsentError {
fn default() -> Self {
Self::new()
}
}

impl DocumentTransitionsAreAbsentError {
pub fn new() -> Self {
Self {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ use bincode::{Decode, Encode};
#[platform_serialize(unversioned)]
pub struct InvalidIdentityUpdateTransitionDisableKeysError;

impl Default for InvalidIdentityUpdateTransitionDisableKeysError {
fn default() -> Self {
Self::new()
}
}

impl InvalidIdentityUpdateTransitionDisableKeysError {
pub fn new() -> Self {
Self {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ use bincode::{Decode, Encode};
#[platform_serialize(unversioned)]
pub struct InvalidIdentityUpdateTransitionEmptyError;

impl Default for InvalidIdentityUpdateTransitionEmptyError {
fn default() -> Self {
Self::new()
}
}

impl InvalidIdentityUpdateTransitionEmptyError {
pub fn new() -> Self {
Self {}
Expand Down
1 change: 0 additions & 1 deletion packages/rs-dpp/src/identity/conversion/cbor/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
mod v0;
pub use v0::*;
3 changes: 1 addition & 2 deletions packages/rs-dpp/src/identity/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pub use credits_converter::*;
pub use credits_converter::*;
pub use get_biggest_possible_identity::*;

pub use identity::*;
#[cfg(feature = "client")]
pub use identity_facade::*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use dashcore::{OutPoint, Transaction};
use serde::{Deserialize, Deserializer, Serialize};

pub use bincode::{Decode, Encode};
pub use chain::*;

pub use instant::*;
use platform_value::Value;
use platform_version::version::PlatformVersion;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::state_transition::state_transitions;

pub use state_transitions::common_fields::property_names::{
ENTROPY, SIGNATURE, SIGNATURE_PUBLIC_KEY_ID, STATE_TRANSITION_PROTOCOL_VERSION, TRANSITION_TYPE,
ENTROPY, SIGNATURE, SIGNATURE_PUBLIC_KEY_ID, STATE_TRANSITION_PROTOCOL_VERSION,
};
pub use state_transitions::contract::common_fields::property_names::{
DATA_CONTRACT, DATA_CONTRACT_ENTROPY, DATA_CONTRACT_ID, DATA_CONTRACT_OWNER_ID,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::state_transition::state_transitions;

pub use state_transitions::common_fields::property_names::{
ENTROPY, SIGNATURE, SIGNATURE_PUBLIC_KEY_ID, STATE_TRANSITION_PROTOCOL_VERSION, TRANSITION_TYPE,
SIGNATURE, STATE_TRANSITION_PROTOCOL_VERSION,
};
pub use state_transitions::identity::common_fields::property_names::{
ASSET_LOCK_PROOF, IDENTITY_ID, PUBLIC_KEYS, PUBLIC_KEYS_DATA, PUBLIC_KEYS_SIGNATURE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::prelude::Revision;
use crate::state_transition::identity_credit_transfer_transition::IdentityCreditTransferTransition;

use platform_value::Identifier;

pub trait IdentityCreditTransferTransitionAccessorsV0 {
Expand Down
4 changes: 1 addition & 3 deletions packages/rs-dpp/src/tests/fixtures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use get_document_transitions_fixture::*;
pub use get_documents_fixture::*;
pub use get_dpns_data_contract::*;
pub use get_dpns_document_fixture::*;
pub use get_dpp::*;

#[cfg(feature = "state-transitions")]
pub use get_identity_update_transition_fixture::*;
#[cfg(feature = "state-transitions")]
Expand All @@ -29,8 +29,6 @@ mod get_document_transitions_fixture;

pub use get_masternode_reward_shares_documents_fixture::*;

pub use get_documents_fixture::*;

mod get_dashpay_contract_fixture;
mod get_dashpay_contract_with_generalized_encryption_key_fixture;
mod get_data_contract;
Expand Down
4 changes: 1 addition & 3 deletions packages/rs-drive-abci/src/abci/handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ mod execution_result;

use crate::abci::server::AbciApplication;
use crate::error::execution::ExecutionError;
use dashcore_rpc::dashcore::consensus::Encodable;
use dashcore_rpc::dashcore::hashes::HashEngine;

use super::AbciError;
use crate::error::Error;
Expand Down Expand Up @@ -368,7 +366,7 @@ where

fn process_proposal(
&self,
mut request: RequestProcessProposal,
request: RequestProcessProposal,
) -> Result<ResponseProcessProposal, proto::ResponseException> {
let timer = crate::metrics::abci_request_duration("process_proposal");

Expand Down
4 changes: 3 additions & 1 deletion packages/rs-drive-abci/src/execution/check_tx/v0/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::error::Error;
use crate::execution::check_tx::CheckTxLevel;
use crate::execution::validation::state_transition::check_tx_verification::state_transition_to_execution_event_for_check_tx;
use crate::execution::validation::state_transition::processor::process_state_transition;

#[cfg(test)]
use crate::platform_types::event_execution_result::EventExecutionResult;
#[cfg(test)]
Expand All @@ -14,6 +14,8 @@ use dpp::consensus::basic::decode::SerializedObjectParsingError;
use dpp::consensus::basic::BasicError;
use dpp::consensus::ConsensusError;

#[cfg(test)]
use crate::execution::validation::state_transition::processor::process_state_transition;
use dpp::fee::fee_result::FeeResult;
use dpp::serialization::PlatformDeserializable;
use dpp::state_transition::StateTransition;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use dashcore_rpc::dashcore::transaction::special_transaction::TransactionPayload::AssetUnlockPayloadType;
use dpp::block::epoch::Epoch;

use dpp::validation::SimpleValidationResult;
Expand All @@ -10,8 +9,7 @@ use dpp::block::extended_block_info::v0::ExtendedBlockInfoV0;
use dpp::version::PlatformVersion;

use dpp::dashcore::bls_sig_utils::BLSSignature;
use dpp::dashcore::consensus::Encodable;
use dpp::dashcore::hashes::Hash;

use tenderdash_abci::{
proto::{serializers::timestamp::ToMilis, types::BlockId as ProtoBlockId},
signatures::Hashable,
Expand Down Expand Up @@ -62,7 +60,7 @@ where
///
pub(super) fn finalize_block_proposal_v0(
&self,
mut request_finalize_block: FinalizeBlockCleanedRequest,
request_finalize_block: FinalizeBlockCleanedRequest,
transaction: &Transaction,
_platform_version: &PlatformVersion,
) -> Result<block_execution_outcome::v0::BlockFinalizationOutcome, Error> {
Expand Down Expand Up @@ -231,7 +229,6 @@ where
let signatures = commit_info
.threshold_vote_extensions
.drain(..)
.into_iter()
.map(|vote_extension| {
let signature_bytes: [u8; 96] =
vote_extension.signature.try_into().map_err(|e| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ where
let mut hasher = Sha256::new();
hasher.update(pro_tx_hash);
hasher.update(key_data);
Ok(hasher
.finalize()
.try_into()
.expect("expected a 32 byte hash"))
Ok(hasher.finalize().into())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@ where
.validator_sets()
.iter()
.map(|(quorum_hash, validator_set)| {
(
quorum_hash.clone(),
validator_set.threshold_public_key().clone(),
)
(*quorum_hash, validator_set.threshold_public_key().clone())
})
.collect();
let previous_quorums = block_platform_state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use crate::error::execution::ExecutionError;
use crate::error::Error;
use dashcore_rpc::dashcore_rpc_json::QuorumType;
use dpp::bls_signatures::PublicKey as BlsPublicKey;
use dpp::dashcore::{ChainLock, QuorumHash};
use dpp::platform_value::Bytes32;
use dpp::dashcore::QuorumHash;

use std::collections::BTreeMap;

use crate::platform_types::platform::Platform;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use dashcore_rpc::dashcore_rpc_json::QuorumType;
use dpp::bls_signatures::PublicKey as BlsPublicKey;
use dpp::dashcore::hashes::{sha256d, Hash, HashEngine};
use dpp::dashcore::{ChainLock, QuorumHash};
use dpp::dashcore::QuorumHash;
use std::collections::BTreeMap;

use crate::platform_types::platform::Platform;

use crate::rpc::core::CoreRPCLike;

use crate::execution::platform_events::core_chain_lock::choose_quorum::ReversedQuorumHashBytes;

impl<C> Platform<C> {
Expand Down Expand Up @@ -92,7 +90,7 @@ impl<C> Platform<C> {
#[cfg(test)]
mod tests {
use crate::platform_types::platform::Platform;
use crate::rpc::core::{CoreRPCLike, MockCoreRPCLike};
use crate::rpc::core::MockCoreRPCLike;
use dashcore_rpc::dashcore_rpc_json::QuorumType;
use dpp::bls_signatures::PublicKey as BlsPublicKey;
use dpp::dashcore::hashes::Hash;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::platform_types::platform::Platform;

use crate::rpc::core::CoreRPCLike;

use crate::config::PlatformConfig;
use crate::platform_types::platform_state::PlatformState;
use dpp::version::PlatformVersion;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
use dpp::block::block_info::BlockInfo;
use dpp::bls_signatures::G2Element;
use dpp::dashcore::consensus::Encodable;

use dpp::dashcore::hashes::{sha256d, Hash, HashEngine};
use dpp::dashcore::{ChainLock, QuorumSigningRequestId, VarInt};
use dpp::dashcore::{ChainLock, QuorumSigningRequestId};

use crate::error::Error;

use crate::platform_types::platform::Platform;

use crate::rpc::core::CoreRPCLike;

use crate::config::PlatformConfig;
use crate::platform_types::platform_state::v0::PlatformStateV0Methods;
use crate::platform_types::platform_state::PlatformState;
use dpp::version::PlatformVersion;
Expand Down Expand Up @@ -236,7 +234,7 @@ where
}
}

return Ok(Some(chain_lock_verified));
Ok(Some(chain_lock_verified))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl<C> Platform<C> {
platform_version: &PlatformVersion,
) -> DataContract {
let contract =
load_system_data_contract(SystemDataContract::MasternodeRewards, &platform_version)
load_system_data_contract(SystemDataContract::MasternodeRewards, platform_version)
.expect("should load masternode reward contract");

let storage_flags = Some(Cow::Owned(StorageFlags::SingleEpoch(0)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ use drive::dpp::document::Document;
use drive::grovedb::TransactionArg;
use drive::query::{DriveQuery, InternalClauses, WhereClause, WhereOperator};

use dpp::data_contract::accessors::v0::DataContractV0Getters;
use dpp::version::PlatformVersion;
use drive::drive::document::query::{QueryDocumentsOutcomeV0Methods};
use drive::drive::document::query::QueryDocumentsOutcomeV0Methods;
use std::collections::BTreeMap;
use dpp::data_contract::accessors::v0::DataContractV0Getters;
use dpp::data_contracts::SystemDataContract;

use crate::execution::platform_events::fee_pool_outwards_distribution::fetch_reward_shares_list_for_masternode::MN_REWARD_SHARES_DOCUMENT_TYPE;

impl<C> Platform<C> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::error::execution::ExecutionError;
use crate::error::Error;
use crate::execution::types::execution_event::ExecutionEvent;
use crate::execution::types::execution_operation::{ExecutionOperation, OperationLike};
use crate::execution::types::execution_operation::ExecutionOperation;
use crate::platform_types::event_execution_result::EventExecutionResult;
use crate::platform_types::event_execution_result::EventExecutionResult::{
ConsensusExecutionError, SuccessfulFreeExecution, SuccessfulPaidExecution,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use crate::error::execution::ExecutionError;
use crate::error::Error;
use crate::execution::types::execution_event::ExecutionEvent;
use crate::execution::types::execution_operation::{ExecutionOperation, OperationLike};
use crate::execution::types::execution_operation::ExecutionOperation;
use crate::platform_types::platform::Platform;
use crate::rpc::core::CoreRPCLike;
use dpp::block::block_info::BlockInfo;
use dpp::consensus::state::identity::IdentityInsufficientBalanceError;
use dpp::consensus::state::state_error::StateError;
use dpp::fee::fee_result::FeeResult;
use dpp::fee::Credits;

use dpp::prelude::ConsensusValidationResult;
use dpp::version::PlatformVersion;
use dpp::ProtocolError;

use drive::grovedb::TransactionArg;

impl<C> Platform<C>
Expand Down
Loading