mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 04:01:10 +00:00
Move sc-client into sc-service (#5502)
* Drop client from sc-network and sc-client-db, move LongestChain to sc-client-api * move leaves, cht, in_mem to sc-client-api, drop client from sc-finality-grandpa * drop sc-service from sc-rpc * drop sc-service from sc-consensus-aura * drop sc-client from manual-seal and babe * drop sc-client from utils/frame/rpc/system and utils/frame/benchmarking-cli * drop sc-client from bin/node and bin/node-template * drop sc-client * fix tests * remove check -p sc-client from gitlab.yml * fix warnings * fixes ui test * fix light client tests * adds associated Client type to AbstractService * adds UsageProvider to Client * fixed ui test, again * tried and failed to get node-cli to compile for wasm * thanks to tomaka for helping me get node-cli to compile for wasmm * ui test pls pas 🙏🏾 * all tests passing 🪄 * no_run documentation code * rm -f documentation code * ClientProvider * fix mega trait * move LongestChain to sc-consensus, use adds minimal bounds to AbstractService::Client * adds license to sc-consensus Co-authored-by: Benjamin Kampmann <ben@parity.io>
This commit is contained in:
@@ -37,11 +37,15 @@ use sc_service::{
|
||||
Role,
|
||||
Error,
|
||||
};
|
||||
use sp_blockchain::HeaderBackend;
|
||||
use sc_network::{multiaddr, Multiaddr};
|
||||
use sc_network::config::{NetworkConfiguration, TransportConfig};
|
||||
use sp_runtime::{generic::BlockId, traits::Block as BlockT};
|
||||
use sp_transaction_pool::TransactionPool;
|
||||
|
||||
#[cfg(test)]
|
||||
mod client;
|
||||
|
||||
/// Maximum duration of single wait call.
|
||||
const MAX_WAIT_TIME: Duration = Duration::from_secs(60 * 3);
|
||||
|
||||
@@ -462,15 +466,15 @@ pub fn sync<G, E, Fb, F, Lb, L, B, ExF, U>(
|
||||
}
|
||||
network.run_until_all_full(
|
||||
|_index, service|
|
||||
service.get().client().chain_info().best_number == (NUM_BLOCKS as u32).into(),
|
||||
service.get().client().info().best_number == (NUM_BLOCKS as u32).into(),
|
||||
|_index, service|
|
||||
service.get().client().chain_info().best_number == (NUM_BLOCKS as u32).into(),
|
||||
service.get().client().info().best_number == (NUM_BLOCKS as u32).into(),
|
||||
);
|
||||
|
||||
info!("Checking extrinsic propagation");
|
||||
let first_service = network.full_nodes[0].1.clone();
|
||||
let first_user_data = &network.full_nodes[0].2;
|
||||
let best_block = BlockId::number(first_service.get().client().chain_info().best_number);
|
||||
let best_block = BlockId::number(first_service.get().client().info().best_number);
|
||||
let extrinsic = extrinsic_factory(&first_service.get(), first_user_data);
|
||||
let source = sp_transaction_pool::TransactionSource::External;
|
||||
|
||||
@@ -523,9 +527,9 @@ pub fn consensus<G, E, Fb, F, Lb, L>(
|
||||
}
|
||||
network.run_until_all_full(
|
||||
|_index, service|
|
||||
service.get().client().chain_info().finalized_number >= (NUM_BLOCKS as u32 / 2).into(),
|
||||
service.get().client().info().finalized_number >= (NUM_BLOCKS as u32 / 2).into(),
|
||||
|_index, service|
|
||||
service.get().client().chain_info().best_number >= (NUM_BLOCKS as u32 / 2).into(),
|
||||
service.get().client().info().best_number >= (NUM_BLOCKS as u32 / 2).into(),
|
||||
);
|
||||
|
||||
info!("Adding more peers");
|
||||
@@ -545,8 +549,8 @@ pub fn consensus<G, E, Fb, F, Lb, L>(
|
||||
}
|
||||
network.run_until_all_full(
|
||||
|_index, service|
|
||||
service.get().client().chain_info().finalized_number >= (NUM_BLOCKS as u32).into(),
|
||||
service.get().client().info().finalized_number >= (NUM_BLOCKS as u32).into(),
|
||||
|_index, service|
|
||||
service.get().client().chain_info().best_number >= (NUM_BLOCKS as u32).into(),
|
||||
service.get().client().info().best_number >= (NUM_BLOCKS as u32).into(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user