Clone + Debug on Payloads/Addresses, and compare child storage results (#1203)

* Clone + Debug on Payloads/Addresses, and compare child storage results

* , to .

* clippy and fixes

* fix

* use derivative instead to remove boilerplate impls

* add missing import

* tidy up and extend wasm test timeout

* try 5 mins instead of 2
This commit is contained in:
James Wilson
2023-10-18 22:05:38 +01:00
committed by GitHub
parent a3b076bad1
commit 71fbfebf5a
13 changed files with 548 additions and 326 deletions
+3 -18
View File
@@ -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<T> {
client: RpcClient,
_marker: std::marker::PhantomData<T>,
}
impl<T> Clone for LegacyRpcMethods<T> {
fn clone(&self) -> Self {
Self {
client: self.client.clone(),
_marker: self._marker,
}
}
}
impl<T> std::fmt::Debug for LegacyRpcMethods<T> {
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<T: Config> LegacyRpcMethods<T> {
/// Instantiate the legacy RPC method interface.
pub fn new(client: RpcClient) -> Self {