From 352553312324695b4954be5b7f081bdb6a622dff Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 11 Oct 2023 14:36:23 +0200 Subject: [PATCH 1/8] Clone + Debug on Payloads/Addresses, and compare child storage results --- subxt/src/constants/constant_address.rs | 22 +++++ .../src/custom_values/custom_value_address.rs | 20 ++++ subxt/src/runtime_api/runtime_payload.rs | 25 ++++- subxt/src/storage/storage_address.rs | 28 ++++++ .../src/full_client/client/mod.rs | 40 ++++++++ .../integration-tests/src/utils/node_proc.rs | 99 ++++++++++++++----- 6 files changed, 209 insertions(+), 25 deletions(-) diff --git a/subxt/src/constants/constant_address.rs b/subxt/src/constants/constant_address.rs index e70daab492..a27120b313 100644 --- a/subxt/src/constants/constant_address.rs +++ b/subxt/src/constants/constant_address.rs @@ -33,6 +33,28 @@ pub struct Address { _marker: std::marker::PhantomData, } +impl Clone for Address { + fn clone(&self) -> Self { + Self { + pallet_name: self.pallet_name.clone(), + constant_name: self.constant_name.clone(), + constant_hash: self.constant_hash, + _marker: self._marker, + } + } +} + +impl std::fmt::Debug for Address { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Address") + .field("pallet_name", &self.pallet_name) + .field("constant_name", &self.constant_name) + .field("constant_hash", &self.constant_hash) + .field("_marker", &self._marker) + .finish() + } +} + /// The type of address typically used to return dynamic constant values. pub type DynamicAddress = Address; diff --git a/subxt/src/custom_values/custom_value_address.rs b/subxt/src/custom_values/custom_value_address.rs index 49e13753e1..b8712f2547 100644 --- a/subxt/src/custom_values/custom_value_address.rs +++ b/subxt/src/custom_values/custom_value_address.rs @@ -42,6 +42,26 @@ pub struct StaticAddress { phantom: PhantomData<(ReturnTy, IsDecodable)>, } +impl Clone for StaticAddress { + fn clone(&self) -> Self { + Self { + name: self.name, + hash: self.hash, + phantom: self.phantom, + } + } +} + +impl std::fmt::Debug for StaticAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("StaticAddress") + .field("name", &self.name) + .field("hash", &self.hash) + .field("phantom", &self.phantom) + .finish() + } +} + impl StaticAddress { #[doc(hidden)] /// Creates a new StaticAddress. diff --git a/subxt/src/runtime_api/runtime_payload.rs b/subxt/src/runtime_api/runtime_payload.rs index ec19f283da..8f3f3a46b5 100644 --- a/subxt/src/runtime_api/runtime_payload.rs +++ b/subxt/src/runtime_api/runtime_payload.rs @@ -65,7 +65,6 @@ pub trait RuntimeApiPayload { /// /// This can be created from static values (ie those generated /// via the `subxt` macro) or dynamic values via [`dynamic`]. -#[derive(Clone, Debug)] pub struct Payload { trait_name: Cow<'static, str>, method_name: Cow<'static, str>, @@ -74,6 +73,30 @@ pub struct Payload { _marker: PhantomData, } +impl Clone for Payload { + fn clone(&self) -> Self { + Self { + trait_name: self.trait_name.clone(), + method_name: self.method_name.clone(), + args_data: self.args_data.clone(), + validation_hash: self.validation_hash, + _marker: self._marker, + } + } +} + +impl std::fmt::Debug for Payload { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Payload") + .field("trait_name", &self.trait_name) + .field("method_name", &self.method_name) + .field("args_data", &self.args_data) + .field("validation_hash", &self.validation_hash) + .field("_marker", &self._marker) + .finish() + } +} + impl RuntimeApiPayload for Payload { diff --git a/subxt/src/storage/storage_address.rs b/subxt/src/storage/storage_address.rs index a1ad3c5fff..9572f58bd9 100644 --- a/subxt/src/storage/storage_address.rs +++ b/subxt/src/storage/storage_address.rs @@ -59,6 +59,34 @@ pub struct Address { _marker: std::marker::PhantomData<(ReturnTy, Fetchable, Defaultable, Iterable)>, } +impl Clone + for Address +{ + fn clone(&self) -> Self { + Self { + pallet_name: self.pallet_name.clone(), + entry_name: self.entry_name.clone(), + storage_entry_keys: self.storage_entry_keys.clone(), + validation_hash: self.validation_hash, + _marker: self._marker, + } + } +} + +impl std::fmt::Debug + for Address +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Address") + .field("pallet_name", &self.pallet_name) + .field("entry_name", &self.entry_name) + .field("storage_entry_keys", &self.storage_entry_keys) + .field("validation_hash", &self.validation_hash) + .field("_marker", &self._marker) + .finish() + } +} + /// A typical storage address constructed at runtime rather than via the `subxt` macro; this /// has no restriction on what it can be used for (since we don't statically know). pub type DynamicAddress = Address; diff --git a/testing/integration-tests/src/full_client/client/mod.rs b/testing/integration-tests/src/full_client/client/mod.rs index 416fbfb19b..dd4fc71dff 100644 --- a/testing/integration-tests/src/full_client/client/mod.rs +++ b/testing/integration-tests/src/full_client/client/mod.rs @@ -60,6 +60,46 @@ async fn storage_iter() { assert_eq!(len, 13); } +#[tokio::test] +async fn storage_child_values_same_across_backends() { + let ctx = test_context().await; + + let unstable_client = ctx.unstable_client().await; + let legacy_client = ctx.legacy_client().await; + + let addr = node_runtime::storage().system().account_iter(); + let block_ref = legacy_client + .blocks() + .at_latest() + .await + .unwrap() + .reference(); + + let a: Vec<_> = unstable_client + .storage() + .at(block_ref.clone()) + .iter(addr.clone()) + .await + .unwrap() + .collect() + .await; + let b: Vec<_> = legacy_client + .storage() + .at(block_ref.clone()) + .iter(addr) + .await + .unwrap() + .collect() + .await; + + for (a, b) in a.into_iter().zip(b.into_iter()) { + let a = a.unwrap(); + let b = b.unwrap(); + + assert_eq!(a, b); + } +} + #[tokio::test] async fn transaction_validation() { let ctx = test_context().await; diff --git a/testing/integration-tests/src/utils/node_proc.rs b/testing/integration-tests/src/utils/node_proc.rs index b49fa8125a..97eee9b82f 100644 --- a/testing/integration-tests/src/utils/node_proc.rs +++ b/testing/integration-tests/src/utils/node_proc.rs @@ -2,6 +2,7 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. +use std::cell::RefCell; use std::ffi::{OsStr, OsString}; use std::sync::Arc; use substrate_runner::SubstrateNode; @@ -18,6 +19,12 @@ pub struct TestNodeProcess { // Keep a handle to the node; once it's dropped the node is killed. proc: SubstrateNode, + // Lazily construct these when asked for, + unstable_client: RefCell>>, + legacy_client: RefCell>>, + + rpc_client: rpc::RpcClient, + #[cfg(not(feature = "unstable-light-client"))] client: OnlineClient, @@ -49,14 +56,42 @@ where unstable::UnstableRpcMethods::new(rpc_client) } - async fn rpc_client(&self) -> rpc::RpcClient { + /// Hand back an RPC client connected to the test node. + pub async fn rpc_client(&self) -> rpc::RpcClient { let url = format!("ws://127.0.0.1:{}", self.proc.ws_port()); rpc::RpcClient::from_url(url) .await .expect("Unable to connect RPC client to test node") } - /// Returns the subxt client connected to the running node. + /// Always return a client using the unstable backend. + /// Only use for comparing backends; use [`TestNodeProcess::client()`] normally, + /// which enables us to run each test against both backends. + pub async fn unstable_client(&self) -> OnlineClient { + if self.unstable_client.borrow().is_none() { + let c = build_unstable_client(self.rpc_client.clone()) + .await + .unwrap(); + self.unstable_client.replace(Some(c)); + } + self.unstable_client.borrow().as_ref().unwrap().clone() + } + + /// Always return a client using the legacy backend. + /// Only use for comparing backends; use [`TestNodeProcess::client()`] normally, + /// which enables us to run each test against both backends. + pub async fn legacy_client(&self) -> OnlineClient { + if self.legacy_client.borrow().is_none() { + let c = build_legacy_client(self.rpc_client.clone()).await.unwrap(); + self.legacy_client.replace(Some(c)); + } + self.legacy_client.borrow().as_ref().unwrap().clone() + } + + /// Returns the subxt client connected to the running node. This client + /// will use the legacy backend by default or the unstable backend if the + /// "unstable-backend-client" feature is enabled, so that we can run each + /// test against both. #[cfg(not(feature = "unstable-light-client"))] pub fn client(&self) -> OnlineClient { self.client.clone() @@ -115,36 +150,57 @@ impl TestNodeProcessBuilder { // Spawn the node and retrieve a URL to it: let proc = node_builder.spawn().map_err(|e| e.to_string())?; let ws_url = format!("ws://127.0.0.1:{}", proc.ws_port()); + let rpc_client = build_rpc_client::(&ws_url) + .await + .map_err(|e| format!("Failed to connect to node at {ws_url}: {e}"))?; + + // Cache whatever client we build, and None for the other. + #[allow(unused_assignments, unused_mut)] + let mut unstable_client = None; + #[allow(unused_assignments, unused_mut)] + let mut legacy_client = None; #[cfg(feature = "unstable-light-client")] let client = build_light_client(&proc).await; #[cfg(feature = "unstable-backend-client")] - let client = build_unstable_client(&proc).await; + let client = { + let client = build_unstable_client(rpc_client.clone()).await?; + unstable_client = Some(client.clone()); + client + }; #[cfg(all( not(feature = "unstable-light-client"), not(feature = "unstable-backend-client") ))] - let client = build_legacy_client(&proc).await; - - match client { - Ok(client) => Ok(TestNodeProcess { proc, client }), - Err(err) => Err(format!("Failed to connect to node rpc at {ws_url}: {err}")), - } + let client = { + let client = build_legacy_client(rpc_client.clone()).await?; + legacy_client = Some(client.clone()); + client + }; + + Ok(TestNodeProcess { + proc, + client, + legacy_client: RefCell::new(legacy_client), + unstable_client: RefCell::new(unstable_client), + rpc_client, + }) } } -#[cfg(all( - not(feature = "unstable-light-client"), - not(feature = "unstable-backend-client") -))] -async fn build_legacy_client(proc: &SubstrateNode) -> Result, String> { - let ws_url = format!("ws://127.0.0.1:{}", proc.ws_port()); - +async fn build_rpc_client(ws_url: &str) -> Result { let rpc_client = rpc::RpcClient::from_url(ws_url) .await .map_err(|e| format!("Cannot construct RPC client: {e}"))?; + + Ok(rpc_client) +} + +async fn build_legacy_client( + rpc_client: rpc::RpcClient, +) -> Result, String> { let backend = legacy::LegacyBackend::new(rpc_client); let client = OnlineClient::from_backend(Arc::new(backend)) .await @@ -153,14 +209,9 @@ async fn build_legacy_client(proc: &SubstrateNode) -> Result(proc: &SubstrateNode) -> Result, String> { - let ws_url = format!("ws://127.0.0.1:{}", proc.ws_port()); - - let rpc_client = rpc::RpcClient::from_url(ws_url) - .await - .map_err(|e| format!("Cannot construct RPC client: {e}"))?; - +async fn build_unstable_client( + rpc_client: rpc::RpcClient, +) -> Result, String> { let (backend, mut driver) = unstable::UnstableBackend::builder().build(rpc_client); // The unstable backend needs driving: From 34ede1185a504667d6a6bb179fd9192aa0b66d64 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 11 Oct 2023 15:02:58 +0200 Subject: [PATCH 2/8] , to . --- testing/integration-tests/src/utils/node_proc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/integration-tests/src/utils/node_proc.rs b/testing/integration-tests/src/utils/node_proc.rs index 97eee9b82f..6b7594cf60 100644 --- a/testing/integration-tests/src/utils/node_proc.rs +++ b/testing/integration-tests/src/utils/node_proc.rs @@ -19,7 +19,7 @@ pub struct TestNodeProcess { // Keep a handle to the node; once it's dropped the node is killed. proc: SubstrateNode, - // Lazily construct these when asked for, + // Lazily construct these when asked for. unstable_client: RefCell>>, legacy_client: RefCell>>, From 234ffe8ab9e09c55ed2e7d1fcc50051f2649590f Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 17 Oct 2023 10:50:05 +0100 Subject: [PATCH 3/8] clippy and fixes --- testing/integration-tests/src/utils/node_proc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/integration-tests/src/utils/node_proc.rs b/testing/integration-tests/src/utils/node_proc.rs index 6b7594cf60..53d26e3a3f 100644 --- a/testing/integration-tests/src/utils/node_proc.rs +++ b/testing/integration-tests/src/utils/node_proc.rs @@ -161,7 +161,7 @@ impl TestNodeProcessBuilder { let mut legacy_client = None; #[cfg(feature = "unstable-light-client")] - let client = build_light_client(&proc).await; + let client = build_light_client(&proc).await?; #[cfg(feature = "unstable-backend-client")] let client = { @@ -190,7 +190,7 @@ impl TestNodeProcessBuilder { } } -async fn build_rpc_client(ws_url: &str) -> Result { +async fn build_rpc_client(ws_url: &str) -> Result { let rpc_client = rpc::RpcClient::from_url(ws_url) .await .map_err(|e| format!("Cannot construct RPC client: {e}"))?; From 2609ac9a24b510d2f2ff7742718837ecfbe4e0dd Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 17 Oct 2023 11:57:10 +0100 Subject: [PATCH 4/8] fix --- testing/integration-tests/src/utils/node_proc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/integration-tests/src/utils/node_proc.rs b/testing/integration-tests/src/utils/node_proc.rs index 53d26e3a3f..0bcb72cc1e 100644 --- a/testing/integration-tests/src/utils/node_proc.rs +++ b/testing/integration-tests/src/utils/node_proc.rs @@ -150,7 +150,7 @@ impl TestNodeProcessBuilder { // Spawn the node and retrieve a URL to it: let proc = node_builder.spawn().map_err(|e| e.to_string())?; let ws_url = format!("ws://127.0.0.1:{}", proc.ws_port()); - let rpc_client = build_rpc_client::(&ws_url) + let rpc_client = build_rpc_client(&ws_url) .await .map_err(|e| format!("Failed to connect to node at {ws_url}: {e}"))?; From 7ce27c37bdee1ddb324c0fb318d2a8d2f7c588e8 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 17 Oct 2023 17:10:30 +0100 Subject: [PATCH 5/8] use derivative instead to remove boilerplate impls --- subxt/src/backend/legacy/rpc_methods.rs | 21 ++---------- subxt/src/backend/unstable/rpc_methods.rs | 21 ++---------- subxt/src/constants/constant_address.rs | 25 ++------------ .../src/custom_values/custom_value_address.rs | 22 ++---------- subxt/src/runtime_api/runtime_payload.rs | 30 ++++------------ subxt/src/storage/storage_address.rs | 34 ++++--------------- 6 files changed, 23 insertions(+), 130 deletions(-) diff --git a/subxt/src/backend/legacy/rpc_methods.rs b/subxt/src/backend/legacy/rpc_methods.rs index 0adb2a0f18..b4f619f4f4 100644 --- a/subxt/src/backend/legacy/rpc_methods.rs +++ b/subxt/src/backend/legacy/rpc_methods.rs @@ -8,35 +8,20 @@ use crate::backend::rpc::{rpc_params, RpcClient, RpcSubscription}; use crate::metadata::Metadata; use crate::{Config, Error}; use codec::Decode; +use derivative::Derivative; use primitive_types::U256; use serde::{Deserialize, Serialize}; /// An interface to call the legacy RPC methods. This interface is instantiated with /// some `T: Config` trait which determines some of the types that the RPC methods will /// take or hand back. +#[derive(Derivative)] +#[derivative(Clone(bound = ""), Debug(bound = ""))] pub struct LegacyRpcMethods { client: RpcClient, _marker: std::marker::PhantomData, } -impl Clone for LegacyRpcMethods { - fn clone(&self) -> Self { - Self { - client: self.client.clone(), - _marker: self._marker, - } - } -} - -impl std::fmt::Debug for LegacyRpcMethods { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("LegacyRpcMethods") - .field("client", &self.client) - .field("_marker", &self._marker) - .finish() - } -} - impl LegacyRpcMethods { /// Instantiate the legacy RPC method interface. pub fn new(client: RpcClient) -> Self { diff --git a/subxt/src/backend/unstable/rpc_methods.rs b/subxt/src/backend/unstable/rpc_methods.rs index 5df83f4d97..5e0764f9ce 100644 --- a/subxt/src/backend/unstable/rpc_methods.rs +++ b/subxt/src/backend/unstable/rpc_methods.rs @@ -9,6 +9,7 @@ use crate::backend::rpc::{rpc_params, RpcClient, RpcSubscription}; use crate::config::BlockHash; use crate::{Config, Error}; +use derivative::Derivative; use futures::{Stream, StreamExt}; use serde::{Deserialize, Serialize}; use std::collections::{HashMap, VecDeque}; @@ -17,29 +18,13 @@ use std::task::Poll; /// An interface to call the unstable RPC methods. This interface is instantiated with /// some `T: Config` trait which determines some of the types that the RPC methods will /// take or hand back. +#[derive(Derivative)] +#[derivative(Clone(bound = ""), Debug(bound = ""))] pub struct UnstableRpcMethods { client: RpcClient, _marker: std::marker::PhantomData, } -impl Clone for UnstableRpcMethods { - fn clone(&self) -> Self { - Self { - client: self.client.clone(), - _marker: self._marker, - } - } -} - -impl std::fmt::Debug for UnstableRpcMethods { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("UnstableRpcMethods") - .field("client", &self.client) - .field("_marker", &self._marker) - .finish() - } -} - impl UnstableRpcMethods { /// Instantiate the legacy RPC method interface. pub fn new(client: RpcClient) -> Self { diff --git a/subxt/src/constants/constant_address.rs b/subxt/src/constants/constant_address.rs index a27120b313..e9a0eb37b0 100644 --- a/subxt/src/constants/constant_address.rs +++ b/subxt/src/constants/constant_address.rs @@ -3,6 +3,7 @@ // see LICENSE for license details. use crate::{dynamic::DecodedValueThunk, metadata::DecodeWithMetadata}; +use derivative::Derivative; use std::borrow::Cow; /// This represents a constant address. Anything implementing this trait @@ -26,6 +27,8 @@ pub trait ConstantAddress { } /// This represents the address of a constant. +#[derive(Derivative)] +#[derivative(Clone(bound = ""), Debug(bound = ""))] pub struct Address { pallet_name: Cow<'static, str>, constant_name: Cow<'static, str>, @@ -33,28 +36,6 @@ pub struct Address { _marker: std::marker::PhantomData, } -impl Clone for Address { - fn clone(&self) -> Self { - Self { - pallet_name: self.pallet_name.clone(), - constant_name: self.constant_name.clone(), - constant_hash: self.constant_hash, - _marker: self._marker, - } - } -} - -impl std::fmt::Debug for Address { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("Address") - .field("pallet_name", &self.pallet_name) - .field("constant_name", &self.constant_name) - .field("constant_hash", &self.constant_hash) - .field("_marker", &self._marker) - .finish() - } -} - /// The type of address typically used to return dynamic constant values. pub type DynamicAddress = Address; diff --git a/subxt/src/custom_values/custom_value_address.rs b/subxt/src/custom_values/custom_value_address.rs index b8712f2547..d1e9ab7d15 100644 --- a/subxt/src/custom_values/custom_value_address.rs +++ b/subxt/src/custom_values/custom_value_address.rs @@ -36,32 +36,14 @@ impl CustomValueAddress for str { pub struct Yes; /// A static address to a custom value. +#[derive(Derivative)] +#[derivative(Clone(bound = ""), Debug(bound = ""))] pub struct StaticAddress { name: &'static str, hash: Option<[u8; 32]>, phantom: PhantomData<(ReturnTy, IsDecodable)>, } -impl Clone for StaticAddress { - fn clone(&self) -> Self { - Self { - name: self.name, - hash: self.hash, - phantom: self.phantom, - } - } -} - -impl std::fmt::Debug for StaticAddress { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("StaticAddress") - .field("name", &self.name) - .field("hash", &self.hash) - .field("phantom", &self.phantom) - .finish() - } -} - impl StaticAddress { #[doc(hidden)] /// Creates a new StaticAddress. diff --git a/subxt/src/runtime_api/runtime_payload.rs b/subxt/src/runtime_api/runtime_payload.rs index 8f3f3a46b5..cd5a3355b8 100644 --- a/subxt/src/runtime_api/runtime_payload.rs +++ b/subxt/src/runtime_api/runtime_payload.rs @@ -3,6 +3,7 @@ // see LICENSE for license details. use core::marker::PhantomData; +use derivative::Derivative; use scale_encode::EncodeAsFields; use scale_value::Composite; use std::borrow::Cow; @@ -65,6 +66,11 @@ pub trait RuntimeApiPayload { /// /// This can be created from static values (ie those generated /// via the `subxt` macro) or dynamic values via [`dynamic`]. +#[derive(Derivative)] +#[derivative( + Clone(bound = "ArgsData: Clone"), + Debug(bound = "ArgsData: std::fmt::Debug") +)] pub struct Payload { trait_name: Cow<'static, str>, method_name: Cow<'static, str>, @@ -73,30 +79,6 @@ pub struct Payload { _marker: PhantomData, } -impl Clone for Payload { - fn clone(&self) -> Self { - Self { - trait_name: self.trait_name.clone(), - method_name: self.method_name.clone(), - args_data: self.args_data.clone(), - validation_hash: self.validation_hash, - _marker: self._marker, - } - } -} - -impl std::fmt::Debug for Payload { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("Payload") - .field("trait_name", &self.trait_name) - .field("method_name", &self.method_name) - .field("args_data", &self.args_data) - .field("validation_hash", &self.validation_hash) - .field("_marker", &self._marker) - .finish() - } -} - impl RuntimeApiPayload for Payload { diff --git a/subxt/src/storage/storage_address.rs b/subxt/src/storage/storage_address.rs index 9572f58bd9..df6fdbb874 100644 --- a/subxt/src/storage/storage_address.rs +++ b/subxt/src/storage/storage_address.rs @@ -8,6 +8,7 @@ use crate::{ metadata::{DecodeWithMetadata, EncodeWithMetadata, Metadata}, utils::{Encoded, Static}, }; +use derivative::Derivative; use scale_info::TypeDef; use std::borrow::Cow; use subxt_metadata::{StorageEntryType, StorageHasher}; @@ -51,6 +52,11 @@ pub struct Yes; /// A concrete storage address. This can be created from static values (ie those generated /// via the `subxt` macro) or dynamic values via [`dynamic`]. +#[derive(Derivative)] +#[derivative( + Clone(bound = "StorageKey: Clone"), + Debug(bound = "StorageKey: std::fmt::Debug") +)] pub struct Address { pallet_name: Cow<'static, str>, entry_name: Cow<'static, str>, @@ -59,34 +65,6 @@ pub struct Address { _marker: std::marker::PhantomData<(ReturnTy, Fetchable, Defaultable, Iterable)>, } -impl Clone - for Address -{ - fn clone(&self) -> Self { - Self { - pallet_name: self.pallet_name.clone(), - entry_name: self.entry_name.clone(), - storage_entry_keys: self.storage_entry_keys.clone(), - validation_hash: self.validation_hash, - _marker: self._marker, - } - } -} - -impl std::fmt::Debug - for Address -{ - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("Address") - .field("pallet_name", &self.pallet_name) - .field("entry_name", &self.entry_name) - .field("storage_entry_keys", &self.storage_entry_keys) - .field("validation_hash", &self.validation_hash) - .field("_marker", &self._marker) - .finish() - } -} - /// A typical storage address constructed at runtime rather than via the `subxt` macro; this /// has no restriction on what it can be used for (since we don't statically know). pub type DynamicAddress = Address; From 579c97e2e4fbab290769105af102b445172d06de Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 17 Oct 2023 17:28:47 +0100 Subject: [PATCH 6/8] add missing import --- subxt/src/custom_values/custom_value_address.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/subxt/src/custom_values/custom_value_address.rs b/subxt/src/custom_values/custom_value_address.rs index d1e9ab7d15..f8034a161b 100644 --- a/subxt/src/custom_values/custom_value_address.rs +++ b/subxt/src/custom_values/custom_value_address.rs @@ -1,3 +1,4 @@ +use derivative::Derivative; use std::marker::PhantomData; use crate::dynamic::DecodedValueThunk; From 731099cd9133bd162fe5c4a6992914a1fc566f5d Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 18 Oct 2023 10:54:38 +0100 Subject: [PATCH 7/8] tidy up and extend wasm test timeout --- .github/workflows/rust.yml | 3 + subxt/src/client/light_client/builder.rs | 2 +- testing/wasm-lightclient-tests/Cargo.lock | 332 +++++++++++-------- testing/wasm-lightclient-tests/tests/wasm.rs | 5 +- testing/wasm-rpc-tests/Cargo.lock | 332 +++++++++++-------- 5 files changed, 409 insertions(+), 265 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c57dca3b7d..1ad054e6be 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -240,6 +240,9 @@ jobs: wasm_tests: name: Test (WASM) runs-on: ubuntu-latest + env: + # Set timeout for wasm tests to 120 secs; default is too low sometimes. + WASM_BINDGEN_TEST_TIMEOUT: 120 steps: - uses: actions/checkout@v4 diff --git a/subxt/src/client/light_client/builder.rs b/subxt/src/client/light_client/builder.rs index 5669654eee..8c02f2f761 100644 --- a/subxt/src/client/light_client/builder.rs +++ b/subxt/src/client/light_client/builder.rs @@ -3,7 +3,7 @@ // see LICENSE for license details. use super::{rpc::LightClientRpc, LightClient, LightClientError}; -use crate::backend::{rpc::RpcClient, Backend}; +use crate::backend::rpc::RpcClient; use crate::{config::Config, error::Error, OnlineClient}; use std::num::NonZeroU32; use subxt_lightclient::{AddChainConfig, AddChainConfigJsonRpc, ChainId}; diff --git a/testing/wasm-lightclient-tests/Cargo.lock b/testing/wasm-lightclient-tests/Cargo.lock index 43753b916c..5720150450 100644 --- a/testing/wasm-lightclient-tests/Cargo.lock +++ b/testing/wasm-lightclient-tests/Cargo.lock @@ -101,13 +101,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -483,12 +483,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.1", - "darling_macro 0.20.1", + "darling_core 0.20.3", + "darling_macro 0.20.3", ] [[package]] @@ -507,16 +507,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -532,13 +532,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.1", + "darling_core 0.20.3", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -607,9 +607,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "event-listener" @@ -641,6 +641,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + [[package]] name = "frame-metadata" version = "15.1.0" @@ -714,7 +723,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -798,14 +807,15 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gloo-net" -version = "0.2.6" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9902a044653b26b99f7e3693a42f171312d9be8b26b5697bd1e43ad1f8a35e10" +checksum = "8ac9e8288ae2c632fa9f8657ac70bfe38a1530f345282d7ba66a1f70b72b7dc4" dependencies = [ "futures-channel", "futures-core", "futures-sink", "gloo-utils", + "http", "js-sys", "pin-project", "serde", @@ -830,9 +840,9 @@ dependencies = [ [[package]] name = "gloo-utils" -version = "0.1.7" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" dependencies = [ "js-sys", "serde", @@ -980,7 +990,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -989,10 +999,11 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", "log", @@ -1000,7 +1011,6 @@ dependencies = [ "rustls-native-certs", "tokio", "tokio-rustls", - "webpki-roots", ] [[package]] @@ -1009,6 +1019,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -1098,9 +1118,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" +checksum = "de902baa44bf34a58b1a4906f8b840d7d60dcec5f41fe08b4dbc14cf9efa821c" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -1110,18 +1130,15 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.16.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb" +checksum = "58d9851f8f5653e0433a898e9032bde4910b35d625bd9dcf33ef6e36e7c3d456" dependencies = [ - "anyhow", "futures-channel", - "futures-timer", "futures-util", "gloo-net", "http", "jsonrpsee-core", - "jsonrpsee-types", "pin-project", "rustls-native-certs", "soketto", @@ -1130,20 +1147,19 @@ dependencies = [ "tokio-rustls", "tokio-util", "tracing", - "webpki-roots", + "url", ] [[package]] name = "jsonrpsee-core" -version = "0.16.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" +checksum = "51f45d37af23707750136379f6799e76ebfcf2d425ec4e36d0deb7921da5e65c" dependencies = [ "anyhow", "async-lock", "async-trait", "beef", - "futures-channel", "futures-timer", "futures-util", "hyper", @@ -1159,28 +1175,29 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.16.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc345b0a43c6bc49b947ebeb936e886a419ee3d894421790c969cc56040542ad" +checksum = "02308562f2e8162a32f8d6c3dc19c29c858d5d478047c886a5c3c25b5f7fa868" dependencies = [ "async-trait", "hyper", "hyper-rustls", "jsonrpsee-core", "jsonrpsee-types", - "rustc-hash", "serde", "serde_json", "thiserror", "tokio", + "tower", "tracing", + "url", ] [[package]] name = "jsonrpsee-types" -version = "0.16.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c" +checksum = "05eaff23af19f10ba6fbb76519bed6da4d3b9bbaef13d39b7c2b6c14e532d27e" dependencies = [ "anyhow", "beef", @@ -1479,6 +1496,12 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + [[package]] name = "pin-project" version = "1.1.0" @@ -1496,14 +1519,14 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1548,9 +1571,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -1595,18 +1618,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1697,14 +1720,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -1728,6 +1751,16 @@ dependencies = [ "base64 0.21.2", ] +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "ruzstd" version = "0.4.0" @@ -1747,9 +1780,9 @@ checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "scale-bits" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" dependencies = [ "parity-scale-codec", "scale-info", @@ -1758,24 +1791,24 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0459d00b0dbd2e765009924a78ef36b2ff7ba116292d732f00eb0ed8e465d15" +checksum = "7789f5728e4e954aaa20cadcc370b99096fb8645fca3c9333ace44bb18f30095" dependencies = [ + "derive_more", "parity-scale-codec", "primitive-types", "scale-bits", "scale-decode-derive", "scale-info", "smallvec", - "thiserror", ] [[package]] name = "scale-decode-derive" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4391f0dfbb6690f035f6d2a15d6a12f88cc5395c36bcc056db07ffa2a90870ec" +checksum = "27873eb6005868f8cc72dcfe109fae664cf51223d35387bc2f28be4c28d94c47" dependencies = [ "darling 0.14.4", "proc-macro-crate", @@ -1786,24 +1819,24 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0401b7cdae8b8aa33725f3611a051358d5b32887ecaa0fda5953a775b2d4d76" +checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" dependencies = [ + "derive_more", "parity-scale-codec", "primitive-types", "scale-bits", "scale-encode-derive", "scale-info", "smallvec", - "thiserror", ] [[package]] name = "scale-encode-derive" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316e0fb10ec0fee266822bd641bab5e332a4ab80ef8c5b5ff35e5401a394f5a6" +checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" dependencies = [ "darling 0.14.4", "proc-macro-crate", @@ -1840,12 +1873,13 @@ dependencies = [ [[package]] name = "scale-value" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2096d36e94ce9bf87d8addb752423b6b19730dc88edd7cc452bb2b90573f7a7" +checksum = "6538d1cc1af9c0baf401c57da8a6d4730ef582db0d330d2efa56ec946b5b0283" dependencies = [ "base58", "blake2", + "derive_more", "either", "frame-metadata 15.1.0", "parity-scale-codec", @@ -1854,7 +1888,6 @@ dependencies = [ "scale-encode", "scale-info", "serde", - "thiserror", "yap", ] @@ -1942,29 +1975,29 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.171" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -2150,6 +2183,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "soketto" version = "0.7.1" @@ -2224,8 +2267,9 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "subxt" -version = "0.29.0" +version = "0.32.1" dependencies = [ + "async-trait", "base58", "blake2", "derivative", @@ -2256,9 +2300,10 @@ dependencies = [ [[package]] name = "subxt-codegen" -version = "0.29.0" +version = "0.32.1" dependencies = [ "frame-metadata 16.0.0", + "getrandom", "heck", "hex", "jsonrpsee", @@ -2267,14 +2312,14 @@ dependencies = [ "quote", "scale-info", "subxt-metadata", - "syn 2.0.26", + "syn 2.0.38", "thiserror", "tokio", ] [[package]] name = "subxt-lightclient" -version = "0.29.0" +version = "0.32.1" dependencies = [ "futures", "futures-timer", @@ -2298,17 +2343,17 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.29.0" +version = "0.32.1" dependencies = [ - "darling 0.20.1", + "darling 0.20.3", "proc-macro-error", "subxt-codegen", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "subxt-metadata" -version = "0.29.0" +version = "0.32.1" dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", @@ -2330,9 +2375,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -2347,9 +2392,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] @@ -2376,13 +2421,13 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -2421,18 +2466,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", "num_cpus", "pin-project-lite", - "socket2", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -2445,18 +2489,17 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] @@ -2502,6 +2545,27 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -2510,11 +2574,11 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" dependencies = [ - "cfg-if", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2522,20 +2586,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -2576,7 +2640,6 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand", "static_assertions", ] @@ -2598,12 +2661,27 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + [[package]] name = "unicode-ident" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "universal-hash" version = "0.4.0" @@ -2620,6 +2698,17 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + [[package]] name = "version_check" version = "0.9.4" @@ -2662,7 +2751,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -2696,7 +2785,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2795,25 +2884,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] - [[package]] name = "winapi" version = "0.3.9" @@ -2979,9 +3049,9 @@ dependencies = [ [[package]] name = "yap" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a7eb6d82a11e4d0b8e6bda8347169aff4ccd8235d039bba7c47482d977dcf7" +checksum = "ff4524214bc4629eba08d78ceb1d6507070cc0bcbbed23af74e19e6e924a24cf" [[package]] name = "zeroize" @@ -3000,5 +3070,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] diff --git a/testing/wasm-lightclient-tests/tests/wasm.rs b/testing/wasm-lightclient-tests/tests/wasm.rs index 4cd52e83a8..082fae7a61 100644 --- a/testing/wasm-lightclient-tests/tests/wasm.rs +++ b/testing/wasm-lightclient-tests/tests/wasm.rs @@ -1,7 +1,8 @@ #![cfg(target_arch = "wasm32")] -use subxt::{config::PolkadotConfig, - client::{LightClient, OfflineClientT, LightClientBuilder}, +use subxt::{ + config::PolkadotConfig, + client::{LightClient, LightClientBuilder}, }; use futures_util::StreamExt; use wasm_bindgen_test::*; diff --git a/testing/wasm-rpc-tests/Cargo.lock b/testing/wasm-rpc-tests/Cargo.lock index 1a13c21959..cd6f766902 100644 --- a/testing/wasm-rpc-tests/Cargo.lock +++ b/testing/wasm-rpc-tests/Cargo.lock @@ -101,13 +101,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -483,12 +483,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.1", - "darling_macro 0.20.1", + "darling_core 0.20.3", + "darling_macro 0.20.3", ] [[package]] @@ -507,16 +507,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -532,13 +532,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.1", + "darling_core 0.20.3", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -607,9 +607,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "event-listener" @@ -641,6 +641,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + [[package]] name = "frame-metadata" version = "15.1.0" @@ -714,7 +723,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -798,14 +807,15 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gloo-net" -version = "0.2.6" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9902a044653b26b99f7e3693a42f171312d9be8b26b5697bd1e43ad1f8a35e10" +checksum = "8ac9e8288ae2c632fa9f8657ac70bfe38a1530f345282d7ba66a1f70b72b7dc4" dependencies = [ "futures-channel", "futures-core", "futures-sink", "gloo-utils", + "http", "js-sys", "pin-project", "serde", @@ -830,9 +840,9 @@ dependencies = [ [[package]] name = "gloo-utils" -version = "0.1.7" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" dependencies = [ "js-sys", "serde", @@ -980,7 +990,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -989,10 +999,11 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", "log", @@ -1000,7 +1011,6 @@ dependencies = [ "rustls-native-certs", "tokio", "tokio-rustls", - "webpki-roots", ] [[package]] @@ -1009,6 +1019,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -1098,9 +1118,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" +checksum = "de902baa44bf34a58b1a4906f8b840d7d60dcec5f41fe08b4dbc14cf9efa821c" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -1110,18 +1130,15 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.16.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb" +checksum = "58d9851f8f5653e0433a898e9032bde4910b35d625bd9dcf33ef6e36e7c3d456" dependencies = [ - "anyhow", "futures-channel", - "futures-timer", "futures-util", "gloo-net", "http", "jsonrpsee-core", - "jsonrpsee-types", "pin-project", "rustls-native-certs", "soketto", @@ -1130,20 +1147,19 @@ dependencies = [ "tokio-rustls", "tokio-util", "tracing", - "webpki-roots", + "url", ] [[package]] name = "jsonrpsee-core" -version = "0.16.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" +checksum = "51f45d37af23707750136379f6799e76ebfcf2d425ec4e36d0deb7921da5e65c" dependencies = [ "anyhow", "async-lock", "async-trait", "beef", - "futures-channel", "futures-timer", "futures-util", "hyper", @@ -1159,28 +1175,29 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.16.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc345b0a43c6bc49b947ebeb936e886a419ee3d894421790c969cc56040542ad" +checksum = "02308562f2e8162a32f8d6c3dc19c29c858d5d478047c886a5c3c25b5f7fa868" dependencies = [ "async-trait", "hyper", "hyper-rustls", "jsonrpsee-core", "jsonrpsee-types", - "rustc-hash", "serde", "serde_json", "thiserror", "tokio", + "tower", "tracing", + "url", ] [[package]] name = "jsonrpsee-types" -version = "0.16.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c" +checksum = "05eaff23af19f10ba6fbb76519bed6da4d3b9bbaef13d39b7c2b6c14e532d27e" dependencies = [ "anyhow", "beef", @@ -1479,6 +1496,12 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + [[package]] name = "pin-project" version = "1.1.0" @@ -1496,14 +1519,14 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1548,9 +1571,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -1595,18 +1618,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1697,14 +1720,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -1728,6 +1751,16 @@ dependencies = [ "base64 0.21.2", ] +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "ruzstd" version = "0.4.0" @@ -1747,9 +1780,9 @@ checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "scale-bits" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" dependencies = [ "parity-scale-codec", "scale-info", @@ -1758,24 +1791,24 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0459d00b0dbd2e765009924a78ef36b2ff7ba116292d732f00eb0ed8e465d15" +checksum = "7789f5728e4e954aaa20cadcc370b99096fb8645fca3c9333ace44bb18f30095" dependencies = [ + "derive_more", "parity-scale-codec", "primitive-types", "scale-bits", "scale-decode-derive", "scale-info", "smallvec", - "thiserror", ] [[package]] name = "scale-decode-derive" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4391f0dfbb6690f035f6d2a15d6a12f88cc5395c36bcc056db07ffa2a90870ec" +checksum = "27873eb6005868f8cc72dcfe109fae664cf51223d35387bc2f28be4c28d94c47" dependencies = [ "darling 0.14.4", "proc-macro-crate", @@ -1786,24 +1819,24 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0401b7cdae8b8aa33725f3611a051358d5b32887ecaa0fda5953a775b2d4d76" +checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" dependencies = [ + "derive_more", "parity-scale-codec", "primitive-types", "scale-bits", "scale-encode-derive", "scale-info", "smallvec", - "thiserror", ] [[package]] name = "scale-encode-derive" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316e0fb10ec0fee266822bd641bab5e332a4ab80ef8c5b5ff35e5401a394f5a6" +checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" dependencies = [ "darling 0.14.4", "proc-macro-crate", @@ -1840,12 +1873,13 @@ dependencies = [ [[package]] name = "scale-value" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2096d36e94ce9bf87d8addb752423b6b19730dc88edd7cc452bb2b90573f7a7" +checksum = "6538d1cc1af9c0baf401c57da8a6d4730ef582db0d330d2efa56ec946b5b0283" dependencies = [ "base58", "blake2", + "derive_more", "either", "frame-metadata 15.1.0", "parity-scale-codec", @@ -1854,7 +1888,6 @@ dependencies = [ "scale-encode", "scale-info", "serde", - "thiserror", "yap", ] @@ -1942,29 +1975,29 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.171" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -2150,6 +2183,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "soketto" version = "0.7.1" @@ -2224,8 +2267,9 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "subxt" -version = "0.29.0" +version = "0.32.1" dependencies = [ + "async-trait", "base58", "blake2", "derivative", @@ -2255,9 +2299,10 @@ dependencies = [ [[package]] name = "subxt-codegen" -version = "0.29.0" +version = "0.32.1" dependencies = [ "frame-metadata 16.0.0", + "getrandom", "heck", "hex", "jsonrpsee", @@ -2266,14 +2311,14 @@ dependencies = [ "quote", "scale-info", "subxt-metadata", - "syn 2.0.26", + "syn 2.0.38", "thiserror", "tokio", ] [[package]] name = "subxt-lightclient" -version = "0.29.0" +version = "0.32.1" dependencies = [ "futures", "futures-timer", @@ -2297,17 +2342,17 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.29.0" +version = "0.32.1" dependencies = [ - "darling 0.20.1", + "darling 0.20.3", "proc-macro-error", "subxt-codegen", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "subxt-metadata" -version = "0.29.0" +version = "0.32.1" dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", @@ -2329,9 +2374,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -2346,9 +2391,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] @@ -2375,13 +2420,13 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -2420,18 +2465,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", "num_cpus", "pin-project-lite", - "socket2", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -2444,18 +2488,17 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] @@ -2501,6 +2544,27 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -2509,11 +2573,11 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" dependencies = [ - "cfg-if", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2521,20 +2585,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -2575,7 +2639,6 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand", "static_assertions", ] @@ -2597,12 +2660,27 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + [[package]] name = "unicode-ident" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "universal-hash" version = "0.4.0" @@ -2619,6 +2697,17 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + [[package]] name = "version_check" version = "0.9.4" @@ -2661,7 +2750,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -2695,7 +2784,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2794,25 +2883,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] - [[package]] name = "winapi" version = "0.3.9" @@ -2978,9 +3048,9 @@ dependencies = [ [[package]] name = "yap" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a7eb6d82a11e4d0b8e6bda8347169aff4ccd8235d039bba7c47482d977dcf7" +checksum = "ff4524214bc4629eba08d78ceb1d6507070cc0bcbbed23af74e19e6e924a24cf" [[package]] name = "zeroize" @@ -2999,5 +3069,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] From aa7f1ae07fbc99e8f91b7ecd1ce95ccc3f822296 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 18 Oct 2023 16:43:59 +0100 Subject: [PATCH 8/8] try 5 mins instead of 2 --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1ad054e6be..f3bd41c05b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -241,8 +241,8 @@ jobs: name: Test (WASM) runs-on: ubuntu-latest env: - # Set timeout for wasm tests to 120 secs; default is too low sometimes. - WASM_BINDGEN_TEST_TIMEOUT: 120 + # Set timeout for wasm tests to be much bigger than the default 20 secs. + WASM_BINDGEN_TEST_TIMEOUT: 300 steps: - uses: actions/checkout@v4