Skip to content

Commit

Permalink
Update jsonrpsee version
Browse files Browse the repository at this point in the history
  • Loading branch information
serban300 committed Apr 1, 2024
1 parent ea040b2 commit 8cee951
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion relays/client-substrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async-std = { version = "1.9.0", features = ["attributes"] }
async-trait = "0.1.79"
codec = { package = "parity-scale-codec", version = "3.6.1" }
futures = "0.3.30"
jsonrpsee = { version = "0.17", features = ["macros", "ws-client"] }
jsonrpsee = { version = "0.22", features = ["macros", "ws-client"] }
log = { workspace = true }
num-traits = "0.2"
rand = "0.8.5"
Expand Down
2 changes: 1 addition & 1 deletion relays/client-substrate/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

use crate::SimpleRuntimeVersion;
use bp_polkadot_core::parachains::ParaId;
use jsonrpsee::core::Error as RpcError;
use jsonrpsee::core::ClientError as RpcError;
use relay_utils::MaybeConnectionError;
use sc_rpc_api::system::Health;
use sp_core::storage::StorageKey;
Expand Down
14 changes: 10 additions & 4 deletions relays/client-substrate/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use async_trait::async_trait;
use crate::{Chain, ChainWithGrandpa, TransactionStatusOf};

use jsonrpsee::{
core::{client::Subscription, RpcResult},
core::{client::Subscription, ClientError},
proc_macros::rpc,
ws_client::WsClient,
};
Expand Down Expand Up @@ -110,7 +110,9 @@ pub(crate) trait SubstrateState<C> {
#[async_trait]
pub trait SubstrateFinalityClient<C: Chain> {
/// Subscribe to finality justifications.
async fn subscribe_justifications(client: &WsClient) -> RpcResult<Subscription<Bytes>>;
async fn subscribe_justifications(
client: &WsClient,
) -> Result<Subscription<Bytes>, ClientError>;
}

/// RPC methods of Substrate `grandpa` namespace, that we are using.
Expand All @@ -125,7 +127,9 @@ pub(crate) trait SubstrateGrandpa<C> {
pub struct SubstrateGrandpaFinalityClient;
#[async_trait]
impl<C: ChainWithGrandpa> SubstrateFinalityClient<C> for SubstrateGrandpaFinalityClient {
async fn subscribe_justifications(client: &WsClient) -> RpcResult<Subscription<Bytes>> {
async fn subscribe_justifications(
client: &WsClient,
) -> Result<Subscription<Bytes>, ClientError> {
SubstrateGrandpaClient::<C>::subscribe_justifications(client).await
}
}
Expand All @@ -144,7 +148,9 @@ pub struct SubstrateBeefyFinalityClient;
// TODO: Use `ChainWithBeefy` instead of `Chain` after #1606 is merged
#[async_trait]
impl<C: Chain> SubstrateFinalityClient<C> for SubstrateBeefyFinalityClient {
async fn subscribe_justifications(client: &WsClient) -> RpcResult<Subscription<Bytes>> {
async fn subscribe_justifications(
client: &WsClient,
) -> Result<Subscription<Bytes>, ClientError> {
SubstrateBeefyClient::<C>::subscribe_justifications(client).await
}
}
Expand Down

0 comments on commit 8cee951

Please sign in to comment.