Move ethcore::Error to error_chain (#8386)
* WIP * Convert Ethcore error to use error_chain * Use error_chain for ImportError and BlockImportError * Fix error pattern matches for error_chain in miner * Implement explicit From for AccountsError * Fix pattern matches for ErrorKinds * Handle ethcore error_chain in light client * Explicitly define Result type to avoid shadowing * Fix remaining Error pattern matches * Fix tab space formatting * Helps if the tests compile * Fix error chain matching after merge
This commit is contained in:
committed by
Afri Schoedon
parent
2257bc8e2f
commit
14361cc7b1
@@ -427,7 +427,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::{BlockImportError, ImportError};
|
||||
use ethcore::error::{BlockImportError, BlockImportErrorKind, ImportErrorKind};
|
||||
|
||||
const DRAIN_AMOUNT: usize = 128;
|
||||
|
||||
@@ -457,10 +457,10 @@ impl<L: AsLightClient> LightSync<L> {
|
||||
for header in sink.drain(..) {
|
||||
match client.queue_header(header) {
|
||||
Ok(_) => {}
|
||||
Err(BlockImportError::Import(ImportError::AlreadyInChain)) => {
|
||||
Err(BlockImportError(BlockImportErrorKind::Import(ImportErrorKind::AlreadyInChain), _)) => {
|
||||
trace!(target: "sync", "Block already in chain. Continuing.");
|
||||
},
|
||||
Err(BlockImportError::Import(ImportError::AlreadyQueued)) => {
|
||||
Err(BlockImportError(BlockImportErrorKind::Import(ImportErrorKind::AlreadyQueued), _)) => {
|
||||
trace!(target: "sync", "Block already queued. Continuing.");
|
||||
},
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user