diff --git a/clients/runtime/Cargo.toml b/clients/runtime/Cargo.toml index 3de27029b..77cc04786 100644 --- a/clients/runtime/Cargo.toml +++ b/clients/runtime/Cargo.toml @@ -10,6 +10,7 @@ standalone-metadata = [] parachain-metadata-pendulum = [] parachain-metadata-amplitude = [] parachain-metadata-foucoco = [] +# If `--all-features` is specified in the cargo command, only `standalone-metadata` feature is enabled. all-features = [] testing-utils = [ diff --git a/clients/runtime/src/conn.rs b/clients/runtime/src/conn.rs index 0152f7ced..4d2f7c477 100644 --- a/clients/runtime/src/conn.rs +++ b/clients/runtime/src/conn.rs @@ -12,8 +12,7 @@ const RETRY_TIMEOUT: Duration = Duration::from_millis(1000); const CONNECTION_TIMEOUT: Duration = Duration::from_secs(10); async fn ws_transport(url: &str) -> Result<(Sender, Receiver), Error> { - - let url: Url = url.parse::().unwrap(); + let url: Url = url.parse::().map_err(Error::UrlParseError)?; WsTransportClientBuilder::default() .build(url) diff --git a/clients/runtime/src/error.rs b/clients/runtime/src/error.rs index 731af227c..c8dc70931 100644 --- a/clients/runtime/src/error.rs +++ b/clients/runtime/src/error.rs @@ -3,7 +3,7 @@ use std::{array::TryFromSliceError, fmt::Debug, io::Error as IoError, num::TryFr use codec::Error as CodecError; pub use jsonrpsee::core::Error as JsonRpseeError; use jsonrpsee::{ - client_transport::ws::{InvalidUri as UrlParseError, WsHandshakeError}, + client_transport::ws::WsHandshakeError, types::ErrorObjectOwned, }; use serde_json::Error as SerdeJsonError; @@ -81,7 +81,7 @@ pub enum Error { #[error("Timeout: {0}")] TimeElapsed(#[from] Elapsed), #[error("UrlParseError: {0}")] - UrlParseError(#[from] UrlParseError), + UrlParseError(#[from] url::ParseError), #[error("Constant not found: {0}")] ConstantNotFound(String), #[error("Currency not found")] diff --git a/clients/runtime/src/types.rs b/clients/runtime/src/types.rs index 62bb50adb..1a7d7bb82 100644 --- a/clients/runtime/src/types.rs +++ b/clients/runtime/src/types.rs @@ -171,8 +171,6 @@ pub trait PrettyPrint { } mod account_id { - //use sp_core::crypto::Ss58Codec; - use super::*; impl PrettyPrint for AccountId { @@ -188,7 +186,6 @@ mod vault_id { type RichVaultId = primitives::VaultId; type RichVaultHashable = primitives::VaultId; - //type RichVaultId = VaultId; impl crate::VaultId { pub fn new( diff --git a/clients/vault/src/process.rs b/clients/vault/src/process.rs index 524450967..acc9c400c 100644 --- a/clients/vault/src/process.rs +++ b/clients/vault/src/process.rs @@ -6,7 +6,6 @@ use std::{ str::FromStr, }; -//use runtime::AccountId; use sp_runtime::AccountId32 as AccountId; use service::Error as ServiceError; use sysinfo::{Pid, PidExt, ProcessExt, System, SystemExt};