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
+8 -10
View File
@@ -31,9 +31,7 @@ use primitives::{
traits::CodeExecutor,
};
use sr_api::{ProofRecorder, InitializeBlock};
use client_api::{
error, backend, call_executor::CallExecutor,
};
use client_api::{backend, call_executor::CallExecutor};
/// Call executor that executes methods locally, querying all required
/// data from local backend.
@@ -79,7 +77,7 @@ where
call_data: &[u8],
strategy: ExecutionStrategy,
extensions: Option<Extensions>,
) -> error::Result<Vec<u8>> {
) -> sp_blockchain::Result<Vec<u8>> {
let mut changes = OverlayedChanges::default();
let state = self.backend.state_at(*id)?;
let return_data = StateMachine::new(
@@ -105,7 +103,7 @@ where
fn contextual_call<
'a,
IB: Fn() -> error::Result<()>,
IB: Fn() -> sp_blockchain::Result<()>,
EM: Fn(
Result<NativeOrEncoded<R>, Self::Error>,
Result<NativeOrEncoded<R>, Self::Error>
@@ -124,7 +122,7 @@ where
native_call: Option<NC>,
recorder: &Option<ProofRecorder<Block>>,
extensions: Option<Extensions>,
) -> Result<NativeOrEncoded<R>, error::Error> where ExecutionManager<EM>: Clone {
) -> Result<NativeOrEncoded<R>, sp_blockchain::Error> where ExecutionManager<EM>: Clone {
match initialize_block {
InitializeBlock::Do(ref init_block)
if init_block.borrow().as_ref().map(|id| id != at).unwrap_or(true) => {
@@ -189,7 +187,7 @@ where
Ok(result)
}
fn runtime_version(&self, id: &BlockId<Block>) -> error::Result<RuntimeVersion> {
fn runtime_version(&self, id: &BlockId<Block>) -> sp_blockchain::Result<RuntimeVersion> {
let mut overlay = OverlayedChanges::default();
let state = self.backend.state_at(*id)?;
@@ -204,7 +202,7 @@ where
let _lock = self.backend.get_import_lock().read();
self.backend.destroy_state(state)?;
}
version.ok_or(error::Error::VersionInvalid.into())
version.ok_or(sp_blockchain::Error::VersionInvalid.into())
}
fn call_at_state<
@@ -223,7 +221,7 @@ where
manager: ExecutionManager<F>,
native_call: Option<NC>,
extensions: Option<Extensions>,
) -> error::Result<(
) -> sp_blockchain::Result<(
NativeOrEncoded<R>,
(S::Transaction, <Blake2Hasher as Hasher>::Out),
Option<ChangesTrieTransaction<Blake2Hasher, NumberFor<Block>>>,
@@ -255,7 +253,7 @@ where
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), error::Error> {
) -> Result<(Vec<u8>, StorageProof), sp_blockchain::Error> {
state_machine::prove_execution_on_trie_backend(
trie_state,
overlay,