mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 13:57:58 +00:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user