Removed obsolete IpcMode enum (#8819)
This commit is contained in:
@@ -72,7 +72,6 @@ use trace;
|
||||
use trace::{TraceDB, ImportRequest as TraceImportRequest, LocalizedTrace, Database as TraceDatabase};
|
||||
use transaction::{self, LocalizedTransaction, UnverifiedTransaction, SignedTransaction, Transaction, Action};
|
||||
use types::filter::Filter;
|
||||
use types::mode::Mode as IpcMode;
|
||||
use types::ancestry_action::AncestryAction;
|
||||
use verification;
|
||||
use verification::{PreverifiedBlock, Verifier};
|
||||
@@ -1570,19 +1569,19 @@ impl BlockChainClient for Client {
|
||||
})))
|
||||
}
|
||||
|
||||
fn mode(&self) -> IpcMode {
|
||||
fn mode(&self) -> Mode {
|
||||
let r = self.mode.lock().clone().into();
|
||||
trace!(target: "mode", "Asked for mode = {:?}. returning {:?}", &*self.mode.lock(), r);
|
||||
r
|
||||
}
|
||||
|
||||
fn disable(&self) {
|
||||
self.set_mode(IpcMode::Off);
|
||||
self.set_mode(Mode::Off);
|
||||
self.enabled.store(false, AtomicOrdering::Relaxed);
|
||||
self.clear_queue();
|
||||
}
|
||||
|
||||
fn set_mode(&self, new_mode: IpcMode) {
|
||||
fn set_mode(&self, new_mode: Mode) {
|
||||
trace!(target: "mode", "Client::set_mode({:?})", new_mode);
|
||||
if !self.enabled.load(AtomicOrdering::Relaxed) {
|
||||
return;
|
||||
@@ -1597,8 +1596,8 @@ impl BlockChainClient for Client {
|
||||
}
|
||||
}
|
||||
match new_mode {
|
||||
IpcMode::Active => self.wake_up(),
|
||||
IpcMode::Off => self.sleep(),
|
||||
Mode::Active => self.wake_up(),
|
||||
Mode::Off => self.sleep(),
|
||||
_ => {(*self.sleep_state.lock()).last_activity = Some(Instant::now()); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
use std::str::FromStr;
|
||||
use std::fmt::{Display, Formatter, Error as FmtError};
|
||||
|
||||
use mode::Mode as IpcMode;
|
||||
use verification::{VerifierType, QueueConfig};
|
||||
use journaldb;
|
||||
|
||||
@@ -88,28 +87,6 @@ impl Display for Mode {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<IpcMode> for Mode {
|
||||
fn into(self) -> IpcMode {
|
||||
match self {
|
||||
Mode::Off => IpcMode::Off,
|
||||
Mode::Dark(timeout) => IpcMode::Dark(timeout.as_secs()),
|
||||
Mode::Passive(timeout, alarm) => IpcMode::Passive(timeout.as_secs(), alarm.as_secs()),
|
||||
Mode::Active => IpcMode::Active,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<IpcMode> for Mode {
|
||||
fn from(mode: IpcMode) -> Self {
|
||||
match mode {
|
||||
IpcMode::Off => Mode::Off,
|
||||
IpcMode::Dark(timeout) => Mode::Dark(Duration::from_secs(timeout)),
|
||||
IpcMode::Passive(timeout, alarm) => Mode::Passive(Duration::from_secs(timeout), Duration::from_secs(alarm)),
|
||||
IpcMode::Active => Mode::Active,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Client configuration. Includes configs for all sub-systems.
|
||||
#[derive(Debug, PartialEq, Default)]
|
||||
pub struct ClientConfig {
|
||||
|
||||
@@ -36,7 +36,7 @@ use transaction::{self, Transaction, LocalizedTransaction, SignedTransaction, Ac
|
||||
use blockchain::{TreeRoute, BlockReceipts};
|
||||
use client::{
|
||||
Nonce, Balance, ChainInfo, BlockInfo, ReopenBlock, CallContract, TransactionInfo, RegistryInfo,
|
||||
PrepareOpenBlock, BlockChainClient, BlockChainInfo, BlockStatus, BlockId,
|
||||
PrepareOpenBlock, BlockChainClient, BlockChainInfo, BlockStatus, BlockId, Mode,
|
||||
TransactionId, UncleId, TraceId, TraceFilter, LastHashes, CallAnalytics, BlockImportError,
|
||||
ProvingBlockChainClient, ScheduleInfo, ImportSealedBlock, BroadcastProposalBlock, ImportBlock, StateOrBlock,
|
||||
Call, StateClient, EngineInfo, AccountData, BlockChain, BlockProducer, SealedBlockImporter, IoClient
|
||||
@@ -51,7 +51,6 @@ use vm::Schedule;
|
||||
use miner::{Miner, MinerService};
|
||||
use spec::Spec;
|
||||
use types::basic_account::BasicAccount;
|
||||
use types::mode::Mode;
|
||||
use types::pruning_info::PruningInfo;
|
||||
|
||||
use verification::queue::QueueInfo;
|
||||
|
||||
@@ -21,6 +21,7 @@ use itertools::Itertools;
|
||||
|
||||
use block::{OpenBlock, SealedBlock, ClosedBlock};
|
||||
use blockchain::TreeRoute;
|
||||
use client::Mode;
|
||||
use encoded;
|
||||
use vm::LastHashes;
|
||||
use error::{ImportResult, CallError, BlockImportError};
|
||||
@@ -48,7 +49,6 @@ use types::trace_filter::Filter as TraceFilter;
|
||||
use types::call_analytics::CallAnalytics;
|
||||
use types::blockchain_info::BlockChainInfo;
|
||||
use types::block_status::BlockStatus;
|
||||
use types::mode::Mode;
|
||||
use types::pruning_info::PruningInfo;
|
||||
|
||||
/// State information to be used during client query
|
||||
|
||||
Reference in New Issue
Block a user