Skip to content

Commit

Permalink
refactor: cleaning and formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Jan 28, 2025
1 parent 9a70f4c commit 293c71f
Show file tree
Hide file tree
Showing 14 changed files with 387 additions and 417 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/dapi-grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tonic = { version = "0.12.3", features = [
serde = { version = "1.0.197", optional = true, features = ["derive"] }
serde_bytes = { version = "0.11.12", optional = true }
serde_json = { version = "1.0", optional = true }
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", rev="eee1597a2f15eca3a189ff98a6bd08ecf2f71f90", default-features = false, features = [
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", rev="47141571a9df6cda83d67bbf68091f3263799eed", default-features = false, features = [
"grpc", "serde",
] }
dapi-grpc-macros = { path = "../rs-dapi-grpc-macros" }
Expand Down
4 changes: 2 additions & 2 deletions packages/rs-drive-abci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ tracing-subscriber = { version = "0.3.16", default-features = false, features =
"registry",
"tracing-log",
], optional = false }
tenderdash-abci = { git = "https://github.com/dashpay/rs-tenderdash-abci", rev="eee1597a2f15eca3a189ff98a6bd08ecf2f71f90", features = [
"grpc", "serde",
tenderdash-abci = { git = "https://github.com/dashpay/rs-tenderdash-abci", rev="47141571a9df6cda83d67bbf68091f3263799eed", features = [
"crypto", "grpc", "serde",
] }
lazy_static = "1.4.0"
itertools = { version = "0.13" }
Expand Down
13 changes: 7 additions & 6 deletions packages/rs-drive-abci/src/abci/app/check_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::abci::app::{PlatformApplication, SnapshotManagerApplication};
use crate::abci::handler;
use crate::error::Error;
use crate::platform_types::platform::Platform;
use crate::platform_types::snapshot::SnapshotManager;
use crate::rpc::core::CoreRPCLike;
use crate::utils::spawn_blocking_task_with_name_if_supported;
use async_trait::async_trait;
Expand All @@ -10,7 +11,6 @@ use std::sync::Arc;
use tenderdash_abci::proto::abci as proto;
use tenderdash_abci::proto::abci::abci_application_server as grpc_abci_server;
use tenderdash_abci::proto::tonic;
use crate::platform_types::snapshot::SnapshotManager;

/// AbciApp is an implementation of gRPC ABCI Application, as defined by Tenderdash.
///
Expand Down Expand Up @@ -52,14 +52,15 @@ where
/// Create new ABCI app
pub fn new(platform: Arc<Platform<C>>, core_rpc: Arc<C>) -> Self {
let snapshot_manager = SnapshotManager::new(
platform
.config
.state_sync_config
.checkpoints_path.clone(),
platform.config.state_sync_config.checkpoints_path.clone(),
platform.config.state_sync_config.max_num_snapshots,
platform.config.state_sync_config.snapshots_frequency,
);
Self { platform, core_rpc, snapshot_manager }
Self {
platform,
core_rpc,
snapshot_manager,
}
}
}

Expand Down
7 changes: 2 additions & 5 deletions packages/rs-drive-abci/src/abci/app/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ use crate::execution::types::block_execution_context::BlockExecutionContext;
use crate::platform_types::platform::Platform;
use crate::platform_types::snapshot::{SnapshotFetchingSession, SnapshotManager};
use crate::rpc::core::CoreRPCLike;
use dapi_grpc::tonic;
use dpp::version::PlatformVersion;
use drive::grovedb::Transaction;
use std::fmt::Debug;
use std::sync::RwLock;
use tenderdash_abci::proto::abci as proto;
use dapi_grpc::tonic;

/// AbciApp is an implementation of ABCI Application, as defined by Tenderdash.
///
Expand All @@ -39,10 +39,7 @@ impl<'p, C> ConsensusAbciApplication<'p, C> {
/// Create new ABCI app
pub fn new(platform: &'p Platform<C>) -> Self {
let snapshot_manager = SnapshotManager::new(
platform
.config
.state_sync_config
.checkpoints_path.clone(),
platform.config.state_sync_config.checkpoints_path.clone(),
platform.config.state_sync_config.max_num_snapshots,
platform.config.state_sync_config.snapshots_frequency,
);
Expand Down
5 changes: 1 addition & 4 deletions packages/rs-drive-abci/src/abci/app/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ impl<'a, C> FullAbciApplication<'a, C> {
/// Create new ABCI app
pub fn new(platform: &'a Platform<C>) -> Self {
let snapshot_manager = SnapshotManager::new(
platform
.config
.state_sync_config
.checkpoints_path.clone(),
platform.config.state_sync_config.checkpoints_path.clone(),
platform.config.state_sync_config.max_num_snapshots,
platform.config.state_sync_config.snapshots_frequency,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use drive::grovedb_storage::rocksdb_storage::RocksDbStorage;
use tenderdash_abci::proto::abci as proto;
use crate::abci::app::{SnapshotFetchingApplication, SnapshotManagerApplication};
use crate::abci::AbciError;
use crate::error::Error;
use dpp::version::PlatformVersion;
use drive::grovedb_storage::rocksdb_storage::RocksDbStorage;
use tenderdash_abci::proto::abci as proto;

pub fn apply_snapshot_chunk<'a, 'db: 'a, A, C: 'db>(
app: &'a A,
Expand Down
Loading

0 comments on commit 293c71f

Please sign in to comment.