mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 18:51:12 +00:00
refactor(rpc): support default port in URL (#1122)
* refactor: support default port in URL Update jsonrpsee to v0.20 to support the default port number in URLs. * fix nit, revert web feature * fix lightclient code
This commit is contained in:
+3
-5
@@ -4,13 +4,11 @@
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
use std::str::FromStr;
|
||||
|
||||
use darling::{ast::NestedMeta, FromMeta};
|
||||
use proc_macro::TokenStream;
|
||||
use proc_macro_error::{abort_call_site, proc_macro_error};
|
||||
use subxt_codegen::{
|
||||
utils::Uri, CodegenError, DerivesRegistry, GenerateRuntimeApi, TypeSubstitutes,
|
||||
utils::Url, CodegenError, DerivesRegistry, GenerateRuntimeApi, TypeSubstitutes,
|
||||
};
|
||||
use syn::{parse_macro_input, punctuated::Punctuated};
|
||||
|
||||
@@ -160,13 +158,13 @@ pub fn subxt(args: TokenStream, input: TokenStream) -> TokenStream {
|
||||
.map_or_else(|err| err.into_compile_error().into(), Into::into)
|
||||
}
|
||||
(None, Some(url_string)) => {
|
||||
let url = Uri::from_str(&url_string).unwrap_or_else(|_| {
|
||||
let url = Url::parse(&url_string).unwrap_or_else(|_| {
|
||||
abort_call_site!("Cannot download metadata; invalid url: {}", url_string)
|
||||
});
|
||||
|
||||
runtime_api_generator
|
||||
.unstable_metadata(unstable_metadata)
|
||||
.generate_from_url(&url)
|
||||
.generate_from_url(url)
|
||||
.map_or_else(|err| err.into_compile_error().into(), Into::into)
|
||||
}
|
||||
(None, None) => {
|
||||
|
||||
Reference in New Issue
Block a user