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
+10 -8
View File
@@ -24,18 +24,20 @@ use kvdb::{KeyValueDB, DBTransaction};
use client_api::backend::{AuxStore, NewBlockState};
use client::blockchain::{
BlockStatus, Cache as BlockchainCache,
HeaderBackend as BlockchainHeaderBackend, Info as BlockchainInfo,
well_known_cache_keys,
BlockStatus, Cache as BlockchainCache,Info as BlockchainInfo,
};
use client::cht;
use client::error::{Error as ClientError, Result as ClientResult};
use sp_blockchain::{
CachedHeaderMetadata, HeaderMetadata, HeaderMetadataCache,
Error as ClientError, Result as ClientResult,
HeaderBackend as BlockchainHeaderBackend,
well_known_cache_keys,
};
use client::light::blockchain::Storage as LightBlockchainStorage;
use codec::{Decode, Encode};
use primitives::Blake2Hasher;
use sr_primitives::generic::{DigestItem, BlockId};
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, Zero, One, NumberFor};
use header_metadata::{CachedHeaderMetadata, HeaderMetadata, HeaderMetadataCache};
use crate::cache::{DbCacheSync, DbCache, ComplexBlockId, EntryType as CacheEntryType};
use crate::utils::{self, meta_keys, Meta, db_err, read_db, block_id_to_lookup_key, read_meta};
use crate::DatabaseSettings;
@@ -235,7 +237,7 @@ impl<Block: BlockT> LightStorage<Block> {
// handle reorg.
let meta = self.meta.read();
if meta.best_hash != Default::default() {
let tree_route = header_metadata::tree_route(self, meta.best_hash, route_to)?;
let tree_route = sp_blockchain::tree_route(self, meta.best_hash, route_to)?;
// update block number to hash lookup entries.
for retracted in tree_route.retracted() {
@@ -282,7 +284,7 @@ impl<Block: BlockT> LightStorage<Block> {
) -> ClientResult<()> {
let meta = self.meta.read();
if &meta.finalized_hash != header.parent_hash() {
return Err(::client::error::Error::NonSequentialFinalization(
return Err(::sp_blockchain::Error::NonSequentialFinalization(
format!("Last finalized {:?} not parent of {:?}",
meta.finalized_hash, hash),
).into())
@@ -560,7 +562,7 @@ pub(crate) mod tests {
use client::cht;
use sr_primitives::generic::DigestItem;
use sr_primitives::testing::{H256 as Hash, Header, Block as RawBlock, ExtrinsicWrapper};
use header_metadata::{lowest_common_ancestor, tree_route};
use sp_blockchain::{lowest_common_ancestor, tree_route};
use super::*;
type Block = RawBlock<ExtrinsicWrapper<u32>>;