mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 03:31:10 +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
@@ -40,7 +40,7 @@ use primitives::{
|
||||
sr25519::{Public, Signature, LocalizedSignature, self},
|
||||
};
|
||||
use merlin::Transcript;
|
||||
use inherents::{InherentDataProviders, InherentData, RuntimeString};
|
||||
use inherents::{InherentDataProviders, InherentData};
|
||||
use substrate_telemetry::{telemetry, CONSENSUS_TRACE, CONSENSUS_DEBUG, CONSENSUS_WARN, CONSENSUS_INFO};
|
||||
use schnorrkel::{
|
||||
keys::Keypair,
|
||||
@@ -191,10 +191,6 @@ impl Config {
|
||||
}
|
||||
}
|
||||
|
||||
fn inherent_to_common_error(err: RuntimeString) -> consensus_common::Error {
|
||||
consensus_common::ErrorKind::InherentData(err.into()).into()
|
||||
}
|
||||
|
||||
/// A digest item which is usable with BABE consensus.
|
||||
pub trait CompatibleDigestItem: Sized {
|
||||
/// Construct a digest item which contains a slot number and a signature
|
||||
@@ -243,7 +239,8 @@ impl SlotCompatible for BabeSlotCompatible {
|
||||
trace!(target: "babe", "extract timestamp");
|
||||
data.timestamp_inherent_data()
|
||||
.and_then(|t| data.babe_inherent_data().map(|a| (t, a)))
|
||||
.map_err(slots::inherent_to_common_error)
|
||||
.map_err(Into::into)
|
||||
.map_err(consensus_common::Error::InherentData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,7 +517,7 @@ impl<B: Block, C, E, I, Error, SO> SlotWorker<B> for BabeWorker<C, E, I, SO> whe
|
||||
})
|
||||
.map_err(|e| {
|
||||
warn!("Client import failed: {:?}", e);
|
||||
consensus_common::ErrorKind::ClientImport(format!("{:?}", e)).into()
|
||||
consensus_common::Error::ClientImport(format!("{:?}", e))
|
||||
})
|
||||
)
|
||||
}
|
||||
@@ -585,7 +582,7 @@ fn check_header<B: Block + Sized, C: AuxStore>(
|
||||
format!("VRF verification failed")
|
||||
})?
|
||||
};
|
||||
|
||||
|
||||
if check(&inout, threshold) {
|
||||
match check_equivocation(&client, slot_now, slot_num, header.clone(), signer.clone()) {
|
||||
Ok(Some(equivocation_proof)) => {
|
||||
@@ -797,7 +794,7 @@ fn authorities<B, C>(client: &C, at: &BlockId<B>) -> Result<
|
||||
panic!("We don’t support deprecated code with new consensus algorithms, \
|
||||
therefore this is unreachable; qed")
|
||||
}
|
||||
}).ok_or_else(|| consensus_common::ErrorKind::InvalidAuthoritiesSet.into())
|
||||
}).ok_or(consensus_common::Error::InvalidAuthoritiesSet)
|
||||
}
|
||||
|
||||
/// The BABE import queue type.
|
||||
@@ -812,7 +809,8 @@ fn register_babe_inherent_data_provider(
|
||||
if !inherent_data_providers.has_provider(&srml_babe::INHERENT_IDENTIFIER) {
|
||||
inherent_data_providers
|
||||
.register_provider(srml_babe::InherentDataProvider::new(slot_duration))
|
||||
.map_err(inherent_to_common_error)
|
||||
.map_err(Into::into)
|
||||
.map_err(consensus_common::Error::InherentData)
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
@@ -1019,7 +1017,7 @@ mod tests {
|
||||
Default::default(),
|
||||
0,
|
||||
);
|
||||
|
||||
|
||||
let (inout, proof, _batchable_proof) = get_keypair(&pair).vrf_sign_n_check(transcript, |inout| check(inout, u64::MAX)).unwrap();
|
||||
let pre_hash: H256 = header.hash();
|
||||
let to_sign = (slot_num, pre_hash, proof.to_bytes()).encode();
|
||||
|
||||
Reference in New Issue
Block a user