mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-04 11:37:24 +00:00
Update to jsonrpsee 0.7 and impl Stream on TransactionProgress (#380)
* Update to jsonrpsee 0.7 and impl Stream on TransactionProgress * Fix doc links after rename to next_item * Add another doc comment
This commit is contained in:
+18
-20
@@ -33,25 +33,23 @@ use core::{
|
||||
};
|
||||
use frame_metadata::RuntimeMetadataPrefixed;
|
||||
use jsonrpsee::{
|
||||
core::{
|
||||
client::{
|
||||
Client,
|
||||
ClientT,
|
||||
Subscription,
|
||||
SubscriptionClientT,
|
||||
},
|
||||
to_json_value,
|
||||
DeserializeOwned,
|
||||
Error as RpcError,
|
||||
JsonValue,
|
||||
},
|
||||
http_client::{
|
||||
HttpClient,
|
||||
HttpClientBuilder,
|
||||
},
|
||||
types::{
|
||||
to_json_value,
|
||||
traits::{
|
||||
Client,
|
||||
SubscriptionClient,
|
||||
},
|
||||
DeserializeOwned,
|
||||
Error as RpcError,
|
||||
JsonValue,
|
||||
Subscription,
|
||||
},
|
||||
ws_client::{
|
||||
WsClient,
|
||||
WsClientBuilder,
|
||||
},
|
||||
ws_client::WsClientBuilder,
|
||||
};
|
||||
use serde::{
|
||||
Deserialize,
|
||||
@@ -172,7 +170,7 @@ pub enum SubstrateTransactionStatus<Hash, BlockHash> {
|
||||
#[derive(Clone)]
|
||||
pub enum RpcClient {
|
||||
/// JSONRPC client WebSocket transport.
|
||||
WebSocket(Arc<WsClient>),
|
||||
WebSocket(Arc<Client>),
|
||||
/// JSONRPC client HTTP transport.
|
||||
// NOTE: Arc because `HttpClient` is not clone.
|
||||
Http(Arc<HttpClient>),
|
||||
@@ -239,14 +237,14 @@ impl RpcClient {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<WsClient> for RpcClient {
|
||||
fn from(client: WsClient) -> Self {
|
||||
impl From<Client> for RpcClient {
|
||||
fn from(client: Client) -> Self {
|
||||
RpcClient::WebSocket(Arc::new(client))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Arc<WsClient>> for RpcClient {
|
||||
fn from(client: Arc<WsClient>) -> Self {
|
||||
impl From<Arc<Client>> for RpcClient {
|
||||
fn from(client: Arc<Client>) -> Self {
|
||||
RpcClient::WebSocket(client)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user