Address migration comments (#2910)

* Use workspace.[authors|edition]

* Add repository.workspace = true

* Upgrade dependencies to the polkadot-sdk versions

* Upgrade async-std version

* Update jsonrpsee version

* cargo update

* use ci-unified image
This commit is contained in:
Serban Iorga
2024-04-02 00:00:56 +03:00
committed by Bastian Köcher
parent 018d6d8d1a
commit 8f26000e6a
41 changed files with 101 additions and 59 deletions
+7 -6
View File
@@ -1,23 +1,24 @@
[package]
name = "relay-substrate-client"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
repository.workspace = true
publish = false
[lints]
workspace = true
[dependencies]
async-std = { version = "1.6.5", features = ["attributes"] }
async-std = { version = "1.9.0", features = ["attributes"] }
async-trait = "0.1.79"
codec = { package = "parity-scale-codec", version = "3.1.5" }
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"
rand = "0.8.5"
scale-info = { version = "2.11.1", features = ["derive"] }
tokio = { version = "1.37", features = ["rt-multi-thread"] }
thiserror = { workspace = true }
+1 -1
View File
@@ -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;
+10 -4
View File
@@ -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,
};
@@ -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.
@@ -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
}
}
@@ -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
}
}