Make EventSubscription and FilterEvents Send-able (#471)

* Make EventSubscription and FilterEvents Send-able

* Cargo fmt

* clippy

* Remove unused import
This commit is contained in:
James Wilson
2022-03-08 10:41:36 +00:00
committed by GitHub
parent 14ef6c8256
commit a091d2b756
4 changed files with 67 additions and 12 deletions
+4 -7
View File
@@ -31,15 +31,12 @@ use crate::{
storage::StorageKeyPrefix,
Config,
Metadata,
PhantomDataSendSync,
};
use codec::{
Decode,
Encode,
};
use core::{
convert::TryInto,
marker::PhantomData,
};
use frame_metadata::RuntimeMetadataPrefixed;
pub use jsonrpsee::{
client_transport::ws::{
@@ -211,14 +208,14 @@ pub struct ReadProof<Hash> {
pub struct Rpc<T: Config> {
/// Rpc client for sending requests.
pub client: Arc<RpcClient>,
marker: PhantomData<T>,
_marker: PhantomDataSendSync<T>,
}
impl<T: Config> Clone for Rpc<T> {
fn clone(&self) -> Self {
Self {
client: self.client.clone(),
marker: PhantomData,
_marker: PhantomDataSendSync::new(),
}
}
}
@@ -228,7 +225,7 @@ impl<T: Config> Rpc<T> {
pub fn new(client: RpcClient) -> Self {
Self {
client: Arc::new(client),
marker: PhantomData,
_marker: PhantomDataSendSync::new(),
}
}