Skip to content

Commit

Permalink
fmt imports
Browse files Browse the repository at this point in the history
  • Loading branch information
divagant-martian committed Feb 11, 2022
1 parent 39298d9 commit cc0ea7c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/backoff.rs
Expand Up @@ -20,13 +20,13 @@

//! Data structure for efficiently storing known back-off's when pruning peers.
use crate::topic::TopicHash;
use wasm_timer::Instant;
use libp2p_core::PeerId;
use std::collections::{
hash_map::{Entry, HashMap},
HashSet,
};
use std::time::Duration;
use wasm_timer::Instant;

#[derive(Copy, Clone)]
struct HeartbeatIndex(usize);
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/behaviour.rs
Expand Up @@ -36,7 +36,6 @@ use prometheus_client::registry::Registry;
use prost::Message;
use rand::{seq::SliceRandom, thread_rng};

use wasm_timer::Instant;
use libp2p_core::{
connection::ConnectionId, identity::Keypair, multiaddr::Protocol::Ip4,
multiaddr::Protocol::Ip6, ConnectedPoint, Multiaddr, PeerId,
Expand All @@ -45,6 +44,7 @@ use libp2p_swarm::{
dial_opts::{self, DialOpts},
IntoProtocolsHandler, NetworkBehaviour, NetworkBehaviourAction, NotifyHandler, PollParameters,
};
use wasm_timer::Instant;

use crate::backoff::BackoffStorage;
use crate::config::{GossipsubConfig, ValidationMode};
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/gossip_promises.rs
Expand Up @@ -21,10 +21,10 @@
use crate::error::ValidationError;
use crate::peer_score::RejectReason;
use crate::MessageId;
use wasm_timer::Instant;
use libp2p_core::PeerId;
use log::debug;
use std::collections::HashMap;
use wasm_timer::Instant;

/// Tracks recently sent `IWANT` messages and checks if peers respond to them.
#[derive(Default)]
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/handler.rs
Expand Up @@ -25,7 +25,6 @@ use crate::types::{GossipsubRpc, PeerKind, RawGossipsubMessage};
use asynchronous_codec::Framed;
use futures::prelude::*;
use futures::StreamExt;
use wasm_timer::Instant;
use libp2p_core::upgrade::{InboundUpgrade, NegotiationError, OutboundUpgrade, UpgradeError};
use libp2p_swarm::protocols_handler::{
KeepAlive, ProtocolsHandler, ProtocolsHandlerEvent, ProtocolsHandlerUpgrErr, SubstreamProtocol,
Expand All @@ -40,6 +39,7 @@ use std::{
task::{Context, Poll},
time::Duration,
};
use wasm_timer::Instant;

/// The initial time (in seconds) we set the keep alive for protocol negotiations to occur.
const INITIAL_KEEP_ALIVE: u64 = 30;
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/peer_score.rs
Expand Up @@ -24,12 +24,12 @@
use crate::metrics::{Metrics, Penalty};
use crate::time_cache::TimeCache;
use crate::{MessageId, TopicHash};
use wasm_timer::Instant;
use libp2p_core::PeerId;
use log::{debug, trace, warn};
use std::collections::{hash_map, HashMap, HashSet};
use std::net::IpAddr;
use std::time::Duration;
use wasm_timer::Instant;

mod params;
use crate::error::ValidationError;
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/time_cache.rs
Expand Up @@ -21,13 +21,13 @@
//! This implements a time-based LRU cache for checking gossipsub message duplicates.

use fnv::FnvHashMap;
use wasm_timer::Instant;
use std::collections::hash_map::{
self,
Entry::{Occupied, Vacant},
};
use std::collections::VecDeque;
use std::time::Duration;
use wasm_timer::Instant;

struct ExpiringElement<Element> {
/// The element that expires
Expand Down

0 comments on commit cc0ea7c

Please sign in to comment.