Transition the transaction-pool to new futures (#3394)

* Transition the transaction-pool to new futures

* Fix tests

* Fix tests again?!
This commit is contained in:
Pierre Krieger
2019-08-15 12:01:47 +02:00
committed by Gavin Wood
parent 9d6118279e
commit 11da397db8
8 changed files with 32 additions and 33 deletions
+3 -2
View File
@@ -25,8 +25,9 @@ mod tests;
use std::{sync::Arc, convert::TryInto};
use client::{self, Client};
use crate::rpc::futures::{Sink, Stream, Future};
use crate::rpc::futures::{Sink, Future};
use crate::subscriptions::Subscriptions;
use futures03::{StreamExt as _, compat::Compat};
use jsonrpc_derive::rpc;
use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId};
use log::warn;
@@ -249,7 +250,7 @@ impl<B, E, P, RA> AuthorApi<ExHash<P>, BlockHash<P>> for Author<B, E, P, RA> whe
self.subscriptions.add(subscriber, move |sink| {
sink
.sink_map_err(|e| warn!("Error sending notifications: {:?}", e))
.send_all(watcher.into_stream().map(Ok))
.send_all(Compat::new(watcher.into_stream().map(|v| Ok::<_, ()>(Ok(v)))))
.map(|_| ())
})
}
+1
View File
@@ -23,6 +23,7 @@ use transaction_pool::{
txpool::Pool,
ChainApi,
};
use futures::Stream;
use primitives::{
H256, blake2_256, hexdisplay::HexDisplay, traits::BareCryptoStore, testing::KeyStore,
ed25519, crypto::key_types,