mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
Update to Substrate master (#311)
* Best effort to bring up to date. * Fix the executor stuff * Update verisons. * Finish fixing * Final fixes and warnings. * add some docs and bump Wasm versions * Fix tests * Fix final test
This commit is contained in:
@@ -31,17 +31,20 @@ use client::blockchain::HeaderBackend;
|
||||
use consensus::SelectChain;
|
||||
use extrinsic_store::Store as ExtrinsicStore;
|
||||
use futures::prelude::*;
|
||||
use log::error;
|
||||
use primitives::ed25519;
|
||||
use polkadot_primitives::{Block, BlockId, AuraId};
|
||||
use polkadot_primitives::parachain::{CandidateReceipt, ParachainHost};
|
||||
use runtime_primitives::traits::{ProvideRuntimeApi, Header as HeaderT};
|
||||
use aura::AuraApi;
|
||||
|
||||
use tokio::{timer::Interval, runtime::{TaskExecutor, current_thread::Runtime as LocalRuntime}};
|
||||
use tokio::{timer::Interval, runtime::current_thread::Runtime as LocalRuntime};
|
||||
use log::{warn, debug};
|
||||
|
||||
use super::{Network, Collators};
|
||||
|
||||
type TaskExecutor = Arc<dyn futures::future::Executor<Box<dyn Future<Item = (), Error = ()> + Send>> + Send + Sync>;
|
||||
|
||||
/// Gets a list of the candidates in a block.
|
||||
pub(crate) fn fetch_candidates<P: BlockBody<Block>>(client: &P, block: &BlockId)
|
||||
-> ClientResult<Option<impl Iterator<Item=CandidateReceipt>>>
|
||||
@@ -179,14 +182,18 @@ pub(crate) fn start<C, N, P, SC>(
|
||||
};
|
||||
|
||||
runtime.spawn(notifications);
|
||||
thread_pool.spawn(prune_old_sessions);
|
||||
if let Err(_) = thread_pool.execute(Box::new(prune_old_sessions)) {
|
||||
error!("Failed to spawn old sessions pruning task");
|
||||
}
|
||||
|
||||
let prune_available = prune_unneeded_availability(client, extrinsic_store)
|
||||
.select(exit.clone())
|
||||
.then(|_| Ok(()));
|
||||
|
||||
// spawn this on the tokio executor since it's fine on a thread pool.
|
||||
thread_pool.spawn(prune_available);
|
||||
if let Err(_) = thread_pool.execute(Box::new(prune_available)) {
|
||||
error!("Failed to spawn available pruning task");
|
||||
}
|
||||
|
||||
if let Err(e) = runtime.block_on(exit) {
|
||||
debug!("BFT event loop error {:?}", e);
|
||||
|
||||
Reference in New Issue
Block a user