Switch RPCs to stable futures (#3287)

This commit is contained in:
Pierre Krieger
2019-08-02 19:52:55 +02:00
committed by Gavin Wood
parent aa86185648
commit c792dd358d
5 changed files with 18 additions and 12 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ use network::{self, PeerId};
use network::config::Roles;
use test_client::runtime::Block;
use assert_matches::assert_matches;
use futures::{prelude::*, sync::mpsc};
use futures03::{prelude::*, channel::mpsc};
use std::thread;
struct Status {
@@ -46,7 +46,7 @@ fn api<T: Into<Option<Status>>>(sync: T) -> System<Block> {
let should_have_peers = !status.is_dev;
let (tx, rx) = mpsc::unbounded();
thread::spawn(move || {
tokio::run(rx.for_each(move |request| {
futures03::executor::block_on(rx.for_each(move |request| {
match request {
Request::Health(sender) => {
let _ = sender.send(Health {
@@ -82,7 +82,7 @@ fn api<T: Into<Option<Status>>>(sync: T) -> System<Block> {
}
};
Ok(())
future::ready(())
}))
});
System::new(SystemInfo {