[ethcore] remove error_chain (#10616)

* Derive Display for BlockError

* Convert error_chain errors

* Convert ethcore usages of errors

* Fix remaining compile errors in ethcore

* Fix other crates

* Fix tests compilation

* Implement error for Snapshot error

* Remove redundant into
This commit is contained in:
Andrew Jones
2019-05-06 14:06:20 +01:00
committed by Andronik Ordian
parent b30b54e446
commit 98b89c8e4f
23 changed files with 265 additions and 241 deletions

View File

@@ -493,7 +493,7 @@ impl<L: AsLightClient> LightSync<L> {
// handles request dispatch, block import, state machine transitions, and timeouts.
fn maintain_sync(&self, ctx: &BasicContext) {
use ethcore::error::{Error as EthcoreError, ErrorKind as EthcoreErrorKind, ImportErrorKind};
use ethcore::error::{Error as EthcoreError, ImportError};
const DRAIN_AMOUNT: usize = 128;
@@ -524,10 +524,10 @@ impl<L: AsLightClient> LightSync<L> {
for header in sink.drain(..) {
match client.queue_header(header) {
Ok(_) => {}
Err(EthcoreError(EthcoreErrorKind::Import(ImportErrorKind::AlreadyInChain), _)) => {
Err(EthcoreError::Import(ImportError::AlreadyInChain)) => {
trace!(target: "sync", "Block already in chain. Continuing.");
},
Err(EthcoreError(EthcoreErrorKind::Import(ImportErrorKind::AlreadyQueued), _)) => {
Err(EthcoreError::Import(ImportError::AlreadyQueued)) => {
trace!(target: "sync", "Block already queued. Continuing.");
},
Err(e) => {