mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 14:27:57 +00:00
Update the service to std futures (#4447)
* Switch service to futures03 * Fix tests * Fix service test and cli * Re-add Executor trait to SpawnTaskHandle * Fix node-service * Update babe * Fix browser node * Update aura * Revert back to tokio-executor to fix runtime panic * Add todo item * Fix service tests again * Timeout test futures * Fix tests * nits * Fix service test * Remove zstd patch * Re-add futures01 to aura and babe tests as a dev-dep * Change failing test to tee * Fix node * Upgrade tokio * fix society * Start switching grandpa to stable futures * Revert "Start switching grandpa to stable futures" This reverts commit 9c1976346237637effc07c13f7d0403daf5e71cf. * Fix utils * Revert substrate service test * Revert gitlab Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -61,7 +61,7 @@ pub use traits::GetSharedParams;
|
||||
use app_dirs::{AppInfo, AppDataType};
|
||||
use log::info;
|
||||
use lazy_static::lazy_static;
|
||||
use futures::{Future, compat::Future01CompatExt, executor::block_on};
|
||||
use futures::{Future, executor::block_on};
|
||||
use sc_telemetry::TelemetryEndpoints;
|
||||
use sp_runtime::generic::BlockId;
|
||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
|
||||
@@ -426,8 +426,7 @@ impl<'a> ParseAndPrepareExport<'a> {
|
||||
});
|
||||
|
||||
let mut export_fut = builder(config)?
|
||||
.export_blocks(file, from.into(), to, json)
|
||||
.compat();
|
||||
.export_blocks(file, from.into(), to, json);
|
||||
let fut = futures::future::poll_fn(|cx| {
|
||||
if exit_recv.try_recv().is_ok() {
|
||||
return Poll::Ready(Ok(()));
|
||||
@@ -485,8 +484,7 @@ impl<'a> ParseAndPrepareImport<'a> {
|
||||
});
|
||||
|
||||
let mut import_fut = builder(config)?
|
||||
.import_blocks(file, false)
|
||||
.compat();
|
||||
.import_blocks(file, false);
|
||||
let fut = futures::future::poll_fn(|cx| {
|
||||
if exit_recv.try_recv().is_ok() {
|
||||
return Poll::Ready(Ok(()));
|
||||
@@ -537,8 +535,7 @@ impl<'a> CheckBlock<'a> {
|
||||
|
||||
let start = std::time::Instant::now();
|
||||
let check = builder(config)?
|
||||
.check_block(block_id)
|
||||
.compat();
|
||||
.check_block(block_id);
|
||||
let mut runtime = tokio::runtime::Runtime::new().unwrap();
|
||||
runtime.block_on(check)?;
|
||||
println!("Completed in {} ms.", start.elapsed().as_millis());
|
||||
|
||||
Reference in New Issue
Block a user