mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 22:41:02 +00:00
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:
committed by
GitHub
parent
b2aab98e69
commit
bd652793db
@@ -20,7 +20,7 @@ use std::fmt::Debug;
|
||||
use std::sync::Arc;
|
||||
use codec::{Encode, Decode};
|
||||
use client_api::backend::AuxStore;
|
||||
use client_api::error::{Result as ClientResult, Error as ClientError};
|
||||
use sp_blockchain::{Result as ClientResult, Error as ClientError};
|
||||
use fork_tree::ForkTree;
|
||||
use grandpa::round::State as RoundState;
|
||||
use sr_primitives::traits::{Block as BlockT, NumberFor};
|
||||
|
||||
@@ -47,11 +47,11 @@ impl<H: Copy + PartialEq, N: Copy + Ord> ConsensusChanges<H, N> {
|
||||
|
||||
/// Finalize all pending consensus changes that are finalized by given block.
|
||||
/// Returns true if there any changes were finalized.
|
||||
pub(crate) fn finalize<F: Fn(N) -> ::client_api::error::Result<Option<H>>>(
|
||||
pub(crate) fn finalize<F: Fn(N) -> ::sp_blockchain::Result<Option<H>>>(
|
||||
&mut self,
|
||||
block: (N, H),
|
||||
canonical_at_height: F,
|
||||
) -> ::client_api::error::Result<(bool, bool)> {
|
||||
) -> ::sp_blockchain::Result<(bool, bool)> {
|
||||
let (split_idx, has_finalized_changes) = self.pending_changes.iter()
|
||||
.enumerate()
|
||||
.take_while(|(_, &(at_height, _))| at_height <= block.0)
|
||||
|
||||
@@ -24,13 +24,13 @@ use codec::{Decode, Encode};
|
||||
use futures::prelude::*;
|
||||
use tokio_timer::Delay;
|
||||
use parking_lot::RwLock;
|
||||
use sp_blockchain::{HeaderBackend, Error as ClientError};
|
||||
|
||||
use client_api::{
|
||||
HeaderBackend, BlockchainEvents,
|
||||
BlockchainEvents,
|
||||
backend::{Backend},
|
||||
Finalizer,
|
||||
call_executor::CallExecutor,
|
||||
error::Error as ClientError,
|
||||
utils::is_descendent_of,
|
||||
};
|
||||
use client::{
|
||||
@@ -534,7 +534,7 @@ pub(crate) fn ancestry<B, Block: BlockT<Hash=H256>, E, RA>(
|
||||
{
|
||||
if base == block { return Err(GrandpaError::NotDescendent) }
|
||||
|
||||
let tree_route_res = header_metadata::tree_route(client, block, base);
|
||||
let tree_route_res = sp_blockchain::tree_route(client, block, base);
|
||||
|
||||
let tree_route = match tree_route_res {
|
||||
Ok(tree_route) => tree_route,
|
||||
|
||||
@@ -38,11 +38,10 @@ use std::iter;
|
||||
use std::sync::Arc;
|
||||
use log::{trace, warn};
|
||||
|
||||
use sp_blockchain::{Backend as BlockchainBackend, Error as ClientError, Result as ClientResult};
|
||||
use client_api::{
|
||||
backend::Backend, blockchain::Backend as BlockchainBackend, CallExecutor,
|
||||
error::{Error as ClientError, Result as ClientResult},
|
||||
backend::Backend, CallExecutor, StorageProof,
|
||||
light::{FetchChecker, RemoteReadRequest},
|
||||
StorageProof,
|
||||
};
|
||||
use client::Client;
|
||||
use codec::{Encode, Decode};
|
||||
@@ -259,7 +258,7 @@ pub(crate) fn prove_finality<Block: BlockT<Hash=H256>, B: BlockchainBackend<Bloc
|
||||
authorities_set_id: u64,
|
||||
begin: Block::Hash,
|
||||
end: Block::Hash,
|
||||
) -> ::client_api::error::Result<Option<Vec<u8>>>
|
||||
) -> ::sp_blockchain::Result<Option<Vec<u8>>>
|
||||
where
|
||||
J: ProvableJustification<Block::Header>,
|
||||
{
|
||||
|
||||
@@ -21,11 +21,8 @@ use codec::Encode;
|
||||
use futures::sync::mpsc;
|
||||
use parking_lot::RwLockWriteGuard;
|
||||
|
||||
use client_api::{
|
||||
backend::Backend, blockchain,
|
||||
CallExecutor, blockchain::HeaderBackend, well_known_cache_keys,
|
||||
utils::is_descendent_of,
|
||||
};
|
||||
use sp_blockchain::{HeaderBackend, BlockStatus, well_known_cache_keys};
|
||||
use client_api::{backend::Backend, CallExecutor, utils::is_descendent_of};
|
||||
use client::Client;
|
||||
use consensus_common::{
|
||||
BlockImport, Error as ConsensusError,
|
||||
@@ -403,8 +400,8 @@ impl<B, E, Block: BlockT<Hash=H256>, RA, SC> BlockImport<Block>
|
||||
// early exit if block already in chain, otherwise the check for
|
||||
// authority changes will error when trying to re-import a change block
|
||||
match self.inner.status(BlockId::Hash(hash)) {
|
||||
Ok(blockchain::BlockStatus::InChain) => return Ok(ImportResult::AlreadyInChain),
|
||||
Ok(blockchain::BlockStatus::Unknown) => {},
|
||||
Ok(BlockStatus::InChain) => return Ok(ImportResult::AlreadyInChain),
|
||||
Ok(BlockStatus::Unknown) => {},
|
||||
Err(e) => return Err(ConsensusError::ClientImport(e.to_string()).into()),
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
use client::Client;
|
||||
use client_api::{CallExecutor, backend::Backend, error::Error as ClientError};
|
||||
use client_api::{CallExecutor, backend::Backend};
|
||||
use sp_blockchain::Error as ClientError;
|
||||
use codec::{Encode, Decode};
|
||||
use grandpa::voter_set::VoterSet;
|
||||
use grandpa::{Error as GrandpaError};
|
||||
|
||||
@@ -55,10 +55,8 @@
|
||||
use futures::prelude::*;
|
||||
use log::{debug, error, info};
|
||||
use futures::sync::mpsc;
|
||||
use client_api::{
|
||||
BlockchainEvents, CallExecutor, backend::Backend, error::Error as ClientError,
|
||||
ExecutionStrategy, HeaderBackend
|
||||
};
|
||||
use client_api::{BlockchainEvents, CallExecutor, backend::Backend, ExecutionStrategy};
|
||||
use sp_blockchain::{HeaderBackend, Error as ClientError};
|
||||
use client::Client;
|
||||
use codec::{Decode, Encode};
|
||||
use sr_primitives::generic::BlockId;
|
||||
@@ -546,7 +544,7 @@ pub struct GrandpaParams<B, E, Block: BlockT<Hash=H256>, N, RA, SC, VR, X> {
|
||||
/// block import worker that has already been instantiated with `block_import`.
|
||||
pub fn run_grandpa_voter<B, E, Block: BlockT<Hash=H256>, N, RA, SC, VR, X>(
|
||||
grandpa_params: GrandpaParams<B, E, Block, N, RA, SC, VR, X>,
|
||||
) -> client_api::error::Result<impl Future<Item=(),Error=()> + Send + 'static> where
|
||||
) -> sp_blockchain::Result<impl Future<Item=(),Error=()> + Send + 'static> where
|
||||
Block::Hash: Ord,
|
||||
B: Backend<Block, Blake2Hasher> + 'static,
|
||||
E: CallExecutor<Block, Blake2Hasher> + Send + Sync + 'static,
|
||||
@@ -880,7 +878,7 @@ where
|
||||
#[deprecated(since = "1.1.0", note = "Please switch to run_grandpa_voter.")]
|
||||
pub fn run_grandpa<B, E, Block: BlockT<Hash=H256>, N, RA, SC, VR, X>(
|
||||
grandpa_params: GrandpaParams<B, E, Block, N, RA, SC, VR, X>,
|
||||
) -> ::client_api::error::Result<impl Future<Item=(),Error=()> + Send + 'static> where
|
||||
) -> ::sp_blockchain::Result<impl Future<Item=(),Error=()> + Send + 'static> where
|
||||
Block::Hash: Ord,
|
||||
B: Backend<Block, Blake2Hasher> + 'static,
|
||||
E: CallExecutor<Block, Blake2Hasher> + Send + Sync + 'static,
|
||||
|
||||
@@ -19,13 +19,8 @@ use std::sync::Arc;
|
||||
use log::{info, trace, warn};
|
||||
use parking_lot::RwLock;
|
||||
use client::Client;
|
||||
use client_api::{
|
||||
CallExecutor,
|
||||
backend::{AuxStore, Backend, Finalizer},
|
||||
blockchain::HeaderBackend,
|
||||
error::Error as ClientError,
|
||||
well_known_cache_keys,
|
||||
};
|
||||
use client_api::{CallExecutor, backend::{AuxStore, Backend, Finalizer}};
|
||||
use sp_blockchain::{HeaderBackend, Error as ClientError, well_known_cache_keys};
|
||||
use codec::{Encode, Decode};
|
||||
use consensus_common::{
|
||||
import_queue::Verifier,
|
||||
|
||||
@@ -156,7 +156,7 @@ pub fn run_grandpa_observer<B, E, Block: BlockT<Hash=H256>, N, RA, SC>(
|
||||
link: LinkHalf<B, E, Block, RA, SC>,
|
||||
network: N,
|
||||
on_exit: impl Future<Item=(),Error=()> + Clone + Send + 'static,
|
||||
) -> ::client_api::error::Result<impl Future<Item=(),Error=()> + Send + 'static> where
|
||||
) -> ::sp_blockchain::Result<impl Future<Item=(),Error=()> + Send + 'static> where
|
||||
B: Backend<Block, Blake2Hasher> + 'static,
|
||||
E: CallExecutor<Block, Blake2Hasher> + Send + Sync + 'static,
|
||||
N: Network<Block> + Send + Sync + 'static,
|
||||
|
||||
@@ -26,7 +26,7 @@ use futures03::{StreamExt as _, TryStreamExt as _};
|
||||
use tokio::runtime::current_thread;
|
||||
use keyring::Ed25519Keyring;
|
||||
use client::LongestChain;
|
||||
use client_api::error::Result;
|
||||
use sp_blockchain::Result;
|
||||
use sr_api::{Core, RuntimeVersion, ApiExt, StorageProof};
|
||||
use test_client::{self, runtime::BlockNumber};
|
||||
use consensus_common::{BlockOrigin, ForkChoiceStrategy, ImportedAux, BlockImportParams, ImportResult};
|
||||
@@ -242,7 +242,7 @@ impl Core<Block> for RuntimeApi {
|
||||
}
|
||||
|
||||
impl ApiExt<Block> for RuntimeApi {
|
||||
type Error = client_api::error::Error;
|
||||
type Error = sp_blockchain::Error;
|
||||
|
||||
fn map_api_result<F: FnOnce(&Self) -> result::Result<R, E>, R, E>(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user