Remove all (non-dev) client references from frame, activate dependency enforcer (#4184)

* Move transaction pool to primitives

* move backend, errors into primitives

* remove unused client depencies

* Move rpc-api into primitives

* Move peerset back to client

* Move rpc/api back to client, move palette/support/rpc into utils

* move support-rpc into subfolder

* move system-rpc into utils

* move transaction-pool  and -graph back into client

* fix broken imports

* Clean up test primitives

* Make support test utils independent of frame

* remove unnecessary node dependencies from service

* Reactivate dependency script:
 - only enforce the now achieved status quo will remain
 - allow for primitives to depend on /client for now without failing
 - more discriptive error message so people understand, what it wants
 - minor fix to differentiative between ../client and /client (which may be a subfolder)
 - don't allow this to fail anylonger.

* fix doc comment

* 'Should not' rather than 'must not'.

* Revert unwanted dependency changes

* fix faulty import

* fixup derive_more version

* fix wrong import path
This commit is contained in:
Benjamin Kampmann
2019-11-26 21:38:28 +01:00
committed by GitHub
parent b2aab98e69
commit bd652793db
130 changed files with 836 additions and 816 deletions
+7 -9
View File
@@ -32,10 +32,8 @@
use std::sync::Arc;
use std::thread;
use std::collections::HashMap;
use client_api::{
BlockOf, blockchain::{HeaderBackend, ProvideCache}, backend::AuxStore,
well_known_cache_keys::Id as CacheKeyId,
};
use 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 sr_primitives::{Justification, RuntimeString};
use sr_primitives::generic::{BlockId, Digest, DigestItem};
@@ -66,7 +64,7 @@ pub enum Error<B: BlockT> {
#[display(fmt = "Fetching best header failed using select chain: {:?}", _0)]
BestHeaderSelectChain(ConsensusError),
#[display(fmt = "Fetching best header failed: {:?}", _0)]
BestHeader(client_api::error::Error),
BestHeader(sp_blockchain::Error),
#[display(fmt = "Best header does not exist")]
NoBestHeader,
#[display(fmt = "Block proposing error: {:?}", _0)]
@@ -79,7 +77,7 @@ pub enum Error<B: BlockT> {
CreateInherents(inherents::Error),
#[display(fmt = "Checking inherents failed: {}", _0)]
CheckInherents(String),
Client(client_api::error::Error),
Client(sp_blockchain::Error),
Codec(codec::Error),
Environment(String),
Runtime(RuntimeString)
@@ -211,7 +209,7 @@ impl<B: BlockT<Hash=H256>, C, S, Algorithm> PowVerifier<B, C, S, Algorithm> {
inherent_data: InherentData,
timestamp_now: u64,
) -> Result<(), Error<B>> where
C: ProvideRuntimeApi, C::Api: BlockBuilderApi<B, Error = client_api::error::Error>
C: ProvideRuntimeApi, C::Api: BlockBuilderApi<B, Error = sp_blockchain::Error>
{
const MAX_TIMESTAMP_DRIFT_SECS: u64 = 60;
@@ -249,7 +247,7 @@ impl<B: BlockT<Hash=H256>, C, S, Algorithm> PowVerifier<B, C, S, Algorithm> {
impl<B: BlockT<Hash=H256>, C, S, Algorithm> Verifier<B> for PowVerifier<B, C, S, Algorithm> where
C: ProvideRuntimeApi + Send + Sync + HeaderBackend<B> + AuxStore + ProvideCache<B> + BlockOf,
C::Api: BlockBuilderApi<B, Error = client_api::error::Error>,
C::Api: BlockBuilderApi<B, Error = sp_blockchain::Error>,
S: SelectChain<B>,
Algorithm: PowAlgorithm<B> + Send + Sync,
{
@@ -341,7 +339,7 @@ pub fn import_queue<B, C, S, Algorithm>(
B: BlockT<Hash=H256>,
C: ProvideRuntimeApi + HeaderBackend<B> + BlockOf + ProvideCache<B> + AuxStore,
C: Send + Sync + AuxStore + 'static,
C::Api: BlockBuilderApi<B, Error = client_api::error::Error>,
C::Api: BlockBuilderApi<B, Error = sp_blockchain::Error>,
Algorithm: PowAlgorithm<B> + Send + Sync + 'static,
S: SelectChain<B> + 'static,
{