removed client error (#9253)

This commit is contained in:
Marek Kotewicz 2018-07-31 11:55:18 +02:00 committed by André Silva
parent 29baccd857
commit 10f42a2b39
4 changed files with 1 additions and 75 deletions

View File

@ -34,7 +34,6 @@ use ethereum_types::{H256, Address, U256};
use block::{IsBlock, LockedBlock, Drain, ClosedBlock, OpenBlock, enact_verified, SealedBlock}; use block::{IsBlock, LockedBlock, Drain, ClosedBlock, OpenBlock, enact_verified, SealedBlock};
use blockchain::{BlockChain, BlockChainDB, BlockProvider, TreeRoute, ImportRoute, TransactionAddress, ExtrasInsert}; use blockchain::{BlockChain, BlockChainDB, BlockProvider, TreeRoute, ImportRoute, TransactionAddress, ExtrasInsert};
use client::ancient_import::AncientVerifier; use client::ancient_import::AncientVerifier;
use client::Error as ClientError;
use client::{ use client::{
Nonce, Balance, ChainInfo, BlockInfo, CallContract, TransactionInfo, Nonce, Balance, ChainInfo, BlockInfo, CallContract, TransactionInfo,
RegistryInfo, ReopenBlock, PrepareOpenBlock, ScheduleInfo, ImportSealedBlock, RegistryInfo, ReopenBlock, PrepareOpenBlock, ScheduleInfo, ImportSealedBlock,
@ -933,7 +932,7 @@ impl Client {
} }
// prune ancient states until below the memory limit or only the minimum amount remain. // prune ancient states until below the memory limit or only the minimum amount remain.
fn prune_ancient(&self, mut state_db: StateDB, chain: &BlockChain) -> Result<(), ClientError> { fn prune_ancient(&self, mut state_db: StateDB, chain: &BlockChain) -> Result<(), ::error::Error> {
let number = match state_db.journal_db().latest_era() { let number = match state_db.journal_db().latest_era() {
Some(n) => n, Some(n) => n,
None => return Ok(()), None => return Ok(()),

View File

@ -1,55 +0,0 @@
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use std::fmt::{Display, Formatter, Error as FmtError};
use std::io;
use ethtrie::TrieError;
/// Client configuration errors.
#[derive(Debug)]
pub enum Error {
/// TrieDB-related error.
Trie(TrieError),
/// Io error.
Io(io::Error),
}
impl From<TrieError> for Error {
fn from(err: TrieError) -> Self {
Error::Trie(err)
}
}
impl From<io::Error> for Error {
fn from(err: io::Error) -> Self {
Error::Io(err)
}
}
impl<E> From<Box<E>> for Error where Error: From<E> {
fn from(err: Box<E>) -> Self {
Error::from(*err)
}
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> {
match *self {
Error::Trie(ref err) => write!(f, "{}", err),
Error::Io(ref err) => write!(f, "{}", err),
}
}
}

View File

@ -19,7 +19,6 @@
mod ancient_import; mod ancient_import;
mod client; mod client;
mod config; mod config;
mod error;
#[cfg(any(test, feature = "test-helpers"))] #[cfg(any(test, feature = "test-helpers"))]
mod evm_test_client; mod evm_test_client;
mod io_message; mod io_message;
@ -29,7 +28,6 @@ mod trace;
pub use self::client::*; pub use self::client::*;
pub use self::config::{Mode, ClientConfig, DatabaseCompactionProfile, BlockChainConfig, VMType}; pub use self::config::{Mode, ClientConfig, DatabaseCompactionProfile, BlockChainConfig, VMType};
pub use self::error::Error;
#[cfg(any(test, feature = "test-helpers"))] #[cfg(any(test, feature = "test-helpers"))]
pub use self::evm_test_client::{EvmTestClient, EvmTestError, TransactResult}; pub use self::evm_test_client::{EvmTestClient, EvmTestError, TransactResult};
pub use self::io_message::ClientIoMessage; pub use self::io_message::ClientIoMessage;

View File

@ -24,7 +24,6 @@ use unexpected::{Mismatch, OutOfBounds};
use ethtrie::TrieError; use ethtrie::TrieError;
use io::*; use io::*;
use header::BlockNumber; use header::BlockNumber;
use client::Error as ClientError;
use snapshot::Error as SnapshotError; use snapshot::Error as SnapshotError;
use engines::EngineError; use engines::EngineError;
use ethkey::Error as EthkeyError; use ethkey::Error as EthkeyError;
@ -250,12 +249,6 @@ error_chain! {
} }
errors { errors {
#[doc = "Client configuration error."]
Client(err: ClientError) {
description("Client configuration error.")
display("Client configuration error {}", err)
}
#[doc = "Snapshot error."] #[doc = "Snapshot error."]
Snapshot(err: SnapshotError) { Snapshot(err: SnapshotError) {
description("Snapshot error.") description("Snapshot error.")
@ -297,15 +290,6 @@ error_chain! {
/// Result of import block operation. /// Result of import block operation.
pub type ImportResult = EthcoreResult<H256>; pub type ImportResult = EthcoreResult<H256>;
impl From<ClientError> for Error {
fn from(err: ClientError) -> Error {
match err {
ClientError::Trie(err) => ErrorKind::Trie(err).into(),
_ => ErrorKind::Client(err).into()
}
}
}
impl From<AccountsError> for Error { impl From<AccountsError> for Error {
fn from(err: AccountsError) -> Error { fn from(err: AccountsError) -> Error {
ErrorKind::AccountProvider(err).into() ErrorKind::AccountProvider(err).into()