mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 01:01:04 +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:
+2
-2
@@ -42,7 +42,7 @@ jsonrpsee = [
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
subxt-rpcs = { workspace = true }
|
||||
pezkuwi-subxt-rpcs = { workspace = true }
|
||||
frame-decode = { workspace = true, features = ["legacy", "legacy-types"] }
|
||||
frame-metadata = { workspace = true, features = ["std", "legacy"] }
|
||||
scale-type-resolver = { workspace = true, features = ["scale-info"] }
|
||||
@@ -52,7 +52,7 @@ scale-info = { workspace = true }
|
||||
scale-info-legacy = { workspace = true }
|
||||
scale-decode = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
sp-crypto-hashing = { workspace = true }
|
||||
pezsp-crypto-hashing = { workspace = true }
|
||||
url = { workspace = true }
|
||||
futures = { workspace = true }
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ use codec::{Compact, Decode, Encode};
|
||||
use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed};
|
||||
use scale_info_legacy::TypeRegistrySet;
|
||||
use std::sync::Arc;
|
||||
use subxt_rpcs::methods::chain_head::ArchiveCallResult;
|
||||
use subxt_rpcs::{ChainHeadRpcMethods, RpcClient};
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::ArchiveCallResult;
|
||||
use pezkuwi_subxt_rpcs::{ChainHeadRpcMethods, RpcClient};
|
||||
|
||||
#[cfg(feature = "jsonrpsee")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "jsonrpsee")))]
|
||||
@@ -51,7 +51,7 @@ impl<T: Config> OnlineClient<T> {
|
||||
})?;
|
||||
if !Self::is_url_secure(&url) {
|
||||
return Err(OnlineClientError::RpcClientError(
|
||||
subxt_rpcs::Error::InsecureUrl(url_str.to_string()),
|
||||
pezkuwi_subxt_rpcs::Error::InsecureUrl(url_str.to_string()),
|
||||
));
|
||||
}
|
||||
OnlineClient::from_insecure_url(config, url).await
|
||||
@@ -206,7 +206,7 @@ async fn get_spec_version<T: Config>(
|
||||
block_hash: <T as Config>::Hash,
|
||||
) -> Result<u32, OnlineClientAtBlockError> {
|
||||
use codec::Decode;
|
||||
use subxt_rpcs::methods::chain_head::ArchiveCallResult;
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::ArchiveCallResult;
|
||||
|
||||
// make a runtime call to get the version information. This is also a constant
|
||||
// in the metadata and so we could fetch it from there to avoid the call, but it would be a
|
||||
|
||||
@@ -4,7 +4,7 @@ pub mod substrate;
|
||||
use scale_info_legacy::TypeRegistrySet;
|
||||
use std::fmt::Display;
|
||||
use std::sync::Arc;
|
||||
use subxt_rpcs::RpcConfig;
|
||||
use pezkuwi_subxt_rpcs::RpcConfig;
|
||||
|
||||
pub use polkadot::PolkadotConfig;
|
||||
pub use substrate::SubstrateConfig;
|
||||
|
||||
@@ -81,8 +81,8 @@ impl Config for PolkadotConfig {
|
||||
}
|
||||
}
|
||||
|
||||
impl subxt_rpcs::RpcConfig for PolkadotConfig {
|
||||
type Hash = <SubstrateConfig as subxt_rpcs::RpcConfig>::Hash;
|
||||
type Header = <SubstrateConfig as subxt_rpcs::RpcConfig>::Header;
|
||||
type AccountId = <SubstrateConfig as subxt_rpcs::RpcConfig>::AccountId;
|
||||
impl pezkuwi_subxt_rpcs::RpcConfig for PolkadotConfig {
|
||||
type Hash = <SubstrateConfig as pezkuwi_subxt_rpcs::RpcConfig>::Hash;
|
||||
type Header = <SubstrateConfig as pezkuwi_subxt_rpcs::RpcConfig>::Header;
|
||||
type AccountId = <SubstrateConfig as pezkuwi_subxt_rpcs::RpcConfig>::AccountId;
|
||||
}
|
||||
|
||||
@@ -116,11 +116,11 @@ impl Config for SubstrateConfig {
|
||||
}
|
||||
|
||||
fn hash(s: &[u8]) -> <Self as Config>::Hash {
|
||||
sp_crypto_hashing::blake2_256(s).into()
|
||||
pezsp_crypto_hashing::blake2_256(s).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl subxt_rpcs::RpcConfig for SubstrateConfig {
|
||||
impl pezkuwi_subxt_rpcs::RpcConfig for SubstrateConfig {
|
||||
type Hash = <Self as Config>::Hash;
|
||||
// We don't use these types in any of the RPC methods we call,
|
||||
// so don't bother setting them up:
|
||||
|
||||
@@ -37,7 +37,7 @@ pub enum OnlineClientError {
|
||||
url: String,
|
||||
},
|
||||
#[error("Cannot construct OnlineClient owing to an RPC client error: {0}")]
|
||||
RpcClientError(#[from] subxt_rpcs::Error),
|
||||
RpcClientError(#[from] pezkuwi_subxt_rpcs::Error),
|
||||
}
|
||||
|
||||
/// Errors constructing an offline client at a specific block number.
|
||||
@@ -73,7 +73,7 @@ pub enum OnlineClientAtBlockError {
|
||||
/// Block number we failed to get the hash for.
|
||||
block_number: u64,
|
||||
/// The error we encountered.
|
||||
reason: subxt_rpcs::Error,
|
||||
reason: pezkuwi_subxt_rpcs::Error,
|
||||
},
|
||||
#[error("Cannot construct OnlineClientAtBlock: block number {block_number} not found")]
|
||||
BlockNotFound {
|
||||
@@ -115,7 +115,7 @@ pub enum ExtrinsicsError {
|
||||
#[error("Could not fetch extrinsics: {reason}")]
|
||||
FetchError {
|
||||
/// The error that occurred while fetching the extrinsics.
|
||||
reason: subxt_rpcs::Error,
|
||||
reason: pezkuwi_subxt_rpcs::Error,
|
||||
},
|
||||
#[error("Could not decode extrinsic at index {index}: {reason}")]
|
||||
DecodeError {
|
||||
@@ -235,7 +235,7 @@ pub enum StorageError {
|
||||
#[error("RPC error interacting with storage APIs: {reason}")]
|
||||
RpcError {
|
||||
/// The error that occurred while fetching the storage entry.
|
||||
reason: subxt_rpcs::Error,
|
||||
reason: pezkuwi_subxt_rpcs::Error,
|
||||
},
|
||||
#[error("Could not fetch next entry from storage subscription: {reason}")]
|
||||
StorageEventError {
|
||||
|
||||
@@ -215,7 +215,7 @@ where
|
||||
StorageError,
|
||||
> {
|
||||
use futures::stream::StreamExt;
|
||||
use subxt_rpcs::methods::chain_head::{
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::{
|
||||
ArchiveStorageEvent, StorageQuery, StorageQueryType,
|
||||
};
|
||||
|
||||
@@ -297,7 +297,7 @@ where
|
||||
T: Config + 'atblock,
|
||||
Client: OnlineClientAtBlockT<'atblock, T>,
|
||||
{
|
||||
use subxt_rpcs::methods::chain_head::{ArchiveStorageEvent, StorageQuery, StorageQueryType};
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::{ArchiveStorageEvent, StorageQuery, StorageQueryType};
|
||||
|
||||
let query = StorageQuery {
|
||||
key: key_bytes,
|
||||
|
||||
Reference in New Issue
Block a user