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
+6 -6
View File
@@ -19,7 +19,7 @@
//! RPC Metadata
use std::sync::Arc;
use jsonrpc_core::futures::sync::mpsc;
use futures::channel::mpsc;
use jsonrpc_pubsub::{PubSubMetadata, Session};
/// RPC Metadata.
@@ -41,20 +41,20 @@ impl PubSubMetadata for Metadata {
impl Metadata {
/// Create new `Metadata` with session (Pub/Sub) support.
pub fn new(transport: mpsc::Sender<String>) -> Self {
pub fn new(transport: mpsc::UnboundedSender<String>) -> Self {
Metadata { session: Some(Arc::new(Session::new(transport))) }
}
/// Create new `Metadata` for tests.
#[cfg(test)]
pub fn new_test() -> (mpsc::Receiver<String>, Self) {
let (tx, rx) = mpsc::channel(1);
pub fn new_test() -> (mpsc::UnboundedReceiver<String>, Self) {
let (tx, rx) = mpsc::unbounded();
(rx, Self::new(tx))
}
}
impl From<mpsc::Sender<String>> for Metadata {
fn from(sender: mpsc::Sender<String>) -> Self {
impl From<mpsc::UnboundedSender<String>> for Metadata {
fn from(sender: mpsc::UnboundedSender<String>) -> Self {
Self::new(sender)
}
}