From 3a2c173fe1b22a7609202b72c4efac334f5454d0 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 26 Jun 2019 20:16:58 +0800 Subject: [PATCH] Removed redundant ethcore-service error type (#10788) --- ethcore/service/src/error.rs | 39 ---------------------------------- ethcore/service/src/lib.rs | 2 -- ethcore/service/src/service.rs | 5 ++--- 3 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 ethcore/service/src/error.rs diff --git a/ethcore/service/src/error.rs b/ethcore/service/src/error.rs deleted file mode 100644 index b2787e978..000000000 --- a/ethcore/service/src/error.rs +++ /dev/null @@ -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 . - -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), - } - } -} diff --git a/ethcore/service/src/lib.rs b/ethcore/service/src/lib.rs index b9a8c15b3..f5d92f35e 100644 --- a/ethcore/service/src/lib.rs +++ b/ethcore/service/src/lib.rs @@ -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}; diff --git a/ethcore/service/src/service.rs b/ethcore/service/src/service.rs index 60caefe9a..da949cbe3 100644 --- a/ethcore/service/src/service.rs +++ b/ethcore/service/src/service.rs @@ -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, @@ -99,7 +98,7 @@ impl ClientService { encryptor: Box, private_tx_conf: ethcore_private_tx::ProviderConfig, private_encryptor_conf: ethcore_private_tx::EncryptorConfig, - ) -> Result + ) -> Result { let io_service = IoService::::start()?;