mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +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:
@@ -53,6 +53,7 @@
|
||||
//! included in the newly-finalized chain.
|
||||
|
||||
use futures::prelude::*;
|
||||
use futures03::{StreamExt, future::ready};
|
||||
use log::{debug, error, info};
|
||||
use futures::sync::mpsc;
|
||||
use sc_client_api::{BlockchainEvents, CallExecutor, backend::{AuxStore, Backend}, ExecutionStrategy};
|
||||
@@ -535,7 +536,7 @@ pub struct GrandpaParams<B, E, Block: BlockT, N, RA, SC, VR, X, Sp> {
|
||||
/// Handle to a future that will resolve on exit.
|
||||
pub on_exit: X,
|
||||
/// If supplied, can be used to hook on telemetry connection established events.
|
||||
pub telemetry_on_connect: Option<mpsc::UnboundedReceiver<()>>,
|
||||
pub telemetry_on_connect: Option<futures03::channel::mpsc::UnboundedReceiver<()>>,
|
||||
/// A voting rule used to potentially restrict target votes.
|
||||
pub voting_rule: VR,
|
||||
/// How to spawn background tasks.
|
||||
@@ -608,9 +609,10 @@ pub fn run_grandpa_voter<B, E, Block: BlockT, N, RA, SC, VR, X, Sp>(
|
||||
.expect("authorities is always at least an empty vector; elements are always of type string")
|
||||
}
|
||||
);
|
||||
Ok(())
|
||||
ready(())
|
||||
})
|
||||
.then(|_| -> Result<(), ()> { Ok(()) });
|
||||
.unit_error()
|
||||
.compat();
|
||||
futures::future::Either::A(events)
|
||||
} else {
|
||||
futures::future::Either::B(futures::future::empty())
|
||||
|
||||
Reference in New Issue
Block a user