Removed redundant ethcore-service error type (#10788)

This commit is contained in:
Marek Kotewicz 2019-06-26 20:16:58 +08:00 committed by Wei Tang
parent 9c051ab756
commit 3a2c173fe1
3 changed files with 2 additions and 44 deletions

View File

@ -1,39 +0,0 @@
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum 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 Ethereum 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 Ethereum. If not, see <http://www.gnu.org/licenses/>.
use ethcore;
use io;
use ethcore_private_tx;
#[derive(Debug, derive_more::Display, derive_more::From)]
pub enum Error {
/// Ethcore Error
Ethcore(ethcore::error::Error),
/// Io Error
IoError(io::IoError),
/// Private Transactions Error
PrivateTransactions(ethcore_private_tx::Error),
}
impl std::error::Error for Error {
fn source(&self) -> Option<&(std::error::Error + 'static)> {
match self {
Error::Ethcore(err) => Some(err),
Error::IoError(err) => Some(err),
Error::PrivateTransactions(err) => Some(err),
}
}
}

View File

@ -34,11 +34,9 @@ extern crate ethcore_db;
#[cfg(test)]
extern crate tempdir;
mod error;
mod service;
#[cfg(test)]
extern crate kvdb_rocksdb;
pub use error::Error;
pub use service::{ClientService, PrivateTxService};

View File

@ -16,8 +16,8 @@
//! Creates and registers client and network services.
use std::sync::Arc;
use std::path::Path;
use std::sync::Arc;
use std::time::Duration;
use ansi_term::Colour;
@ -35,7 +35,6 @@ use ethcore::error::Error as EthcoreError;
use ethcore_private_tx::{self, Importer, Signer};
use Error;
pub struct PrivateTxService {
provider: Arc<ethcore_private_tx::Provider>,
@ -99,7 +98,7 @@ impl ClientService {
encryptor: Box<ethcore_private_tx::Encryptor>,
private_tx_conf: ethcore_private_tx::ProviderConfig,
private_encryptor_conf: ethcore_private_tx::EncryptorConfig,
) -> Result<ClientService, Error>
) -> Result<ClientService, EthcoreError>
{
let io_service = IoService::<ClientIoMessage>::start()?;