move StateResult to common-types
(#11121)
This commit is contained in:
parent
79a17dedd0
commit
acc5bdfc35
@ -12,7 +12,7 @@ ansi_term = "0.11"
|
||||
basic-authority = { path = "./engines/basic-authority", optional = true} # used by test-helpers feature
|
||||
blooms-db = { path = "../util/blooms-db", optional = true }
|
||||
client-traits = { path = "./client-traits" }
|
||||
common-types = { path = "types" }
|
||||
common-types = { path = "./types" }
|
||||
engine = { path = "./engine" }
|
||||
env_logger = { version = "0.5", optional = true }
|
||||
ethash = { path = "../ethash", optional = true }
|
||||
|
@ -56,7 +56,10 @@ use trace::{
|
||||
localized::LocalizedTrace,
|
||||
VMTrace,
|
||||
};
|
||||
use common_types::data_format::DataFormat;
|
||||
use common_types::{
|
||||
data_format::DataFormat,
|
||||
client_types::StateResult
|
||||
};
|
||||
use vm::{LastHashes, Schedule};
|
||||
|
||||
/// State information to be used during client query
|
||||
@ -68,16 +71,6 @@ pub enum StateOrBlock {
|
||||
Block(BlockId)
|
||||
}
|
||||
|
||||
/// Result to be used during get address code at given block's state
|
||||
// todo[botika] move to `common-types`
|
||||
pub enum StateResult<T> {
|
||||
/// State is missing
|
||||
Missing,
|
||||
|
||||
/// State is some
|
||||
Some(T),
|
||||
}
|
||||
|
||||
impl From<Box<dyn StateInfo>> for StateOrBlock {
|
||||
fn from(info: Box<dyn StateInfo>) -> StateOrBlock {
|
||||
StateOrBlock::State(info)
|
||||
|
@ -77,7 +77,6 @@ use client_traits::{
|
||||
ScheduleInfo,
|
||||
StateClient,
|
||||
StateOrBlock,
|
||||
StateResult,
|
||||
Tick,
|
||||
TransactionInfo
|
||||
};
|
||||
@ -109,8 +108,7 @@ use types::{
|
||||
BlockNumber,
|
||||
call_analytics::CallAnalytics,
|
||||
chain_notify::{ChainMessageType, ChainRoute, NewBlocks},
|
||||
client_types::ClientReport,
|
||||
client_types::Mode,
|
||||
client_types::{ClientReport, Mode, StateResult},
|
||||
encoded,
|
||||
engines::{
|
||||
epoch::{PendingTransition, Transition as EpochTransition},
|
||||
|
@ -55,7 +55,7 @@ use types::{
|
||||
view,
|
||||
views::BlockView,
|
||||
verification::Unverified,
|
||||
client_types::Mode,
|
||||
client_types::{Mode, StateResult},
|
||||
blockchain_info::BlockChainInfo,
|
||||
block_status::BlockStatus,
|
||||
verification::VerificationQueueInfo as BlockQueueInfo,
|
||||
@ -72,7 +72,7 @@ use client::{
|
||||
use client_traits::{
|
||||
BlockInfo, Nonce, Balance, ChainInfo, TransactionInfo, BlockChainClient, ImportBlock,
|
||||
AccountData, BlockChain, IoClient, BadBlocks, ScheduleInfo, StateClient, ProvingBlockChainClient,
|
||||
StateOrBlock, StateResult
|
||||
StateOrBlock
|
||||
};
|
||||
use engine::Engine;
|
||||
use machine::executed::Executed;
|
||||
|
@ -89,3 +89,13 @@ impl<'a> ops::Sub<&'a ClientReport> for ClientReport {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// Result to be used during get address code at given block's state
|
||||
pub enum StateResult<T> {
|
||||
/// State is missing
|
||||
Missing,
|
||||
|
||||
/// State is some
|
||||
Some(T),
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ use hash::{keccak, KECCAK_NULL_RLP};
|
||||
use ethereum_types::{U256, H256, Address};
|
||||
use bytes::ToPretty;
|
||||
use rlp::PayloadInfo;
|
||||
use client_traits::{BlockChainReset, Nonce, Balance, BlockChainClient, ImportExportBlocks, StateResult};
|
||||
use client_traits::{BlockChainReset, Nonce, Balance, BlockChainClient, ImportExportBlocks};
|
||||
use ethcore::{
|
||||
client::{DatabaseCompactionProfile, VMType},
|
||||
miner::Miner,
|
||||
@ -44,7 +44,7 @@ use ansi_term::Colour;
|
||||
use types::{
|
||||
ids::BlockId,
|
||||
errors::{ImportError, EthcoreError},
|
||||
client_types::Mode,
|
||||
client_types::{Mode, StateResult},
|
||||
};
|
||||
use types::data_format::DataFormat;
|
||||
use verification::queue::VerifierSettings;
|
||||
|
@ -25,7 +25,7 @@ use ethereum_types::{Address, H64, H160, H256, U64, U256, BigEndianHash};
|
||||
use parking_lot::Mutex;
|
||||
|
||||
use account_state::state::StateInfo;
|
||||
use client_traits::{BlockChainClient, StateClient, ProvingBlockChainClient, StateOrBlock, StateResult};
|
||||
use client_traits::{BlockChainClient, StateClient, ProvingBlockChainClient, StateOrBlock};
|
||||
use ethash::{self, SeedHashCompute};
|
||||
use ethcore::client::{Call, EngineInfo};
|
||||
use ethcore::miner::{self, MinerService};
|
||||
@ -35,6 +35,7 @@ use miner::external::ExternalMinerService;
|
||||
use sync::SyncProvider;
|
||||
use types::{
|
||||
BlockNumber as EthBlockNumber,
|
||||
client_types::StateResult,
|
||||
encoded,
|
||||
ids::{BlockId, TransactionId, UncleId},
|
||||
filter::Filter as EthcoreFilter,
|
||||
|
Loading…
Reference in New Issue
Block a user