mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 00:31:07 +00:00
Expunge error-chain (feat. tomaka) (#2662)
* Remove error_chain * Expunge error-chain from rpc and service. * Expunge from transaction pool. * Expunge from node/cli * Expunge from keystore. * Remove some boilerplate. * Fix remaining stuff. * Improve on deprecation message. * Fix issues. * Fix trnsaction pool tests. * Fix the rest. * Fix borked merge. * Update lock
This commit is contained in:
committed by
Gavin Wood
parent
69ffec5822
commit
c162fc5ff1
@@ -65,11 +65,6 @@ pub trait SlotCompatible {
|
||||
) -> Result<(u64, u64), consensus_common::Error>;
|
||||
}
|
||||
|
||||
/// Convert an inherent error to common error.
|
||||
pub fn inherent_to_common_error(err: inherents::RuntimeString) -> consensus_common::Error {
|
||||
consensus_common::ErrorKind::InherentData(err.into()).into()
|
||||
}
|
||||
|
||||
/// Start a new slot worker in a separate thread.
|
||||
#[deprecated(since = "1.1", note = "Please spawn a thread manually")]
|
||||
pub fn start_slot_worker_thread<B, C, W, SO, SC, T, OnExit>(
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
//! This is used instead of `tokio_timer::Interval` because it was unreliable.
|
||||
|
||||
use super::SlotCompatible;
|
||||
use consensus_common::{Error, ErrorKind};
|
||||
use consensus_common::Error;
|
||||
use futures::prelude::*;
|
||||
use futures::try_ready;
|
||||
use inherents::{InherentData, InherentDataProviders};
|
||||
@@ -125,7 +125,7 @@ impl<SC: SlotCompatible> Stream for Slots<SC> {
|
||||
if let Some(ref mut inner_delay) = self.inner_delay {
|
||||
try_ready!(inner_delay
|
||||
.poll()
|
||||
.map_err(|e| Error::from(ErrorKind::FaultyTimer(e))));
|
||||
.map_err(Error::FaultyTimer));
|
||||
}
|
||||
|
||||
// timeout has fired.
|
||||
@@ -133,7 +133,7 @@ impl<SC: SlotCompatible> Stream for Slots<SC> {
|
||||
let inherent_data = self
|
||||
.inherent_data_providers
|
||||
.create_inherent_data()
|
||||
.map_err(crate::inherent_to_common_error)?;
|
||||
.map_err(|s| consensus_common::Error::InherentData(s.into_owned()))?;
|
||||
let (timestamp, slot_num) = SC::extract_timestamp_and_slot(&inherent_data)?;
|
||||
|
||||
// reschedule delay for next slot.
|
||||
|
||||
Reference in New Issue
Block a user