mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 15:41:02 +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
+1
-1
@@ -45,7 +45,7 @@ use log::warn;
|
||||
|
||||
use client::error::{Error as ClientError, Result as ClientResult};
|
||||
use runtime_primitives::traits::{
|
||||
Block as BlockT, NumberFor, Zero, Bounded, SaturatedConversion, CheckedSub
|
||||
Block as BlockT, NumberFor, Zero, Bounded, CheckedSub
|
||||
};
|
||||
|
||||
use crate::cache::{CacheItemT, ComplexBlockId, EntryType};
|
||||
|
||||
@@ -48,7 +48,7 @@ use primitives::storage::well_known_keys;
|
||||
use runtime_primitives::{generic::BlockId, Justification, StorageOverlay, ChildrenStorageOverlay};
|
||||
use runtime_primitives::traits::{
|
||||
Block as BlockT, Header as HeaderT, NumberFor, Zero, One, Digest, DigestItem,
|
||||
SaturatedConversion, UniqueSaturatedFrom, UniqueSaturatedInto
|
||||
SaturatedConversion,
|
||||
};
|
||||
use runtime_primitives::BuildStorage;
|
||||
use state_machine::backend::Backend as StateBackend;
|
||||
|
||||
@@ -31,7 +31,7 @@ use trie::DBValue;
|
||||
use runtime_primitives::generic::BlockId;
|
||||
use runtime_primitives::traits::{
|
||||
Block as BlockT, Header as HeaderT, Zero, UniqueSaturatedFrom,
|
||||
UniqueSaturatedInto, SaturatedConversion, CheckedConversion
|
||||
UniqueSaturatedInto, CheckedConversion
|
||||
};
|
||||
use crate::DatabaseSettings;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ use runtime_primitives::{
|
||||
generic::{BlockId, SignedBlock},
|
||||
};
|
||||
use consensus::{
|
||||
Error as ConsensusError, ErrorKind as ConsensusErrorKind, ImportBlock,
|
||||
Error as ConsensusError, ImportBlock,
|
||||
ImportResult, BlockOrigin, ForkChoiceStrategy,
|
||||
well_known_cache_keys::Id as CacheKeyId,
|
||||
SelectChain, self,
|
||||
@@ -1387,7 +1387,7 @@ impl<B, E, Block, RA> consensus::BlockImport<Block> for Client<B, E, Block, RA>
|
||||
) -> Result<ImportResult, Self::Error> {
|
||||
self.lock_import_and_run(|operation| {
|
||||
self.apply_block(operation, import_block, new_cache)
|
||||
}).map_err(|e| ConsensusErrorKind::ClientImport(e.to_string()).into())
|
||||
}).map_err(|e| ConsensusError::ClientImport(e.to_string()).into())
|
||||
}
|
||||
|
||||
/// Check block preconditions.
|
||||
@@ -1397,7 +1397,7 @@ impl<B, E, Block, RA> consensus::BlockImport<Block> for Client<B, E, Block, RA>
|
||||
parent_hash: Block::Hash,
|
||||
) -> Result<ImportResult, Self::Error> {
|
||||
match self.block_status(&BlockId::Hash(parent_hash))
|
||||
.map_err(|e| ConsensusError::from(ConsensusErrorKind::ClientImport(e.to_string())))?
|
||||
.map_err(|e| ConsensusError::ClientImport(e.to_string()))?
|
||||
{
|
||||
BlockStatus::InChainWithState | BlockStatus::Queued => {},
|
||||
BlockStatus::Unknown | BlockStatus::InChainPruned => return Ok(ImportResult::UnknownParent),
|
||||
@@ -1405,7 +1405,7 @@ impl<B, E, Block, RA> consensus::BlockImport<Block> for Client<B, E, Block, RA>
|
||||
}
|
||||
|
||||
match self.block_status(&BlockId::Hash(hash))
|
||||
.map_err(|e| ConsensusError::from(ConsensusErrorKind::ClientImport(e.to_string())))?
|
||||
.map_err(|e| ConsensusError::ClientImport(e.to_string()))?
|
||||
{
|
||||
BlockStatus::InChainWithState | BlockStatus::Queued => return Ok(ImportResult::AlreadyInChain),
|
||||
BlockStatus::Unknown | BlockStatus::InChainPruned => {},
|
||||
@@ -1641,14 +1641,14 @@ where
|
||||
|
||||
fn leaves(&self) -> Result<Vec<<Block as BlockT>::Hash>, ConsensusError> {
|
||||
LongestChain::leaves(self)
|
||||
.map_err(|e| ConsensusErrorKind::ChainLookup(e.to_string()).into())
|
||||
.map_err(|e| ConsensusError::ChainLookup(e.to_string()).into())
|
||||
}
|
||||
|
||||
fn best_chain(&self)
|
||||
-> Result<<Block as BlockT>::Header, ConsensusError>
|
||||
{
|
||||
LongestChain::best_block_header(&self)
|
||||
.map_err(|e| ConsensusErrorKind::ChainLookup(e.to_string()).into())
|
||||
.map_err(|e| ConsensusError::ChainLookup(e.to_string()).into())
|
||||
}
|
||||
|
||||
fn finality_target(
|
||||
@@ -1657,7 +1657,7 @@ where
|
||||
maybe_max_number: Option<NumberFor<Block>>
|
||||
) -> Result<Option<Block::Hash>, ConsensusError> {
|
||||
LongestChain::best_containing(self, target_hash, maybe_max_number)
|
||||
.map_err(|e| ConsensusErrorKind::ChainLookup(e.to_string()).into())
|
||||
.map_err(|e| ConsensusError::ChainLookup(e.to_string()).into())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user