mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Rebrand subxt to pezkuwi-subxt with pezsp_runtime support
- Renamed all crate names from subxt-* to pezkuwi-subxt-* - Updated codegen to use pezsp_runtime, pezsp_core, pezframe_support instead of sp_runtime, sp_core, frame_support - Replaced all internal references from subxt_* to pezkuwi_subxt_* - Added local path dependencies to Pezkuwi SDK crates - Updated workspace configuration for edition 2024
This commit is contained in:
+12
-12
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "subxt-macro"
|
||||
name = "pezkuwi-subxt-macro"
|
||||
version.workspace = true
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
@@ -14,9 +14,9 @@ homepage.workspace = true
|
||||
description = "Generate types and helpers for interacting with Substrate runtimes."
|
||||
|
||||
[features]
|
||||
web = ["subxt-codegen/web"]
|
||||
runtime-wasm-path = ["sc-executor", "sc-executor-common", "sp-maybe-compressed-blob", "sp-io", "sp-state-machine"]
|
||||
runtime-metadata-insecure-url = ["subxt-utils-fetchmetadata/url"]
|
||||
web = ["pezkuwi-subxt-codegen/web"]
|
||||
runtime-wasm-path = ["pezsc-executor", "pezsc-executor-common", "pezsp-maybe-compressed-blob", "pezsp-io", "pezsp-state-machine"]
|
||||
runtime-metadata-insecure-url = ["pezkuwi-subxt-utils-fetchmetadata/url"]
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
@@ -27,15 +27,15 @@ darling = { workspace = true }
|
||||
proc-macro-error2 = { workspace = true }
|
||||
syn = { workspace = true }
|
||||
quote = { workspace = true }
|
||||
subxt-codegen = { workspace = true }
|
||||
subxt-metadata = { workspace = true }
|
||||
subxt-utils-fetchmetadata = { workspace = true }
|
||||
pezkuwi-subxt-codegen = { workspace = true }
|
||||
pezkuwi-subxt-metadata = { workspace = true }
|
||||
scale-typegen = { workspace = true }
|
||||
sc-executor = { workspace = true, optional = true }
|
||||
sc-executor-common = { workspace = true, optional = true }
|
||||
sp-maybe-compressed-blob = { workspace = true, optional = true }
|
||||
sp-io = { workspace = true, optional = true }
|
||||
sp-state-machine = { workspace = true, optional = true }
|
||||
pezsc-executor = { workspace = true, optional = true }
|
||||
pezsc-executor-common = { workspace = true, optional = true }
|
||||
pezsp-maybe-compressed-blob = { workspace = true, optional = true }
|
||||
pezsp-io = { workspace = true, optional = true }
|
||||
pezsp-state-machine = { workspace = true, optional = true }
|
||||
pezkuwi-subxt-utils-fetchmetadata = { workspace = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
+6
-6
@@ -13,7 +13,7 @@ use scale_typegen::typegen::{
|
||||
settings::substitutes::path_segments,
|
||||
validation::{registry_contains_type_path, similar_type_paths_in_registry},
|
||||
};
|
||||
use subxt_codegen::{CodegenBuilder, CodegenError, Metadata};
|
||||
use pezkuwi_subxt_codegen::{CodegenBuilder, CodegenError, Metadata};
|
||||
use syn::{parse_macro_input, punctuated::Punctuated};
|
||||
|
||||
#[cfg(feature = "runtime-wasm-path")]
|
||||
@@ -229,7 +229,7 @@ fn resolve_path(path_str: &str) -> std::path::PathBuf {
|
||||
}
|
||||
|
||||
/// Fetches metadata in a blocking manner, from a url or file path.
|
||||
fn fetch_metadata(args: &RuntimeMetadataArgs) -> Result<subxt_codegen::Metadata, TokenStream> {
|
||||
fn fetch_metadata(args: &RuntimeMetadataArgs) -> Result<pezkuwi_subxt_codegen::Metadata, TokenStream> {
|
||||
// Do we want to fetch unstable metadata? This only works if fetching from a URL.
|
||||
let unstable_metadata = args.unstable_metadata.is_present();
|
||||
|
||||
@@ -259,13 +259,13 @@ fn fetch_metadata(args: &RuntimeMetadataArgs) -> Result<subxt_codegen::Metadata,
|
||||
|
||||
let path = resolve_path(rest_of_path);
|
||||
|
||||
subxt_utils_fetchmetadata::from_file_blocking(&path)
|
||||
.and_then(|b| subxt_codegen::Metadata::decode(&mut &*b).map_err(Into::into))
|
||||
pezkuwi_subxt_utils_fetchmetadata::from_file_blocking(&path)
|
||||
.and_then(|b| pezkuwi_subxt_codegen::Metadata::decode(&mut &*b).map_err(Into::into))
|
||||
.map_err(|e| CodegenError::Other(e.to_string()).into_compile_error())?
|
||||
}
|
||||
#[cfg(feature = "runtime-metadata-insecure-url")]
|
||||
(None, Some(url_string)) => {
|
||||
use subxt_utils_fetchmetadata::{MetadataVersion, Url, from_url_blocking};
|
||||
use pezkuwi_subxt_utils_fetchmetadata::{MetadataVersion, Url, from_url_blocking};
|
||||
|
||||
let url = Url::parse(url_string).unwrap_or_else(|_| {
|
||||
abort_call_site!("Cannot download metadata; invalid url: {}", url_string)
|
||||
@@ -278,7 +278,7 @@ fn fetch_metadata(args: &RuntimeMetadataArgs) -> Result<subxt_codegen::Metadata,
|
||||
|
||||
from_url_blocking(url, version, None)
|
||||
.map_err(|e| CodegenError::Other(e.to_string()))
|
||||
.and_then(|b| subxt_codegen::Metadata::decode(&mut &*b).map_err(Into::into))
|
||||
.and_then(|b| pezkuwi_subxt_codegen::Metadata::decode(&mut &*b).map_err(Into::into))
|
||||
.map_err(|e| e.into_compile_error())?
|
||||
}
|
||||
#[cfg(not(feature = "runtime-metadata-insecure-url"))]
|
||||
|
||||
@@ -8,15 +8,15 @@ use codec::{Decode, Encode};
|
||||
use sc_executor::{WasmExecutionMethod, WasmExecutor};
|
||||
use sc_executor_common::runtime_blob::RuntimeBlob;
|
||||
use sp_maybe_compressed_blob::{self, CODE_BLOB_BOMB_LIMIT};
|
||||
use subxt_codegen::{CodegenError, Metadata};
|
||||
use subxt_metadata::SUPPORTED_METADATA_VERSIONS;
|
||||
use pezkuwi_subxt_codegen::{CodegenError, Metadata};
|
||||
use pezkuwi_subxt_metadata::SUPPORTED_METADATA_VERSIONS;
|
||||
|
||||
/// Result type shorthand
|
||||
pub type WasmMetadataResult<A> = Result<A, CodegenError>;
|
||||
|
||||
/// Uses wasm artifact produced by compiling the runtime to generate metadata
|
||||
pub fn from_wasm_file(wasm_file_path: &Path) -> WasmMetadataResult<Metadata> {
|
||||
let wasm_file = subxt_utils_fetchmetadata::from_file_blocking(wasm_file_path)
|
||||
let wasm_file = pezkuwi_subxt_utils_fetchmetadata::from_file_blocking(wasm_file_path)
|
||||
.map_err(|e| CodegenError::Other(e.to_string()))
|
||||
.and_then(maybe_decompress)?;
|
||||
call_and_decode(wasm_file)
|
||||
|
||||
Reference in New Issue
Block a user