From 3530e28824b387d79b35ba7011f3efb8806b57b3 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Fri, 24 May 2024 22:20:30 +1000 Subject: [PATCH] update `tokio` and `jsonrpsee` --- Cargo.lock | 23 ++++++++++++----------- Cargo.toml | 14 +++++++------- src/builder/rpc_builder.rs | 4 ++-- src/server/error.rs | 2 +- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b12913..09ec761 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -439,9 +439,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jsonrpsee" -version = "0.21.0" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9579d0ca9fb30da026bac2f0f7d9576ec93489aeb7cd4971dd5b4617d82c79b2" +checksum = "cfdb12a2381ea5b2e68c3469ec604a007b367778cdb14d09612c8069ebd616ad" dependencies = [ "jsonrpsee-core", "jsonrpsee-server", @@ -451,9 +451,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.21.0" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "776d009e2f591b78c038e0d053a796f94575d66ca4e77dd84bfc5e81419e436c" +checksum = "b4b257e1ec385e07b0255dde0b933f948b5c8b8c28d42afda9587c3a967b896d" dependencies = [ "anyhow", "async-trait", @@ -473,9 +473,9 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.21.0" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7c6d1a2c58f6135810284a390d9f823d0f508db74cd914d8237802de80f98" +checksum = "12d8b6a9674422a8572e0b0abb12feeb3f2aeda86528c80d0350c2bd0923ab41" dependencies = [ "futures-util", "http", @@ -497,9 +497,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.21.0" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3266dfb045c9174b24c77c2dfe0084914bb23a6b2597d70c9dc6018392e1cd1b" +checksum = "150d6168405890a7a3231a3c74843f58b8959471f6df76078db2619ddee1d07d" dependencies = [ "anyhow", "beef", @@ -677,7 +677,7 @@ dependencies = [ [[package]] name = "qubit" -version = "0.0.9" +version = "0.0.10" dependencies = [ "axum", "futures", @@ -941,9 +941,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.35.1" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -976,6 +976,7 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", + "tokio-util", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index eb62f8d..3a1fbe0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,24 +1,24 @@ -workspace = { members = [ "./crates/*", "./examples/*" ] } +workspace = { members = ["./crates/*", "./examples/*"] } [package] name = "qubit" version = "0.0.10" edition = "2021" -authors = [ "Tom Anderson " ] +authors = ["Tom Anderson "] repository = "https://github.com/andogq/qubit" license = "MIT" description = "Type-safe framework for an JSONRPC server written in Rust with an automatically generated TypeScript client." -exclude = [ "./client", "./example" ] +exclude = ["./client", "./example"] [dependencies] axum = "0.6.20" futures = "0.3.30" http = "0.2.9" -hyper = { version = "0.14.10", features = [ "server" ] } -jsonrpsee = { version = "0.21.0", features = [ "server" ] } -serde = { version = "1.0.195", features = [ "derive" ] } +hyper = { version = "0.14.28", features = ["server"] } +jsonrpsee = { version = "0.22.5", features = ["server"] } +serde = { version = "1.0.195", features = ["derive"] } serde_json = "1.0.111" -tokio = { version = "1.35.1", features = [ "rt", "rt-multi-thread" ] } +tokio = { version = "1.37.0", features = ["rt", "rt-multi-thread"] } tower = "0.4.13" ts-rs = "8.1.0" qubit-macros = { version = "0.0.7", path = "./crates/qubit-macros" } diff --git a/src/builder/rpc_builder.rs b/src/builder/rpc_builder.rs index 11b94fa..134732a 100644 --- a/src/builder/rpc_builder.rs +++ b/src/builder/rpc_builder.rs @@ -1,6 +1,6 @@ use std::ops::Deref; -use futures::{Future, FutureExt, Stream, StreamExt}; +use futures::{Future, Stream, StreamExt}; use jsonrpsee::{ types::{Params, ResponsePayload}, RpcModule, SubscriptionCloseResponse, SubscriptionMessage, @@ -70,7 +70,7 @@ where }; // Run the actual handler - ResponsePayload::result(handler(ctx, params).await) + ResponsePayload::success(handler(ctx, params).await) } }) .unwrap(); diff --git a/src/server/error.rs b/src/server/error.rs index 2c69252..b4933e8 100644 --- a/src/server/error.rs +++ b/src/server/error.rs @@ -39,7 +39,7 @@ impl From<&RpcError> for ErrorObjectOwned { impl IntoResponse for RpcError { type Output = ::Output; - fn into_response(self) -> jsonrpsee::types::ResponsePayload<'static, Self::Output> { + fn into_response(self) -> jsonrpsee::ResponsePayload<'static, Self::Output> { ErrorObjectOwned::from(self).into_response() } }