Skip to content

Commit

Permalink
impl From<Arc<WsClient>> and From<Arc<HttpClient>> (paritytech#257)
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
  • Loading branch information
gregdhill authored Sep 17, 2021
1 parent 414f817 commit 156db74
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,24 @@ impl From<WsClient> for RpcClient {
}
}

impl From<Arc<WsClient>> for RpcClient {
fn from(client: Arc<WsClient>) -> Self {
RpcClient::WebSocket(client)
}
}

impl From<HttpClient> for RpcClient {
fn from(client: HttpClient) -> Self {
RpcClient::Http(Arc::new(client))
}
}

impl From<Arc<HttpClient>> for RpcClient {
fn from(client: Arc<HttpClient>) -> Self {
RpcClient::Http(client)
}
}

#[cfg(feature = "client")]
impl From<SubxtClient> for RpcClient {
fn from(client: SubxtClient) -> Self {
Expand Down

0 comments on commit 156db74

Please sign in to comment.