mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 04:01:10 +00:00
[big refactor] Remove crate aliasing. (#4395)
* Rename: Phase 1. * Unify codec. * Fixing: Phase 2 * Fixing: Phase 3. * Fixing: Phase 4. * Fixing: Phase 5. * Fixing: Phase 6. * Fixing: Phase 7. * Fixing: Phase 8. Tests * Fixing: Phase 9. Tests!!! * Fixing: Phase 10. Moar tests! * Finally done! * More fixes. * Rename primitives:: to sp_core:: * Apply renames in finality-grandpa. * Fix benches. * Fix benches 2. * Revert node-template. * Fix frame-system in our modules.
This commit is contained in:
committed by
Gavin Wood
parent
f14d98a439
commit
8778ca7dc8
@@ -32,23 +32,23 @@
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
use std::collections::HashMap;
|
||||
use client_api::{BlockOf, backend::AuxStore};
|
||||
use sc_client_api::{BlockOf, backend::AuxStore};
|
||||
use sp_blockchain::{HeaderBackend, ProvideCache, well_known_cache_keys::Id as CacheKeyId};
|
||||
use block_builder_api::BlockBuilder as BlockBuilderApi;
|
||||
use sp_block_builder::BlockBuilder as BlockBuilderApi;
|
||||
use sp_runtime::{Justification, RuntimeString};
|
||||
use sp_runtime::generic::{BlockId, Digest, DigestItem};
|
||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, ProvideRuntimeApi};
|
||||
use sp_timestamp::{TimestampInherentData, InherentError as TIError};
|
||||
use pow_primitives::{Seal, TotalDifficulty, POW_ENGINE_ID};
|
||||
use primitives::H256;
|
||||
use inherents::{InherentDataProviders, InherentData};
|
||||
use consensus_common::{
|
||||
use sp_consensus_pow::{Seal, TotalDifficulty, POW_ENGINE_ID};
|
||||
use sp_core::H256;
|
||||
use sp_inherents::{InherentDataProviders, InherentData};
|
||||
use sp_consensus::{
|
||||
BlockImportParams, BlockOrigin, ForkChoiceStrategy, SyncOracle, Environment, Proposer,
|
||||
SelectChain, Error as ConsensusError, CanAuthorWith,
|
||||
};
|
||||
use consensus_common::import_queue::{BoxBlockImport, BasicQueue, Verifier};
|
||||
use sp_consensus::import_queue::{BoxBlockImport, BasicQueue, Verifier};
|
||||
use codec::{Encode, Decode};
|
||||
use client_api;
|
||||
use sc_client_api;
|
||||
use log::*;
|
||||
|
||||
#[derive(derive_more::Display, Debug)]
|
||||
@@ -74,7 +74,7 @@ pub enum Error<B: BlockT> {
|
||||
#[display(fmt = "Error with block built on {:?}: {:?}", _0, _1)]
|
||||
BlockBuiltError(B::Hash, ConsensusError),
|
||||
#[display(fmt = "Creating inherents failed: {}", _0)]
|
||||
CreateInherents(inherents::Error),
|
||||
CreateInherents(sp_inherents::Error),
|
||||
#[display(fmt = "Checking inherents failed: {}", _0)]
|
||||
CheckInherents(String),
|
||||
Client(sp_blockchain::Error),
|
||||
@@ -151,7 +151,7 @@ pub trait PowAlgorithm<B: BlockT> {
|
||||
pub struct PowVerifier<B: BlockT<Hash=H256>, C, S, Algorithm> {
|
||||
client: Arc<C>,
|
||||
algorithm: Algorithm,
|
||||
inherent_data_providers: inherents::InherentDataProviders,
|
||||
inherent_data_providers: sp_inherents::InherentDataProviders,
|
||||
select_chain: Option<S>,
|
||||
check_inherents_after: <<B as BlockT>::Header as HeaderT>::Number,
|
||||
}
|
||||
@@ -162,7 +162,7 @@ impl<B: BlockT<Hash=H256>, C, S, Algorithm> PowVerifier<B, C, S, Algorithm> {
|
||||
algorithm: Algorithm,
|
||||
check_inherents_after: <<B as BlockT>::Header as HeaderT>::Number,
|
||||
select_chain: Option<S>,
|
||||
inherent_data_providers: inherents::InherentDataProviders,
|
||||
inherent_data_providers: sp_inherents::InherentDataProviders,
|
||||
) -> Self {
|
||||
Self { client, algorithm, inherent_data_providers, select_chain, check_inherents_after }
|
||||
}
|
||||
@@ -314,12 +314,12 @@ impl<B: BlockT<Hash=H256>, C, S, Algorithm> Verifier<B> for PowVerifier<B, C, S,
|
||||
/// Register the PoW inherent data provider, if not registered already.
|
||||
pub fn register_pow_inherent_data_provider(
|
||||
inherent_data_providers: &InherentDataProviders,
|
||||
) -> Result<(), consensus_common::Error> {
|
||||
) -> Result<(), sp_consensus::Error> {
|
||||
if !inherent_data_providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) {
|
||||
inherent_data_providers
|
||||
.register_provider(sp_timestamp::InherentDataProvider)
|
||||
.map_err(Into::into)
|
||||
.map_err(consensus_common::Error::InherentData)
|
||||
.map_err(sp_consensus::Error::InherentData)
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
@@ -336,7 +336,7 @@ pub fn import_queue<B, C, S, Algorithm>(
|
||||
check_inherents_after: <<B as BlockT>::Header as HeaderT>::Number,
|
||||
select_chain: Option<S>,
|
||||
inherent_data_providers: InherentDataProviders,
|
||||
) -> Result<PowImportQueue<B>, consensus_common::Error> where
|
||||
) -> Result<PowImportQueue<B>, sp_consensus::Error> where
|
||||
B: BlockT<Hash=H256>,
|
||||
C: ProvideRuntimeApi + HeaderBackend<B> + BlockOf + ProvideCache<B> + AuxStore,
|
||||
C: Send + Sync + AuxStore + 'static,
|
||||
@@ -382,7 +382,7 @@ pub fn start_mine<B: BlockT<Hash=H256>, C, Algorithm, E, SO, S, CAW>(
|
||||
mut sync_oracle: SO,
|
||||
build_time: std::time::Duration,
|
||||
select_chain: Option<S>,
|
||||
inherent_data_providers: inherents::InherentDataProviders,
|
||||
inherent_data_providers: sp_inherents::InherentDataProviders,
|
||||
can_author_with: CAW,
|
||||
) where
|
||||
C: HeaderBackend<B> + AuxStore + 'static,
|
||||
@@ -433,7 +433,7 @@ fn mine_loop<B: BlockT<Hash=H256>, C, Algorithm, E, SO, S, CAW>(
|
||||
sync_oracle: &mut SO,
|
||||
build_time: std::time::Duration,
|
||||
select_chain: Option<&S>,
|
||||
inherent_data_providers: &inherents::InherentDataProviders,
|
||||
inherent_data_providers: &sp_inherents::InherentDataProviders,
|
||||
can_author_with: &CAW,
|
||||
) -> Result<(), Error<B>> where
|
||||
C: HeaderBackend<B> + AuxStore,
|
||||
|
||||
Reference in New Issue
Block a user