Upgrade jsonrpc to 0.18.0 (#9547)

* Upgrade jsonrpc to 0.18.0

I think this says all :P

* 🤦

* Fmt etc

* Fix tests

* Fix tests again...

* Better impl

* Revert "Tell dependabot to ignore jsonrpc-* updates (#9518)"

This reverts commit 6e0cd5587d.
This commit is contained in:
Bastian Köcher
2021-08-13 08:46:07 +02:00
committed by GitHub
parent 199b2883af
commit c44aba89e6
65 changed files with 1422 additions and 1291 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0" }
thiserror = "1.0.21"
futures = { version = "0.3.1", features = ["compat"] }
futures = "0.3.16"
intervalier = "0.4.0"
log = "0.4.8"
parity-util-mem = { version = "0.10.0", default-features = false, features = ["primitive-types"] }
@@ -126,7 +126,7 @@ pub enum TransactionStatus<Hash, BlockHash> {
/// The stream of transaction events.
pub type TransactionStatusStream<Hash, BlockHash> =
dyn Stream<Item = TransactionStatus<Hash, BlockHash>> + Send + Unpin;
dyn Stream<Item = TransactionStatus<Hash, BlockHash>> + Send;
/// The import notification event stream.
pub type ImportNotificationStream<H> = futures::channel::mpsc::Receiver<H>;
@@ -210,7 +210,7 @@ pub trait TransactionPool: Send + Sync {
at: &BlockId<Self::Block>,
source: TransactionSource,
xt: TransactionFor<Self>,
) -> PoolFuture<Box<TransactionStatusStreamFor<Self>>, Self::Error>;
) -> PoolFuture<Pin<Box<TransactionStatusStreamFor<Self>>>, Self::Error>;
// *** Block production / Networking
/// Get an iterator for ready transactions ordered by priority.
+4 -4
View File
@@ -290,16 +290,16 @@ where
at: &BlockId<Self::Block>,
source: TransactionSource,
xt: TransactionFor<Self>,
) -> PoolFuture<Box<TransactionStatusStreamFor<Self>>, Self::Error> {
) -> PoolFuture<Pin<Box<TransactionStatusStreamFor<Self>>>, Self::Error> {
let at = *at;
let pool = self.pool.clone();
self.metrics.report(|metrics| metrics.submitted_transactions.inc());
async move {
pool.submit_and_watch(&at, source, xt)
.map(|result| result.map(|watcher| Box::new(watcher.into_stream()) as _))
.await
let watcher = pool.submit_and_watch(&at, source, xt).await?;
Ok(watcher.into_stream().boxed())
}
.boxed()
}