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
+6 -11
View File
@@ -18,20 +18,17 @@
#![warn(missing_docs)]
pub mod backend;
pub mod blockchain;
pub mod call_executor;
pub mod client;
pub mod error;
pub mod execution_extensions;
pub mod light;
pub mod notifications;
// TODO: avoid re-exports
pub use sp_blockchain as blockchain;
pub use backend::*;
pub use blockchain::*;
pub use notifications::*;
pub use call_executor::*;
pub use client::*;
pub use error::*;
pub use light::*;
pub use notifications::*;
@@ -40,9 +37,7 @@ pub use state_machine::{StorageProof, ExecutionStrategy};
/// Utility methods for the client.
pub mod utils {
use super::HeaderBackend;
use header_metadata::HeaderMetadata;
use crate::error;
use sp_blockchain::{HeaderBackend, HeaderMetadata, Error};
use primitives::H256;
use sr_primitives::traits::{Block as BlockT};
use std::borrow::Borrow;
@@ -56,8 +51,8 @@ pub mod utils {
pub fn is_descendent_of<'a, Block: BlockT<Hash=H256>, T, H: Borrow<H256> + 'a>(
client: &'a T,
current: Option<(H, H)>,
) -> impl Fn(&H256, &H256) -> Result<bool, error::Error> + 'a
where T: HeaderBackend<Block> + HeaderMetadata<Block, Error=error::Error>,
) -> impl Fn(&H256, &H256) -> Result<bool, Error> + 'a
where T: HeaderBackend<Block> + HeaderMetadata<Block, Error=Error>,
{
move |base, hash| {
if base == hash { return Ok(false); }
@@ -76,7 +71,7 @@ pub mod utils {
}
}
let ancestor = header_metadata::lowest_common_ancestor(client, *hash, *base)?;
let ancestor = sp_blockchain::lowest_common_ancestor(client, *hash, *base)?;
Ok(ancestor.hash == *base)
}