Skip to content

Commit

Permalink
Fix fmt and import
Browse files Browse the repository at this point in the history
  • Loading branch information
shenkeyao committed Nov 14, 2024
1 parent 078859e commit 6d69e91
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 120 deletions.
187 changes: 90 additions & 97 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion crates/examples/push-cdn/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use cdn_broker::{
reexports::{crypto::signature::KeyPair, def::hook::NoMessageHook},
Broker,
};

use cdn_marshal::Marshal;
use hotshot::{
helpers::initialize_logging,
Expand Down
1 change: 1 addition & 0 deletions crates/hotshot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ lru.workspace = true
portpicker = "0.1"
rand = { workspace = true }
serde = { workspace = true, features = ["rc"] }
sha2 = { workspace = true }
time = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
Expand Down
11 changes: 6 additions & 5 deletions crates/hotshot/src/tasks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
pub mod task_state;
use std::{collections::BTreeMap, fmt::Debug, num::NonZeroUsize, sync::Arc, time::Duration};

use crate::{
tasks::task_state::CreateTaskState, types::SystemContextHandle, ConsensusApi,
ConsensusMetricsValue, ConsensusTaskRegistry, HotShotConfig, HotShotInitializer,
MarketplaceConfig, Memberships, NetworkTaskRegistry, SignatureKey, SystemContext, Versions,
};
use async_broadcast::{broadcast, RecvError};
use async_lock::RwLock;
use async_trait::async_trait;
Expand Down Expand Up @@ -48,6 +43,12 @@ use hotshot_types::{
use tokio::{spawn, time::sleep};
use vbs::version::StaticVersionType;

use crate::{
tasks::task_state::CreateTaskState, types::SystemContextHandle, ConsensusApi,
ConsensusMetricsValue, ConsensusTaskRegistry, HotShotConfig, HotShotInitializer,
MarketplaceConfig, Memberships, NetworkTaskRegistry, SignatureKey, SystemContext, Versions,
};

/// event for global event stream
#[derive(Clone, Debug)]
pub enum GlobalEvent {
Expand Down
3 changes: 1 addition & 2 deletions crates/task-impls/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use async_broadcast::{InactiveReceiver, Receiver, SendError, Sender};
use async_lock::RwLock;
use committable::{Commitment, Committable};
use hotshot_task::dependency::{Dependency, EventDependency};
use hotshot_types::utils::epoch_from_block_number;
use hotshot_types::{
consensus::OuterConsensus,
data::{Leaf, QuorumProposal, ViewChangeEvidence},
Expand All @@ -28,7 +27,7 @@ use hotshot_types::{
signature_key::SignatureKey,
BlockPayload, ValidatedState,
},
utils::{Terminator, View, ViewInner},
utils::{epoch_from_block_number, Terminator, View, ViewInner},
vote::{Certificate, HasViewNumber},
};
use tokio::time::timeout;
Expand Down
2 changes: 1 addition & 1 deletion crates/task-impls/src/quorum_proposal_recv/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ use std::sync::Arc;
use async_broadcast::{broadcast, Receiver, Sender};
use async_lock::RwLockUpgradableReadGuard;
use committable::Committable;
use hotshot_types::traits::block_contents::BlockHeader;
use hotshot_types::{
consensus::OuterConsensus,
data::{Leaf, QuorumProposal},
message::Proposal,
simple_certificate::QuorumCertificate,
traits::{
block_contents::BlockHeader,
election::Membership,
node_implementation::{ConsensusTime, NodeImplementation, NodeType},
signature_key::SignatureKey,
Expand Down
11 changes: 6 additions & 5 deletions crates/task-impls/src/quorum_proposal_recv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

use std::{collections::BTreeMap, sync::Arc};

use self::handlers::handle_quorum_proposal_recv;
use crate::{
events::{HotShotEvent, ProposalMissing},
helpers::{broadcast_event, fetch_proposal, parent_leaf_and_state},
};
use async_broadcast::{broadcast, Receiver, Sender};
use async_lock::RwLock;
use async_trait::async_trait;
Expand All @@ -35,6 +30,12 @@ use tokio::task::JoinHandle;
use tracing::{debug, error, info, instrument, warn};
use utils::anytrace::{bail, Result};
use vbs::version::Version;

use self::handlers::handle_quorum_proposal_recv;
use crate::{
events::{HotShotEvent, ProposalMissing},
helpers::{broadcast_event, fetch_proposal, parent_leaf_and_state},
};
/// Event handlers for this task.
mod handlers;

Expand Down
11 changes: 6 additions & 5 deletions crates/task-impls/src/quorum_vote/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

use std::{collections::BTreeMap, sync::Arc};

use crate::{
events::HotShotEvent,
helpers::broadcast_event,
quorum_vote::handlers::{handle_quorum_proposal_validated, submit_vote, update_shared_state},
};
use async_broadcast::{InactiveReceiver, Receiver, Sender};
use async_lock::RwLock;
use async_trait::async_trait;
Expand Down Expand Up @@ -41,6 +36,12 @@ use tracing::instrument;
use utils::anytrace::*;
use vbs::version::StaticVersionType;

use crate::{
events::HotShotEvent,
helpers::broadcast_event,
quorum_vote::handlers::{handle_quorum_proposal_validated, submit_vote, update_shared_state},
};

/// Event handlers for `QuorumProposalValidated`.
mod handlers;

Expand Down
3 changes: 1 addition & 2 deletions crates/testing/tests/tests_1/quorum_proposal_recv_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ use hotshot_testing::{
serial,
view_generator::TestViewGenerator,
};
use hotshot_types::data::EpochNumber;
use hotshot_types::{
data::{Leaf, ViewNumber},
data::{EpochNumber, Leaf, ViewNumber},
request_response::ProposalRequestPayload,
traits::{
consensus_api::ConsensusApi,
Expand Down
4 changes: 2 additions & 2 deletions crates/testing/tests/tests_1/view_sync_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use hotshot_task_impls::{
events::HotShotEvent, harness::run_harness, view_sync::ViewSyncTaskState,
};
use hotshot_testing::helpers::build_system_handle;
use hotshot_types::data::EpochNumber;
use hotshot_types::{
data::ViewNumber, simple_vote::ViewSyncPreCommitData,
data::{EpochNumber, ViewNumber},
simple_vote::ViewSyncPreCommitData,
traits::node_implementation::ConsensusTime,
};

Expand Down

0 comments on commit 6d69e91

Please sign in to comment.