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
+1 -3
View File
@@ -26,6 +26,7 @@ use primitives::offchain::storage::InMemOffchainStorage;
use sr_primitives::{generic::BlockId, Justification, StorageOverlay, ChildrenStorageOverlay};
use sr_primitives::traits::{Block as BlockT, NumberFor, Zero, Header};
use crate::in_mem::{self, check_genesis_storage};
use sp_blockchain::{ Error as ClientError, Result as ClientResult };
use client_api::{
backend::{
AuxStore, Backend as ClientBackend, BlockImportOperation, RemoteBackend, NewBlockState,
@@ -34,9 +35,6 @@ use client_api::{
blockchain::{
HeaderBackend as BlockchainHeaderBackend, well_known_cache_keys,
},
error::{
Error as ClientError, Result as ClientResult
},
light::Storage as BlockchainStorage,
};
use crate::light::blockchain::Blockchain;
+4 -4
View File
@@ -23,7 +23,10 @@ use std::sync::Arc;
use sr_primitives::{Justification, generic::BlockId};
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, NumberFor, Zero};
use header_metadata::{HeaderMetadata, CachedHeaderMetadata};
use sp_blockchain::{
HeaderMetadata, CachedHeaderMetadata,
Error as ClientError, Result as ClientResult,
};
pub use client_api::{
backend::{
AuxStore, NewBlockState
@@ -33,9 +36,6 @@ pub use client_api::{
HeaderBackend as BlockchainHeaderBackend, Info as BlockchainInfo, ProvideCache,
well_known_cache_keys,
},
error::{
Error as ClientError, Result as ClientResult
},
light::{
RemoteBlockchain, LocalOrRemote, Storage
}
+3 -2
View File
@@ -38,9 +38,10 @@ use hash_db::Hasher;
use sr_api::{ProofRecorder, InitializeBlock};
use sp_blockchain::{Error as ClientError, Result as ClientResult};
use client_api::{
backend::RemoteBackend,
error::{Error as ClientError, Result as ClientResult},
light::RemoteCallRequest,
call_executor::CallExecutor
};
@@ -450,7 +451,7 @@ mod tests {
),
);
match execution_result {
Err(client_api::error::Error::Execution(_)) => (),
Err(sp_blockchain::Error::Execution(_)) => (),
_ => panic!("Unexpected execution result: {:?}", execution_result),
}
}
+3 -7
View File
@@ -33,12 +33,10 @@ use state_machine::{
read_child_proof_check,
};
pub use state_machine::StorageProof;
use sp_blockchain::{Error as ClientError, Result as ClientResult};
use crate::cht;
pub use client_api::{
error::{
Error as ClientError, Result as ClientResult
},
light::{
RemoteCallRequest, RemoteHeaderRequest, RemoteReadRequest, RemoteReadChildRequest,
RemoteChangesRequest, ChangesProof, RemoteBodyRequest, Fetcher, FetchChecker,
@@ -329,10 +327,8 @@ pub mod tests {
use codec::Decode;
use crate::client::tests::prepare_client_with_key_changes;
use executor::{NativeExecutor, WasmExecutionMethod};
use client_api::{
backend::NewBlockState,
error::Error as ClientError,
};
use sp_blockchain::Error as ClientError;
use client_api::backend::NewBlockState;
use test_client::{
self, ClientExt, blockchain::HeaderBackend, AccountKeyring,
runtime::{self, Hash, Block, Header, Extrinsic}
+1 -1
View File
@@ -27,11 +27,11 @@ use executor::RuntimeInfo;
use primitives::{H256, Blake2Hasher, traits::CodeExecutor};
use sr_primitives::BuildStorage;
use sr_primitives::traits::Block as BlockT;
use sp_blockchain::Result as ClientResult;
use crate::call_executor::LocalCallExecutor;
use crate::client::Client;
use client_api::{
error::Result as ClientResult,
light::Storage as BlockchainStorage,
};
use crate::light::backend::Backend;