mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
Companion for substrate#9128 (#3268)
* support async selectchain * update Substrate Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+156
-155
File diff suppressed because it is too large
Load Diff
@@ -478,7 +478,7 @@ impl IsCollator {
|
|||||||
|
|
||||||
/// Returns the active leaves the overseer should start with.
|
/// Returns the active leaves the overseer should start with.
|
||||||
#[cfg(feature = "full-node")]
|
#[cfg(feature = "full-node")]
|
||||||
fn active_leaves<RuntimeApi, Executor>(
|
async fn active_leaves<RuntimeApi, Executor>(
|
||||||
select_chain: &sc_consensus::LongestChain<FullBackend, Block>,
|
select_chain: &sc_consensus::LongestChain<FullBackend, Block>,
|
||||||
client: &FullClient<RuntimeApi, Executor>,
|
client: &FullClient<RuntimeApi, Executor>,
|
||||||
) -> Result<Vec<BlockInfo>, Error>
|
) -> Result<Vec<BlockInfo>, Error>
|
||||||
@@ -488,10 +488,11 @@ where
|
|||||||
RuntimeApiCollection<StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>,
|
RuntimeApiCollection<StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>,
|
||||||
Executor: NativeExecutionDispatch + 'static,
|
Executor: NativeExecutionDispatch + 'static,
|
||||||
{
|
{
|
||||||
let best_block = select_chain.best_chain()?;
|
let best_block = select_chain.best_chain().await?;
|
||||||
|
|
||||||
let mut leaves = select_chain
|
let mut leaves = select_chain
|
||||||
.leaves()
|
.leaves()
|
||||||
|
.await
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|hash| {
|
.filter_map(|hash| {
|
||||||
@@ -673,7 +674,9 @@ pub fn new_full<RuntimeApi, Executor, OverseerGenerator>(
|
|||||||
|
|
||||||
let overseer_client = client.clone();
|
let overseer_client = client.clone();
|
||||||
let spawner = task_manager.spawn_handle();
|
let spawner = task_manager.spawn_handle();
|
||||||
let active_leaves = active_leaves(&select_chain, &*client)?;
|
let active_leaves = futures::executor::block_on(
|
||||||
|
active_leaves(&select_chain, &*client)
|
||||||
|
)?;
|
||||||
|
|
||||||
let authority_discovery_service = if role.is_authority() || is_collator.is_collator() {
|
let authority_discovery_service = if role.is_authority() || is_collator.is_collator() {
|
||||||
use sc_network::Event;
|
use sc_network::Event;
|
||||||
|
|||||||
Reference in New Issue
Block a user