mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +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:
+25
-25
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "subxt"
|
||||
name = "pezkuwi-subxt"
|
||||
version.workspace = true
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
@@ -11,8 +11,8 @@ readme = "../README.md"
|
||||
repository.workspace = true
|
||||
documentation.workspace = true
|
||||
homepage.workspace = true
|
||||
description = "Submit extrinsics (transactions) to a substrate node via RPC"
|
||||
keywords = ["parity", "substrate", "blockchain"]
|
||||
description = "Submit extrinsics (transactions) to a Pezkuwi/Bizinikiwi node via RPC"
|
||||
keywords = ["pezkuwi", "bizinikiwi", "blockchain"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -25,19 +25,19 @@ default = ["jsonrpsee", "native"]
|
||||
# Enable this for native (ie non web/wasm builds).
|
||||
# Exactly 1 of "web" and "native" is expected.
|
||||
native = [
|
||||
"subxt-lightclient?/native",
|
||||
"subxt-rpcs/native",
|
||||
"pezkuwi-subxt-lightclient?/native",
|
||||
"pezkuwi-subxt-rpcs/native",
|
||||
"tokio-util",
|
||||
"tokio?/sync",
|
||||
"sp-crypto-hashing/std",
|
||||
"pezsp-crypto-hashing/std",
|
||||
]
|
||||
|
||||
# Enable this for web/wasm builds.
|
||||
# Exactly 1 of "web" and "native" is expected.
|
||||
web = [
|
||||
"subxt-lightclient?/web",
|
||||
"subxt-macro/web",
|
||||
"subxt-rpcs/web",
|
||||
"pezkuwi-subxt-lightclient?/web",
|
||||
"pezkuwi-subxt-macro/web",
|
||||
"pezkuwi-subxt-rpcs/web",
|
||||
"tokio?/sync",
|
||||
]
|
||||
|
||||
@@ -50,13 +50,13 @@ web = [
|
||||
runtime = ["tokio/rt", "wasm-bindgen-futures"]
|
||||
|
||||
# Enable this to use the reconnecting rpc client
|
||||
reconnecting-rpc-client = ["subxt-rpcs/reconnecting-rpc-client"]
|
||||
reconnecting-rpc-client = ["pezkuwi-subxt-rpcs/reconnecting-rpc-client"]
|
||||
|
||||
# Enable this to use jsonrpsee, which enables the jsonrpsee RPC client, and
|
||||
# a couple of util functions which rely on jsonrpsee.
|
||||
jsonrpsee = [
|
||||
"dep:jsonrpsee",
|
||||
"subxt-rpcs/jsonrpsee",
|
||||
"pezkuwi-subxt-rpcs/jsonrpsee",
|
||||
"runtime"
|
||||
]
|
||||
|
||||
@@ -68,10 +68,10 @@ unstable-metadata = []
|
||||
|
||||
# Activate this to expose the Light Client functionality.
|
||||
# Note that this feature is experimental and things may break or not work as expected.
|
||||
unstable-light-client = ["subxt-lightclient", "subxt-rpcs/unstable-light-client"]
|
||||
unstable-light-client = ["pezkuwi-subxt-lightclient", "pezkuwi-subxt-rpcs/unstable-light-client"]
|
||||
|
||||
# Activate this to expose the ability to generate metadata from Wasm runtime files.
|
||||
runtime-wasm-path = ["subxt-macro/runtime-wasm-path"]
|
||||
runtime-wasm-path = ["pezkuwi-subxt-macro/runtime-wasm-path"]
|
||||
|
||||
[dependencies]
|
||||
async-trait = { workspace = true }
|
||||
@@ -86,7 +86,7 @@ futures = { workspace = true }
|
||||
hex = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json = { workspace = true, features = ["default", "raw_value"] }
|
||||
sp-crypto-hashing = { workspace = true }
|
||||
pezsp-crypto-hashing = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
frame-metadata = { workspace = true }
|
||||
@@ -99,12 +99,12 @@ primitive-types = { workspace = true, features = ["codec", "scale-info", "serde"
|
||||
# Included if the "jsonrpsee" feature is enabled.
|
||||
jsonrpsee = { workspace = true, optional = true, features = ["jsonrpsee-types"] }
|
||||
|
||||
# Other subxt crates we depend on.
|
||||
subxt-macro = { workspace = true }
|
||||
subxt-core = { workspace = true, features = ["std"] }
|
||||
subxt-metadata = { workspace = true, features = ["std"] }
|
||||
subxt-lightclient = { workspace = true, optional = true, default-features = false }
|
||||
subxt-rpcs = { workspace = true, features = ["subxt"] }
|
||||
# Other pezkuwi-subxt crates we depend on.
|
||||
pezkuwi-subxt-macro = { workspace = true }
|
||||
pezkuwi-subxt-core = { workspace = true, features = ["std"] }
|
||||
pezkuwi-subxt-metadata = { workspace = true, features = ["std"] }
|
||||
pezkuwi-subxt-lightclient = { workspace = true, optional = true, default-features = false }
|
||||
pezkuwi-subxt-rpcs = { workspace = true, features = ["subxt"] }
|
||||
|
||||
# For parsing urls to disallow insecure schemes
|
||||
url = { workspace = true }
|
||||
@@ -123,12 +123,12 @@ bitvec = { workspace = true }
|
||||
codec = { workspace = true, features = ["derive", "bit-vec"] }
|
||||
scale-info = { workspace = true, features = ["bit-vec"] }
|
||||
tokio = { workspace = true, features = ["macros", "time", "rt-multi-thread", "sync"] }
|
||||
sp-core = { workspace = true, features = ["std"] }
|
||||
sp-keyring = { workspace = true, features = ["std"] }
|
||||
sp-runtime = { workspace = true, features = ["std"] }
|
||||
pezsp-core = { workspace = true, features = ["std"] }
|
||||
pezsp-keyring = { workspace = true, features = ["std"] }
|
||||
pezsp-runtime = { workspace = true, features = ["std"] }
|
||||
assert_matches = { workspace = true }
|
||||
subxt-signer = { path = "../signer", features = ["unstable-eth"] }
|
||||
subxt-rpcs = { workspace = true, features = ["subxt", "mock-rpc-client"] }
|
||||
pezkuwi-subxt-signer = { path = "../signer", features = ["unstable-eth"] }
|
||||
pezkuwi-subxt-rpcs = { workspace = true, features = ["subxt", "mock-rpc-client"] }
|
||||
# Tracing subscriber is useful for light-client examples to ensure that
|
||||
# the `bootNodes` and chain spec are configured correctly. If all is fine, then
|
||||
# the light-client will emit INFO logs with
|
||||
|
||||
@@ -5,7 +5,7 @@ use subxt::{
|
||||
client::OnlineClient,
|
||||
lightclient::{ChainConfig, LightClient},
|
||||
};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
use subxt::backend::{legacy::LegacyRpcMethods, rpc::RpcClient};
|
||||
use subxt::config::DefaultExtrinsicParamsBuilder as Params;
|
||||
use subxt::{OnlineClient, PolkadotConfig};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||
pub mod polkadot {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#![allow(missing_docs)]
|
||||
use subxt::utils::AccountId32;
|
||||
use subxt::{OnlineClient, config::PolkadotConfig};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use subxt::{OnlineClient, config::PolkadotConfig};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||
pub mod polkadot {}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
use subxt::config::{
|
||||
Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder, PolkadotConfig, SubstrateConfig,
|
||||
};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[subxt::subxt(
|
||||
runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale",
|
||||
|
||||
@@ -5,7 +5,7 @@ use subxt::config::{
|
||||
Config, ExtrinsicParams, ExtrinsicParamsEncoder, ExtrinsicParamsError, HashFor,
|
||||
transaction_extensions::Params,
|
||||
};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")]
|
||||
pub mod runtime {}
|
||||
|
||||
@@ -8,7 +8,7 @@ use subxt::config::{
|
||||
Config, DefaultExtrinsicParamsBuilder, ExtrinsicParams, ExtrinsicParamsEncoder,
|
||||
ExtrinsicParamsError,
|
||||
};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||
pub mod runtime {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use subxt::{OnlineClient, PolkadotConfig};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
use subxt::dynamic::{At, Value};
|
||||
use subxt::utils::AccountId32;
|
||||
use subxt::{OnlineClient, PolkadotConfig};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use subxt::{OnlineClient, PolkadotConfig};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use subxt::OnlineClient;
|
||||
use subxt_core::utils::AccountId20;
|
||||
use subxt_signer::eth::{Signature, dev};
|
||||
use pezkuwi_subxt_core::utils::AccountId20;
|
||||
use pezkuwi_subxt_signer::eth::{Signature, dev};
|
||||
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/frontier_metadata_small.scale")]
|
||||
mod eth_runtime {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use subxt::{OnlineClient, PolkadotConfig};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||
pub mod polkadot {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use subxt::{OnlineClient, PolkadotConfig};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
type BoxedError = Box<dyn std::error::Error + Send + Sync + 'static>;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use subxt::{OnlineClient, PolkadotConfig, tx::TxStatus};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#![allow(missing_docs)]
|
||||
use subxt::config::polkadot::PolkadotExtrinsicParamsBuilder as Params;
|
||||
use subxt::{OnlineClient, PolkadotConfig};
|
||||
use subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||
pub mod polkadot {}
|
||||
|
||||
@@ -8,7 +8,7 @@ use futures::{FutureExt, Stream, StreamExt, TryStreamExt};
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
use subxt_rpcs::methods::chain_head::{ChainHeadRpcMethods, FollowEvent};
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::{ChainHeadRpcMethods, FollowEvent};
|
||||
|
||||
/// A `Stream` whose goal is to remain subscribed to `chainHead_follow`. It will re-subscribe if the subscription
|
||||
/// is ended for any reason, and it will return the current `subscription_id` as an event, along with the other
|
||||
@@ -224,7 +224,7 @@ pub(super) mod test_utils {
|
||||
use crate::config::substrate::H256;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use subxt_rpcs::methods::chain_head::{BestBlockChanged, Finalized, Initialized, NewBlock};
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::{BestBlockChanged, Finalized, Initialized, NewBlock};
|
||||
|
||||
/// Given some events, returns a follow stream getter that we can use in
|
||||
/// place of the usual RPC method.
|
||||
|
||||
@@ -11,7 +11,7 @@ use std::ops::DerefMut;
|
||||
use std::pin::Pin;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::task::{Context, Poll, Waker};
|
||||
use subxt_rpcs::methods::chain_head::{FollowEvent, Initialized, RuntimeEvent};
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::{FollowEvent, Initialized, RuntimeEvent};
|
||||
|
||||
/// A `Stream` which builds on `FollowStreamDriver`, and allows multiple subscribers to obtain events
|
||||
/// from the single underlying subscription (each being provided an `Initialized` message and all new
|
||||
@@ -455,7 +455,7 @@ where
|
||||
.position(|b| b.hash() == p.hash())
|
||||
else {
|
||||
return Poll::Ready(Some(Err(RpcError::ClientError(
|
||||
subxt_rpcs::Error::DisconnectedWillReconnect(
|
||||
pezkuwi_subxt_rpcs::Error::DisconnectedWillReconnect(
|
||||
"Missed at least one block when the connection was lost"
|
||||
.to_owned(),
|
||||
),
|
||||
@@ -742,7 +742,7 @@ mod test {
|
||||
)
|
||||
);
|
||||
assert!(
|
||||
matches!(&evs[1], Err(BackendError::Rpc(RpcError::ClientError(subxt_rpcs::Error::DisconnectedWillReconnect(e)))) if e.contains("Missed at least one block when the connection was lost"))
|
||||
matches!(&evs[1], Err(BackendError::Rpc(RpcError::ClientError(pezkuwi_subxt_rpcs::Error::DisconnectedWillReconnect(e)))) if e.contains("Missed at least one block when the connection was lost"))
|
||||
);
|
||||
assert_eq!(
|
||||
evs[2].as_ref().unwrap(),
|
||||
|
||||
@@ -7,7 +7,7 @@ use super::follow_stream::FollowStream;
|
||||
use crate::config::{Config, Hash, HashFor};
|
||||
use crate::error::BackendError;
|
||||
use futures::stream::{FuturesUnordered, Stream, StreamExt};
|
||||
use subxt_rpcs::methods::chain_head::{
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::{
|
||||
BestBlockChanged, Finalized, FollowEvent, Initialized, NewBlock,
|
||||
};
|
||||
|
||||
|
||||
@@ -30,18 +30,18 @@ use futures::{Stream, StreamExt};
|
||||
use std::collections::HashMap;
|
||||
use std::task::Poll;
|
||||
use storage_items::StorageItems;
|
||||
use subxt_rpcs::RpcClient;
|
||||
use subxt_rpcs::methods::chain_head::{
|
||||
use pezkuwi_subxt_rpcs::RpcClient;
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::{
|
||||
FollowEvent, MethodResponse, RuntimeEvent, StorageQuery, StorageQueryType, StorageResultType,
|
||||
};
|
||||
|
||||
/// Re-export RPC types and methods from [`subxt_rpcs::methods::chain_head`].
|
||||
/// Re-export RPC types and methods from [`pezkuwi_subxt_rpcs::methods::chain_head`].
|
||||
pub mod rpc_methods {
|
||||
pub use subxt_rpcs::methods::legacy::*;
|
||||
pub use pezkuwi_subxt_rpcs::methods::legacy::*;
|
||||
}
|
||||
|
||||
// Expose the RPC methods.
|
||||
pub use subxt_rpcs::methods::chain_head::ChainHeadRpcMethods;
|
||||
pub use pezkuwi_subxt_rpcs::methods::chain_head::ChainHeadRpcMethods;
|
||||
|
||||
/// Configure and build an [`ChainHeadBackend`].
|
||||
pub struct ChainHeadBackendBuilder<T> {
|
||||
@@ -603,7 +603,7 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for ChainHeadBackend<T> {
|
||||
.await?
|
||||
.map(|ev| {
|
||||
ev.map(|tx_status| {
|
||||
use subxt_rpcs::methods::chain_head::TransactionStatus as RpcTransactionStatus;
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::TransactionStatus as RpcTransactionStatus;
|
||||
match tx_status {
|
||||
RpcTransactionStatus::Validated => TransactionStatus::Validated,
|
||||
RpcTransactionStatus::Broadcasted => TransactionStatus::Broadcasted,
|
||||
@@ -770,7 +770,7 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for ChainHeadBackend<T> {
|
||||
};
|
||||
|
||||
// When we get one, map it to the correct format (or for finalized ev, wait for the pinned block):
|
||||
use subxt_rpcs::methods::chain_head::TransactionStatus as RpcTransactionStatus;
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::TransactionStatus as RpcTransactionStatus;
|
||||
let tx_progress_ev = match tx_progress_ev {
|
||||
RpcTransactionStatus::Finalized { block } => {
|
||||
// We'll wait until we have seen this hash, to try to guarantee
|
||||
|
||||
@@ -12,7 +12,7 @@ use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
use std::task::{Context, Poll};
|
||||
use subxt_rpcs::methods::chain_head::{
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::{
|
||||
ChainHeadRpcMethods, FollowEvent, MethodResponse, StorageQuery, StorageResult,
|
||||
};
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@ use futures::{Future, FutureExt, Stream, StreamExt, future, future::Either, stre
|
||||
use std::collections::VecDeque;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
use subxt_rpcs::RpcClient;
|
||||
use pezkuwi_subxt_rpcs::RpcClient;
|
||||
|
||||
/// Re-export legacy RPC types and methods from [`subxt_rpcs::methods::legacy`].
|
||||
/// Re-export legacy RPC types and methods from [`pezkuwi_subxt_rpcs::methods::legacy`].
|
||||
pub mod rpc_methods {
|
||||
pub use subxt_rpcs::methods::legacy::*;
|
||||
pub use pezkuwi_subxt_rpcs::methods::legacy::*;
|
||||
}
|
||||
|
||||
// Expose the RPC methods.
|
||||
|
||||
+15
-15
@@ -17,13 +17,13 @@ use codec::{Decode, Encode};
|
||||
use futures::{Stream, StreamExt};
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
use subxt_core::client::RuntimeVersion;
|
||||
use subxt_metadata::Metadata;
|
||||
use pezkuwi_subxt_core::client::RuntimeVersion;
|
||||
use pezkuwi_subxt_metadata::Metadata;
|
||||
|
||||
/// Some re-exports from the [`subxt_rpcs`] crate, also accessible in full via [`crate::ext::subxt_rpcs`].
|
||||
/// Some re-exports from the [`pezkuwi_subxt_rpcs`] crate, also accessible in full via [`crate::ext::pezkuwi_subxt_rpcs`].
|
||||
pub mod rpc {
|
||||
pub use subxt_rpcs::client::{RawRpcFuture, RawRpcSubscription, RawValue, RpcParams};
|
||||
pub use subxt_rpcs::{RpcClient, RpcClientT, rpc_params};
|
||||
pub use pezkuwi_subxt_rpcs::client::{RawRpcFuture, RawRpcSubscription, RawValue, RpcParams};
|
||||
pub use pezkuwi_subxt_rpcs::{RpcClient, RpcClientT, rpc_params};
|
||||
|
||||
crate::macros::cfg_reconnecting_rpc_client! {
|
||||
/// An RPC client that automatically reconnects.
|
||||
@@ -63,7 +63,7 @@ pub mod rpc {
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
pub use subxt_rpcs::client::reconnecting_rpc_client;
|
||||
pub use pezkuwi_subxt_rpcs::client::reconnecting_rpc_client;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,8 +395,8 @@ mod test {
|
||||
use primitive_types::H256;
|
||||
use rpc::RpcClientT;
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use subxt_core::{Config, config::DefaultExtrinsicParams};
|
||||
use subxt_rpcs::client::{
|
||||
use pezkuwi_subxt_core::{Config, config::DefaultExtrinsicParams};
|
||||
use pezkuwi_subxt_rpcs::client::{
|
||||
MockRpcClient,
|
||||
mock_rpc_client::{Json, MockRpcClientBuilder},
|
||||
};
|
||||
@@ -405,8 +405,8 @@ mod test {
|
||||
H256::random()
|
||||
}
|
||||
|
||||
fn disconnected_will_reconnect() -> subxt_rpcs::Error {
|
||||
subxt_rpcs::Error::DisconnectedWillReconnect("..".into())
|
||||
fn disconnected_will_reconnect() -> pezkuwi_subxt_rpcs::Error {
|
||||
pezkuwi_subxt_rpcs::Error::DisconnectedWillReconnect("..".into())
|
||||
}
|
||||
|
||||
fn storage_response<K: Into<Vec<u8>>, V: Into<Vec<u8>>>(key: K, value: V) -> StorageResponse
|
||||
@@ -614,7 +614,7 @@ mod test {
|
||||
vec![
|
||||
Ok(Json(runtime_version(4))),
|
||||
Ok(Json(runtime_version(5))),
|
||||
Err(subxt_rpcs::Error::Client("..".into())),
|
||||
Err(pezkuwi_subxt_rpcs::Error::Client("..".into())),
|
||||
],
|
||||
]);
|
||||
|
||||
@@ -644,7 +644,7 @@ mod test {
|
||||
assert!(matches!(
|
||||
results.next().await.unwrap(),
|
||||
Err(BackendError::Rpc(RpcError::ClientError(
|
||||
subxt_rpcs::Error::Client(_)
|
||||
pezkuwi_subxt_rpcs::Error::Client(_)
|
||||
)))
|
||||
));
|
||||
assert!(results.next().await.is_none());
|
||||
@@ -652,7 +652,7 @@ mod test {
|
||||
}
|
||||
|
||||
mod unstable_backend {
|
||||
use subxt_rpcs::methods::chain_head::{
|
||||
use pezkuwi_subxt_rpcs::methods::chain_head::{
|
||||
self, Bytes, Initialized, MethodResponse, MethodResponseStarted, OperationError,
|
||||
OperationId, OperationStorageItems, RuntimeSpec, RuntimeVersionEvent,
|
||||
};
|
||||
@@ -718,8 +718,8 @@ mod test {
|
||||
I: IntoIterator<Item = usize> + Send,
|
||||
I::IntoIter: Send + Sync + 'static,
|
||||
{
|
||||
use subxt_rpcs::client::mock_rpc_client::AndThen;
|
||||
use subxt_rpcs::{Error, UserError};
|
||||
use pezkuwi_subxt_rpcs::client::mock_rpc_client::AndThen;
|
||||
use pezkuwi_subxt_rpcs::{Error, UserError};
|
||||
|
||||
let recv = Arc::new(tokio::sync::Mutex::new(recv));
|
||||
let mut ids = ids.into_iter();
|
||||
|
||||
@@ -189,7 +189,7 @@ mod tests {
|
||||
use crate::backend::StreamOf;
|
||||
|
||||
fn disconnect_err() -> BackendError {
|
||||
BackendError::Rpc(subxt_rpcs::Error::DisconnectedWillReconnect(String::new()).into())
|
||||
BackendError::Rpc(pezkuwi_subxt_rpcs::Error::DisconnectedWillReconnect(String::new()).into())
|
||||
}
|
||||
|
||||
fn custom_err() -> BackendError {
|
||||
|
||||
@@ -11,10 +11,10 @@ use crate::{
|
||||
};
|
||||
use derive_where::derive_where;
|
||||
use scale_decode::{DecodeAsFields, DecodeAsType};
|
||||
use subxt_core::blocks::{ExtrinsicDetails as CoreExtrinsicDetails, Extrinsics as CoreExtrinsics};
|
||||
use pezkuwi_subxt_core::blocks::{ExtrinsicDetails as CoreExtrinsicDetails, Extrinsics as CoreExtrinsics};
|
||||
|
||||
// Re-export anything that's directly returned/used in the APIs below.
|
||||
pub use subxt_core::blocks::{
|
||||
pub use pezkuwi_subxt_core::blocks::{
|
||||
ExtrinsicTransactionExtension, ExtrinsicTransactionExtensions, StaticExtrinsic,
|
||||
};
|
||||
|
||||
@@ -46,12 +46,12 @@ where
|
||||
})
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::Extrinsics::len()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::Extrinsics::len()`].
|
||||
pub fn len(&self) -> usize {
|
||||
self.inner.len()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::Extrinsics::is_empty()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::Extrinsics::is_empty()`].
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.inner.is_empty()
|
||||
}
|
||||
@@ -154,87 +154,87 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::hash()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::hash()`].
|
||||
pub fn hash(&self) -> HashFor<T> {
|
||||
self.inner.hash()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::is_signed()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::is_signed()`].
|
||||
pub fn is_signed(&self) -> bool {
|
||||
self.inner.is_signed()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::index()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::index()`].
|
||||
pub fn index(&self) -> u32 {
|
||||
self.inner.index()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::bytes()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::bytes()`].
|
||||
pub fn bytes(&self) -> &[u8] {
|
||||
self.inner.bytes()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::call_bytes()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::call_bytes()`].
|
||||
pub fn call_bytes(&self) -> &[u8] {
|
||||
self.inner.call_bytes()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::field_bytes()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::field_bytes()`].
|
||||
pub fn field_bytes(&self) -> &[u8] {
|
||||
self.inner.field_bytes()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::address_bytes()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::address_bytes()`].
|
||||
pub fn address_bytes(&self) -> Option<&[u8]> {
|
||||
self.inner.address_bytes()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::signature_bytes()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::signature_bytes()`].
|
||||
pub fn signature_bytes(&self) -> Option<&[u8]> {
|
||||
self.inner.signature_bytes()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::transaction_extensions_bytes()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::transaction_extensions_bytes()`].
|
||||
pub fn transaction_extensions_bytes(&self) -> Option<&[u8]> {
|
||||
self.inner.transaction_extensions_bytes()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::transaction_extensions()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::transaction_extensions()`].
|
||||
pub fn transaction_extensions(&self) -> Option<ExtrinsicTransactionExtensions<'_, T>> {
|
||||
self.inner.transaction_extensions()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::pallet_index()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::pallet_index()`].
|
||||
pub fn pallet_index(&self) -> u8 {
|
||||
self.inner.pallet_index()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::call_index()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::call_index()`].
|
||||
pub fn call_index(&self) -> u8 {
|
||||
self.inner.call_index()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::pallet_name()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::pallet_name()`].
|
||||
pub fn pallet_name(&self) -> &str {
|
||||
self.inner.pallet_name()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::call_name()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::call_name()`].
|
||||
pub fn call_name(&self) -> &str {
|
||||
self.inner.call_name()
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::decode_as_fields()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::decode_as_fields()`].
|
||||
pub fn decode_as_fields<E: DecodeAsFields>(&self) -> Result<E, ExtrinsicError> {
|
||||
self.inner.decode_as_fields().map_err(Into::into)
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::as_extrinsic()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::as_extrinsic()`].
|
||||
pub fn as_extrinsic<E: StaticExtrinsic>(&self) -> Result<Option<E>, ExtrinsicError> {
|
||||
self.inner.as_extrinsic::<E>().map_err(Into::into)
|
||||
}
|
||||
|
||||
/// See [`subxt_core::blocks::ExtrinsicDetails::as_root_extrinsic()`].
|
||||
/// See [`pezkuwi_subxt_core::blocks::ExtrinsicDetails::as_root_extrinsic()`].
|
||||
pub fn as_root_extrinsic<E: DecodeAsType>(&self) -> Result<E, ExtrinsicError> {
|
||||
self.inner.as_root_extrinsic::<E>().map_err(Into::into)
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
//! # RPC calls
|
||||
//!
|
||||
//! The RPC interface is provided by the [`subxt_rpcs`] crate but re-exposed here. We have:
|
||||
//! The RPC interface is provided by the [`pezkuwi_subxt_rpcs`] crate but re-exposed here. We have:
|
||||
//!
|
||||
//! - [`crate::backend::rpc::RpcClient`] and [`crate::backend::rpc::RpcClientT`]: the underlying type and trait
|
||||
//! which provides a basic RPC client.
|
||||
//! - [`crate::backend::legacy::rpc_methods`] and [`crate::backend::chain_head::rpc_methods`]: RPc methods that
|
||||
//! can be instantiated with an RPC client.
|
||||
//!
|
||||
//! See [`subxt_rpcs`] or [`crate::ext::subxt_rpcs`] for more.
|
||||
//! See [`pezkuwi_subxt_rpcs`] or [`crate::ext::pezkuwi_subxt_rpcs`] for more.
|
||||
//!
|
||||
//! # Example
|
||||
//!
|
||||
|
||||
@@ -64,26 +64,26 @@
|
||||
//! Subxt who the extrinsic is from, and takes care of signing the relevant details to prove this.
|
||||
//!
|
||||
//! There are two main ways to create a compatible signer instance:
|
||||
//! 1. The `subxt_signer` crate provides a WASM compatible implementation of [`crate::tx::Signer`]
|
||||
//! 1. The `pezkuwi_subxt_signer` crate provides a WASM compatible implementation of [`crate::tx::Signer`]
|
||||
//! for chains which require sr25519 or ecdsa signatures (requires the `subxt` feature to be enabled).
|
||||
//! 2. Alternately, implement your own [`crate::tx::Signer`] instance by wrapping it in a new type pattern.
|
||||
//!
|
||||
//! Going for 1 leads to fewer dependencies being imported and WASM compatibility out of the box via
|
||||
//! the `web` feature flag. Going for 2 is useful if you're already using the Substrate dependencies or
|
||||
//! need additional signing algorithms that `subxt_signer` doesn't support, and don't care about WASM
|
||||
//! need additional signing algorithms that `pezkuwi_subxt_signer` doesn't support, and don't care about WASM
|
||||
//! compatibility.
|
||||
//!
|
||||
//! Because 2 is more complex and require more code, we'll focus on 1 here.
|
||||
//! For 2, see the example in `subxt/examples/substrate_compat_signer.rs` how
|
||||
//! you can integrate things like sp_core's signer in subxt.
|
||||
//!
|
||||
//! Let's go through how to create a signer using the `subxt_signer` crate:
|
||||
//! Let's go through how to create a signer using the `pezkuwi_subxt_signer` crate:
|
||||
//!
|
||||
//! ```rust,standalone_crate
|
||||
//! use subxt::config::PolkadotConfig;
|
||||
//! use std::str::FromStr;
|
||||
//!
|
||||
//! use subxt_signer::{SecretUri, sr25519};
|
||||
//! use pezkuwi_subxt_signer::{SecretUri, sr25519};
|
||||
//!
|
||||
//! // Get hold of a `Signer` for a test account:
|
||||
//! let alice = sr25519::dev::alice();
|
||||
@@ -128,7 +128,7 @@
|
||||
//! let signature;
|
||||
//! let account_id;
|
||||
//! # use subxt::tx::Signer;
|
||||
//! # let signer = subxt_signer::sr25519::dev::alice();
|
||||
//! # let signer = pezkuwi_subxt_signer::sr25519::dev::alice();
|
||||
//! # signature = signer.sign(&signer_payload).into();
|
||||
//! # account_id = signer.public_key().to_account_id();
|
||||
//!
|
||||
|
||||
@@ -15,4 +15,4 @@ pub use offline_client::{OfflineClient, OfflineClientT};
|
||||
pub use online_client::{
|
||||
ClientRuntimeUpdater, OnlineClient, OnlineClientT, RuntimeUpdaterStream, Update,
|
||||
};
|
||||
pub use subxt_core::client::{ClientState, RuntimeVersion};
|
||||
pub use pezkuwi_subxt_core::client::{ClientState, RuntimeVersion};
|
||||
|
||||
@@ -17,7 +17,7 @@ use crate::{
|
||||
|
||||
use derive_where::derive_where;
|
||||
use std::sync::Arc;
|
||||
use subxt_core::client::{ClientState, RuntimeVersion};
|
||||
use pezkuwi_subxt_core::client::{ClientState, RuntimeVersion};
|
||||
|
||||
/// A trait representing a client that can perform
|
||||
/// offline-only actions.
|
||||
@@ -34,7 +34,7 @@ pub trait OfflineClientT<T: Config>: Clone + Send + Sync + 'static {
|
||||
/// Return the hasher used on the chain.
|
||||
fn hasher(&self) -> T::Hasher;
|
||||
|
||||
/// Return the [subxt_core::client::ClientState] (metadata, runtime version and genesis hash).
|
||||
/// Return the [pezkuwi_subxt_core::client::ClientState] (metadata, runtime version and genesis hash).
|
||||
fn client_state(&self) -> ClientState<T> {
|
||||
ClientState {
|
||||
genesis_hash: self.genesis_hash(),
|
||||
@@ -101,7 +101,7 @@ impl<T: Config> OfflineClient<T> {
|
||||
metadata: impl Into<Metadata>,
|
||||
) -> OfflineClient<T> {
|
||||
let metadata = metadata.into();
|
||||
let hasher = <T::Hasher as subxt_core::config::Hasher>::new(&metadata);
|
||||
let hasher = <T::Hasher as pezkuwi_subxt_core::config::Hasher>::new(&metadata);
|
||||
|
||||
OfflineClient {
|
||||
hasher,
|
||||
|
||||
@@ -21,7 +21,7 @@ use derive_where::derive_where;
|
||||
use futures::TryFutureExt;
|
||||
use futures::future;
|
||||
use std::sync::{Arc, RwLock};
|
||||
use subxt_core::client::{ClientState, RuntimeVersion};
|
||||
use pezkuwi_subxt_core::client::{ClientState, RuntimeVersion};
|
||||
|
||||
/// A trait representing a client that can perform
|
||||
/// online actions.
|
||||
@@ -68,7 +68,7 @@ impl<T: Config> OnlineClient<T> {
|
||||
|
||||
/// Construct a new [`OnlineClient`], providing a URL to connect to.
|
||||
pub async fn from_url(url: impl AsRef<str>) -> Result<OnlineClient<T>, OnlineClientError> {
|
||||
subxt_rpcs::utils::validate_url_is_secure(url.as_ref())?;
|
||||
pezkuwi_subxt_rpcs::utils::validate_url_is_secure(url.as_ref())?;
|
||||
OnlineClient::from_insecure_url(url).await
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ impl<T: Config> OnlineClient<T> {
|
||||
metadata: impl Into<Metadata>,
|
||||
backend: Arc<B>,
|
||||
) -> Result<OnlineClient<T>, OnlineClientError> {
|
||||
use subxt_core::config::Hasher;
|
||||
use pezkuwi_subxt_core::config::Hasher;
|
||||
|
||||
let metadata = metadata.into();
|
||||
let hasher = T::Hasher::new(&metadata);
|
||||
@@ -209,7 +209,7 @@ impl<T: Config> OnlineClient<T> {
|
||||
block_hash: HashFor<T>,
|
||||
) -> Result<Metadata, BackendError> {
|
||||
// The metadata versions we support in Subxt, from newest to oldest.
|
||||
use subxt_metadata::SUPPORTED_METADATA_VERSIONS;
|
||||
use pezkuwi_subxt_metadata::SUPPORTED_METADATA_VERSIONS;
|
||||
|
||||
// Try to fetch each version that we support in order from newest to oldest.
|
||||
for version in SUPPORTED_METADATA_VERSIONS {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
use crate::{Config, client::OfflineClientT, error::ConstantError};
|
||||
use derive_where::derive_where;
|
||||
use subxt_core::constants::address::Address;
|
||||
use pezkuwi_subxt_core::constants::address::Address;
|
||||
|
||||
/// A client for accessing constants.
|
||||
#[derive_where(Clone; Client)]
|
||||
@@ -30,7 +30,7 @@ impl<T: Config, Client: OfflineClientT<T>> ConstantsClient<T, Client> {
|
||||
/// the pallet or constant in question do not exist at all).
|
||||
pub fn validate<Addr: Address>(&self, address: Addr) -> Result<(), ConstantError> {
|
||||
let metadata = self.client.metadata();
|
||||
subxt_core::constants::validate(address, &metadata)
|
||||
pezkuwi_subxt_core::constants::validate(address, &metadata)
|
||||
}
|
||||
|
||||
/// Access the constant at the address given, returning the type defined by this address.
|
||||
@@ -38,12 +38,12 @@ impl<T: Config, Client: OfflineClientT<T>> ConstantsClient<T, Client> {
|
||||
/// construct your own, too.
|
||||
pub fn at<Addr: Address>(&self, address: Addr) -> Result<Addr::Target, ConstantError> {
|
||||
let metadata = self.client.metadata();
|
||||
subxt_core::constants::get(address, &metadata)
|
||||
pezkuwi_subxt_core::constants::get(address, &metadata)
|
||||
}
|
||||
|
||||
/// Access the bytes of a constant by the address it is registered under.
|
||||
pub fn bytes_at<Addr: Address>(&self, address: Addr) -> Result<Vec<u8>, ConstantError> {
|
||||
let metadata = self.client.metadata();
|
||||
subxt_core::constants::get_bytes(address, &metadata)
|
||||
pezkuwi_subxt_core::constants::get_bytes(address, &metadata)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
mod constants_client;
|
||||
|
||||
pub use constants_client::ConstantsClient;
|
||||
pub use subxt_core::constants::address::{Address, DynamicAddress, StaticAddress, dynamic};
|
||||
pub use pezkuwi_subxt_core::constants::address::{Address, DynamicAddress, StaticAddress, dynamic};
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::client::OfflineClientT;
|
||||
use crate::{Config, error::CustomValueError};
|
||||
use derive_where::derive_where;
|
||||
|
||||
use subxt_core::custom_values::address::{Address, Maybe};
|
||||
use pezkuwi_subxt_core::custom_values::address::{Address, Maybe};
|
||||
|
||||
/// A client for accessing custom values stored in the metadata.
|
||||
#[derive_where(Clone; Client)]
|
||||
@@ -28,19 +28,19 @@ impl<T: Config, Client: OfflineClientT<T>> CustomValuesClient<T, Client> {
|
||||
&self,
|
||||
address: Addr,
|
||||
) -> Result<Addr::Target, CustomValueError> {
|
||||
subxt_core::custom_values::get(address, &self.client.metadata())
|
||||
pezkuwi_subxt_core::custom_values::get(address, &self.client.metadata())
|
||||
}
|
||||
|
||||
/// Access the bytes of a custom value by the address it is registered under.
|
||||
pub fn bytes_at<Addr: Address>(&self, address: Addr) -> Result<Vec<u8>, CustomValueError> {
|
||||
subxt_core::custom_values::get_bytes(address, &self.client.metadata())
|
||||
pezkuwi_subxt_core::custom_values::get_bytes(address, &self.client.metadata())
|
||||
}
|
||||
|
||||
/// Run the validation logic against some custom value address you'd like to access. Returns `Ok(())`
|
||||
/// if the address is valid (or if it's not possible to check since the address has no validation hash).
|
||||
/// Returns an error if the address was not valid (wrong name, type or raw bytes)
|
||||
pub fn validate<Addr: Address>(&self, address: Addr) -> Result<(), CustomValueError> {
|
||||
subxt_core::custom_values::validate(address, &self.client.metadata())
|
||||
pezkuwi_subxt_core::custom_values::validate(address, &self.client.metadata())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ mod tests {
|
||||
use scale_info::TypeInfo;
|
||||
use scale_info::form::PortableForm;
|
||||
use std::collections::BTreeMap;
|
||||
use subxt_core::client::RuntimeVersion;
|
||||
use pezkuwi_subxt_core::client::RuntimeVersion;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Encode, TypeInfo, DecodeAsType)]
|
||||
pub struct Person {
|
||||
@@ -103,7 +103,7 @@ mod tests {
|
||||
},
|
||||
};
|
||||
|
||||
let metadata: subxt_metadata::Metadata = frame_metadata.try_into().unwrap();
|
||||
let metadata: pezkuwi_subxt_metadata::Metadata = frame_metadata.try_into().unwrap();
|
||||
metadata
|
||||
}
|
||||
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
mod custom_values_client;
|
||||
|
||||
pub use custom_values_client::CustomValuesClient;
|
||||
pub use subxt_core::custom_values::address::{Address, DynamicAddress, StaticAddress, dynamic};
|
||||
pub use pezkuwi_subxt_core::custom_values::address::{Address, DynamicAddress, StaticAddress, dynamic};
|
||||
|
||||
@@ -232,7 +232,7 @@ impl ModuleError {
|
||||
/// Details about the module error.
|
||||
pub struct ModuleErrorDetails<'a> {
|
||||
/// The pallet that the error is in
|
||||
pub pallet: subxt_metadata::PalletMetadata<'a>,
|
||||
pub pallet: pezkuwi_subxt_metadata::PalletMetadata<'a>,
|
||||
/// The variant representing the error
|
||||
pub variant: &'a scale_info::Variant<scale_info::form::PortableForm>,
|
||||
}
|
||||
|
||||
+13
-13
@@ -8,7 +8,7 @@ mod dispatch_error;
|
||||
mod hex;
|
||||
|
||||
crate::macros::cfg_unstable_light_client! {
|
||||
pub use subxt_lightclient::LightClientError;
|
||||
pub use pezkuwi_subxt_lightclient::LightClientError;
|
||||
}
|
||||
|
||||
// Re-export dispatch error types:
|
||||
@@ -21,10 +21,10 @@ pub use crate::Metadata;
|
||||
pub use hex::Hex;
|
||||
pub use scale_decode::Error as DecodeError;
|
||||
pub use scale_encode::Error as EncodeError;
|
||||
pub use subxt_metadata::TryFromError as MetadataTryFromError;
|
||||
pub use pezkuwi_subxt_metadata::TryFromError as MetadataTryFromError;
|
||||
|
||||
// Re-export core error types we're just reusing.
|
||||
pub use subxt_core::error::{
|
||||
pub use pezkuwi_subxt_core::error::{
|
||||
ConstantError,
|
||||
CustomValueError,
|
||||
EventsError as CoreEventsError,
|
||||
@@ -95,15 +95,15 @@ pub enum Error {
|
||||
// users use common crates (like parity-scale-codec and subxt-rpcs), errors returned
|
||||
// there can be handled automatically using ? when the expected error is subxt::Error.
|
||||
#[error("Other RPC client error: {0}")]
|
||||
OtherRpcClientError(#[from] subxt_rpcs::Error),
|
||||
OtherRpcClientError(#[from] pezkuwi_subxt_rpcs::Error),
|
||||
#[error("Other codec error: {0}")]
|
||||
OtherCodecError(#[from] codec::Error),
|
||||
#[cfg(feature = "unstable-light-client")]
|
||||
#[error("Other light client error: {0}")]
|
||||
OtherLightClientError(#[from] subxt_lightclient::LightClientError),
|
||||
OtherLightClientError(#[from] pezkuwi_subxt_lightclient::LightClientError),
|
||||
#[cfg(feature = "unstable-light-client")]
|
||||
#[error("Other light client RPC error: {0}")]
|
||||
OtherLightClientRpcError(#[from] subxt_lightclient::LightClientRpcError),
|
||||
OtherLightClientRpcError(#[from] pezkuwi_subxt_lightclient::LightClientRpcError),
|
||||
// Dev note: Nothing in subxt should ever emit this error. It can instead be used
|
||||
// to easily map other errors into a subxt::Error for convenience. Some From impls
|
||||
// make this automatic for common "other" error types.
|
||||
@@ -138,7 +138,7 @@ impl Error {
|
||||
matches!(
|
||||
self.backend_error(),
|
||||
Some(BackendError::Rpc(RpcError::ClientError(
|
||||
subxt_rpcs::Error::DisconnectedWillReconnect(_)
|
||||
pezkuwi_subxt_rpcs::Error::DisconnectedWillReconnect(_)
|
||||
)))
|
||||
)
|
||||
}
|
||||
@@ -194,7 +194,7 @@ impl BackendError {
|
||||
matches!(
|
||||
self,
|
||||
BackendError::Rpc(RpcError::ClientError(
|
||||
subxt_rpcs::Error::DisconnectedWillReconnect(_)
|
||||
pezkuwi_subxt_rpcs::Error::DisconnectedWillReconnect(_)
|
||||
))
|
||||
)
|
||||
}
|
||||
@@ -205,8 +205,8 @@ impl BackendError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<subxt_rpcs::Error> for BackendError {
|
||||
fn from(value: subxt_rpcs::Error) -> Self {
|
||||
impl From<pezkuwi_subxt_rpcs::Error> for BackendError {
|
||||
fn from(value: pezkuwi_subxt_rpcs::Error) -> Self {
|
||||
BackendError::Rpc(RpcError::ClientError(value))
|
||||
}
|
||||
}
|
||||
@@ -218,8 +218,8 @@ impl From<subxt_rpcs::Error> for BackendError {
|
||||
pub enum RpcError {
|
||||
/// Error related to the RPC client.
|
||||
#[error("RPC error: {0}")]
|
||||
ClientError(#[from] subxt_rpcs::Error),
|
||||
/// This error signals that we got back a [`subxt_rpcs::methods::chain_head::MethodResponse::LimitReached`],
|
||||
ClientError(#[from] pezkuwi_subxt_rpcs::Error),
|
||||
/// This error signals that we got back a [`pezkuwi_subxt_rpcs::methods::chain_head::MethodResponse::LimitReached`],
|
||||
/// which is not technically an RPC error but is treated as an error in our own APIs.
|
||||
#[error("RPC error: limit reached")]
|
||||
LimitReached,
|
||||
@@ -297,7 +297,7 @@ impl AccountNonceError {
|
||||
#[allow(missing_docs)]
|
||||
pub enum OnlineClientError {
|
||||
#[error("Cannot construct OnlineClient: {0}")]
|
||||
RpcError(#[from] subxt_rpcs::Error),
|
||||
RpcError(#[from] pezkuwi_subxt_rpcs::Error),
|
||||
#[error(
|
||||
"Cannot construct OnlineClient: Cannot fetch latest finalized block to obtain init details from: {0}"
|
||||
)]
|
||||
|
||||
@@ -82,8 +82,8 @@ where
|
||||
|
||||
// The storage key needed to access events.
|
||||
fn system_events_key() -> [u8; 32] {
|
||||
let a = sp_crypto_hashing::twox_128(b"System");
|
||||
let b = sp_crypto_hashing::twox_128(b"Events");
|
||||
let a = pezsp_crypto_hashing::twox_128(b"System");
|
||||
let b = pezsp_crypto_hashing::twox_128(b"Events");
|
||||
let mut res = [0; 32];
|
||||
res[0..16].clone_from_slice(&a);
|
||||
res[16..32].clone_from_slice(&b);
|
||||
|
||||
@@ -5,15 +5,15 @@ use crate::{
|
||||
};
|
||||
use derive_where::derive_where;
|
||||
use scale_decode::{DecodeAsFields, DecodeAsType};
|
||||
use subxt_core::events::{EventDetails as CoreEventDetails, Events as CoreEvents};
|
||||
use pezkuwi_subxt_core::events::{EventDetails as CoreEventDetails, Events as CoreEvents};
|
||||
|
||||
pub use subxt_core::events::{EventMetadataDetails, Phase, StaticEvent};
|
||||
pub use pezkuwi_subxt_core::events::{EventMetadataDetails, Phase, StaticEvent};
|
||||
|
||||
/// A collection of events obtained from a block, bundled with the necessary
|
||||
/// information needed to decode and iterate over them.
|
||||
// Dev note: we are just wrapping the subxt_core types here to avoid leaking them
|
||||
// Dev note: we are just wrapping the pezkuwi_subxt_core types here to avoid leaking them
|
||||
// in Subxt and map any errors into Subxt errors so that we don't have this part of the
|
||||
// API returning a different error type (ie the subxt_core::Error).
|
||||
// API returning a different error type (ie the pezkuwi_subxt_core::Error).
|
||||
#[derive_where(Clone, Debug)]
|
||||
pub struct Events<T> {
|
||||
inner: CoreEvents<T>,
|
||||
|
||||
@@ -11,7 +11,7 @@ mod events_type;
|
||||
|
||||
use crate::client::OnlineClientT;
|
||||
use crate::error::EventsError;
|
||||
use subxt_core::{
|
||||
use pezkuwi_subxt_core::{
|
||||
Metadata,
|
||||
config::{Config, HashFor},
|
||||
};
|
||||
|
||||
+14
-14
@@ -29,7 +29,7 @@ pub mod book;
|
||||
// only used in example code snippets at the time of writing.
|
||||
#[cfg(test)]
|
||||
mod only_used_in_docs_or_tests {
|
||||
use subxt_signer as _;
|
||||
use pezkuwi_subxt_signer as _;
|
||||
use tokio as _;
|
||||
}
|
||||
|
||||
@@ -57,28 +57,28 @@ pub mod view_functions;
|
||||
/// default Substrate node implementation, and [`PolkadotConfig`] for a
|
||||
/// Polkadot node.
|
||||
pub mod config {
|
||||
pub use subxt_core::config::{
|
||||
pub use pezkuwi_subxt_core::config::{
|
||||
Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder, ExtrinsicParams,
|
||||
ExtrinsicParamsEncoder, Hash, HashFor, Hasher, Header, PolkadotConfig,
|
||||
PolkadotExtrinsicParams, SubstrateConfig, SubstrateExtrinsicParams, TransactionExtension,
|
||||
polkadot, substrate, transaction_extensions,
|
||||
};
|
||||
pub use subxt_core::error::ExtrinsicParamsError;
|
||||
pub use pezkuwi_subxt_core::error::ExtrinsicParamsError;
|
||||
}
|
||||
|
||||
/// Types representing the metadata obtained from a node.
|
||||
pub mod metadata {
|
||||
pub use subxt_metadata::*;
|
||||
pub use pezkuwi_subxt_metadata::*;
|
||||
}
|
||||
|
||||
/// Submit dynamic transactions.
|
||||
pub mod dynamic {
|
||||
pub use subxt_core::dynamic::*;
|
||||
pub use pezkuwi_subxt_core::dynamic::*;
|
||||
}
|
||||
|
||||
// Expose light client bits
|
||||
cfg_unstable_light_client! {
|
||||
pub use subxt_lightclient as lightclient;
|
||||
pub use pezkuwi_subxt_lightclient as lightclient;
|
||||
}
|
||||
|
||||
// Expose a few of the most common types at root,
|
||||
@@ -99,8 +99,8 @@ pub mod ext {
|
||||
pub use scale_decode;
|
||||
pub use scale_encode;
|
||||
pub use scale_value;
|
||||
pub use subxt_core;
|
||||
pub use subxt_rpcs;
|
||||
pub use pezkuwi_subxt_core;
|
||||
pub use pezkuwi_subxt_rpcs;
|
||||
|
||||
cfg_jsonrpsee! {
|
||||
pub use jsonrpsee;
|
||||
@@ -202,15 +202,15 @@ pub mod ext {
|
||||
///
|
||||
/// ## `crate = "..."`
|
||||
///
|
||||
/// Use this attribute to specify a custom path to the `subxt_core` crate:
|
||||
/// Use this attribute to specify a custom path to the `pezkuwi_subxt_core` crate:
|
||||
///
|
||||
/// ```rust,standalone_crate
|
||||
/// # pub extern crate subxt_core;
|
||||
/// # pub mod path { pub mod to { pub use subxt_core; } }
|
||||
/// # pub extern crate pezkuwi_subxt_core;
|
||||
/// # pub mod path { pub mod to { pub use pezkuwi_subxt_core; } }
|
||||
/// # fn main() {}
|
||||
/// #[subxt::subxt(
|
||||
/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale",
|
||||
/// crate = "crate::path::to::subxt_core"
|
||||
/// crate = "crate::path::to::pezkuwi_subxt_core"
|
||||
/// )]
|
||||
/// mod polkadot {}
|
||||
/// ```
|
||||
@@ -266,7 +266,7 @@ pub mod ext {
|
||||
/// runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale",
|
||||
/// substitute_type(
|
||||
/// path = "sp_runtime::multiaddress::MultiAddress<A, B>",
|
||||
/// with = "::subxt::utils::Static<sp_runtime::MultiAddress<A, B>>"
|
||||
/// with = "::pezkuwi_subxt::utils::Static<sp_runtime::MultiAddress<A, B>>"
|
||||
/// )
|
||||
/// )]
|
||||
/// mod polkadot {}
|
||||
@@ -367,4 +367,4 @@ pub mod ext {
|
||||
/// )]
|
||||
/// mod polkadot {}
|
||||
/// ```
|
||||
pub use subxt_macro::subxt;
|
||||
pub use pezkuwi_subxt_macro::subxt;
|
||||
|
||||
@@ -9,4 +9,4 @@ mod runtime_types;
|
||||
|
||||
pub use runtime_client::RuntimeApiClient;
|
||||
pub use runtime_types::RuntimeApi;
|
||||
pub use subxt_core::runtime_api::payload::{DynamicPayload, Payload, StaticPayload, dynamic};
|
||||
pub use pezkuwi_subxt_core::runtime_api::payload::{DynamicPayload, Payload, StaticPayload, dynamic};
|
||||
|
||||
@@ -41,7 +41,7 @@ where
|
||||
/// Return an error if the payload was not valid or something went wrong trying to validate it (ie
|
||||
/// the runtime API in question do not exist at all)
|
||||
pub fn validate<Call: Payload>(&self, payload: Call) -> Result<(), RuntimeApiError> {
|
||||
subxt_core::runtime_api::validate(payload, &self.client.metadata()).map_err(Into::into)
|
||||
pezkuwi_subxt_core::runtime_api::validate(payload, &self.client.metadata()).map_err(Into::into)
|
||||
}
|
||||
|
||||
/// Execute a raw runtime API call. This returns the raw bytes representing the result
|
||||
@@ -79,11 +79,11 @@ where
|
||||
let metadata = client.metadata();
|
||||
|
||||
// Validate the runtime API payload hash against the compile hash from codegen.
|
||||
subxt_core::runtime_api::validate(&payload, &metadata)?;
|
||||
pezkuwi_subxt_core::runtime_api::validate(&payload, &metadata)?;
|
||||
|
||||
// Encode the arguments of the runtime call.
|
||||
let call_name = subxt_core::runtime_api::call_name(&payload);
|
||||
let call_args = subxt_core::runtime_api::call_args(&payload, &metadata)?;
|
||||
let call_name = pezkuwi_subxt_core::runtime_api::call_name(&payload);
|
||||
let call_args = pezkuwi_subxt_core::runtime_api::call_args(&payload, &metadata)?;
|
||||
|
||||
// Make the call.
|
||||
let bytes = client
|
||||
@@ -93,7 +93,7 @@ where
|
||||
.map_err(RuntimeApiError::CannotCallApi)?;
|
||||
|
||||
// Decode the response.
|
||||
let value = subxt_core::runtime_api::decode_value(&mut &*bytes, &payload, &metadata)?;
|
||||
let value = pezkuwi_subxt_core::runtime_api::decode_value(&mut &*bytes, &payload, &metadata)?;
|
||||
Ok(value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ mod storage_client_at;
|
||||
|
||||
pub use storage_client::StorageClient;
|
||||
pub use storage_client_at::{StorageClientAt, StorageEntryClient, StorageKeyValue, StorageValue};
|
||||
pub use subxt_core::storage::address::{Address, DynamicAddress, StaticAddress, dynamic};
|
||||
pub use pezkuwi_subxt_core::storage::address::{Address, DynamicAddress, StaticAddress, dynamic};
|
||||
|
||||
@@ -11,7 +11,7 @@ use crate::{
|
||||
};
|
||||
use derive_where::derive_where;
|
||||
use std::{future::Future, marker::PhantomData};
|
||||
use subxt_core::storage::address::Address;
|
||||
use pezkuwi_subxt_core::storage::address::Address;
|
||||
|
||||
/// Query the runtime storage.
|
||||
#[derive_where(Clone; Client)]
|
||||
@@ -40,7 +40,7 @@ where
|
||||
/// Return an error if the address was not valid or something went wrong trying to validate it (ie
|
||||
/// the pallet or storage entry in question do not exist at all).
|
||||
pub fn validate<Addr: Address>(&self, address: &Addr) -> Result<(), StorageError> {
|
||||
subxt_core::storage::validate(address, &self.client.metadata()).map_err(Into::into)
|
||||
pezkuwi_subxt_core::storage::validate(address, &self.client.metadata()).map_err(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@ use crate::{
|
||||
use derive_where::derive_where;
|
||||
use futures::StreamExt;
|
||||
use std::marker::PhantomData;
|
||||
use subxt_core::Metadata;
|
||||
use subxt_core::storage::{PrefixOf, address::Address};
|
||||
use subxt_core::utils::{Maybe, Yes};
|
||||
use pezkuwi_subxt_core::Metadata;
|
||||
use pezkuwi_subxt_core::storage::{PrefixOf, address::Address};
|
||||
use pezkuwi_subxt_core::utils::{Maybe, Yes};
|
||||
|
||||
pub use subxt_core::storage::{StorageKeyValue, StorageValue};
|
||||
pub use pezkuwi_subxt_core::storage::{StorageKeyValue, StorageValue};
|
||||
|
||||
/// Query the runtime storage.
|
||||
#[derive_where(Clone; Client)]
|
||||
@@ -57,7 +57,7 @@ where
|
||||
&self,
|
||||
address: Addr,
|
||||
) -> Result<StorageEntryClient<'_, T, Client, Addr, Addr::IsPlain>, StorageError> {
|
||||
let inner = subxt_core::storage::entry(address, &self.metadata)?;
|
||||
let inner = pezkuwi_subxt_core::storage::entry(address, &self.metadata)?;
|
||||
Ok(StorageEntryClient {
|
||||
inner,
|
||||
client: self.client.clone(),
|
||||
@@ -78,7 +78,7 @@ where
|
||||
addr: Addr,
|
||||
key_parts: Addr::KeyParts,
|
||||
) -> Result<StorageValue<'_, Addr::Value>, StorageError> {
|
||||
let entry = subxt_core::storage::entry(addr, &self.metadata)?;
|
||||
let entry = pezkuwi_subxt_core::storage::entry(addr, &self.metadata)?;
|
||||
fetch(&entry, &self.client, self.block_ref.hash(), key_parts).await
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ where
|
||||
addr: Addr,
|
||||
key_parts: Addr::KeyParts,
|
||||
) -> Result<Option<StorageValue<'_, Addr::Value>>, StorageError> {
|
||||
let entry = subxt_core::storage::entry(addr, &self.metadata)?;
|
||||
let entry = pezkuwi_subxt_core::storage::entry(addr, &self.metadata)?;
|
||||
try_fetch(&entry, &self.client, self.block_ref.hash(), key_parts).await
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ where
|
||||
+ use<'_, Addr, Client, T, KeyParts>,
|
||||
StorageError,
|
||||
> {
|
||||
let entry = subxt_core::storage::entry(addr, &self.metadata)?;
|
||||
let entry = pezkuwi_subxt_core::storage::entry(addr, &self.metadata)?;
|
||||
iter(entry, &self.client, self.block_ref.hash(), key_parts).await
|
||||
}
|
||||
|
||||
@@ -130,10 +130,10 @@ where
|
||||
// construct the storage key. This is done similarly in
|
||||
// `frame_support::traits::metadata::StorageVersion::storage_key()`:
|
||||
let mut key_bytes: Vec<u8> = vec![];
|
||||
key_bytes.extend(&sp_crypto_hashing::twox_128(
|
||||
key_bytes.extend(&pezsp_crypto_hashing::twox_128(
|
||||
pallet_name.as_ref().as_bytes(),
|
||||
));
|
||||
key_bytes.extend(&sp_crypto_hashing::twox_128(b":__STORAGE_VERSION__:"));
|
||||
key_bytes.extend(&pezsp_crypto_hashing::twox_128(b":__STORAGE_VERSION__:"));
|
||||
|
||||
// fetch the raw bytes and decode them into the StorageVersion struct:
|
||||
let storage_version_bytes = self.fetch_raw(key_bytes).await?;
|
||||
@@ -152,7 +152,7 @@ where
|
||||
/// This represents a single storage entry (be it a plain value or map)
|
||||
/// and the operations that can be performed on it.
|
||||
pub struct StorageEntryClient<'atblock, T: Config, Client, Addr, IsPlain> {
|
||||
inner: subxt_core::storage::StorageEntry<'atblock, Addr>,
|
||||
inner: pezkuwi_subxt_core::storage::StorageEntry<'atblock, Addr>,
|
||||
client: Client,
|
||||
block_ref: BlockRef<HashFor<T>>,
|
||||
_marker: PhantomData<(T, IsPlain)>,
|
||||
@@ -316,7 +316,7 @@ where
|
||||
}
|
||||
|
||||
async fn fetch<'atblock, T: Config, Client: OnlineClientT<T>, Addr: Address>(
|
||||
entry: &subxt_core::storage::StorageEntry<'atblock, Addr>,
|
||||
entry: &pezkuwi_subxt_core::storage::StorageEntry<'atblock, Addr>,
|
||||
client: &Client,
|
||||
block_hash: HashFor<T>,
|
||||
key_parts: Addr::KeyParts,
|
||||
@@ -330,7 +330,7 @@ async fn fetch<'atblock, T: Config, Client: OnlineClientT<T>, Addr: Address>(
|
||||
}
|
||||
|
||||
async fn try_fetch<'atblock, T: Config, Client: OnlineClientT<T>, Addr: Address>(
|
||||
entry: &subxt_core::storage::StorageEntry<'atblock, Addr>,
|
||||
entry: &pezkuwi_subxt_core::storage::StorageEntry<'atblock, Addr>,
|
||||
client: &Client,
|
||||
block_hash: HashFor<T>,
|
||||
key_parts: Addr::KeyParts,
|
||||
@@ -355,7 +355,7 @@ async fn iter<
|
||||
Addr: Address,
|
||||
KeyParts: PrefixOf<Addr::KeyParts>,
|
||||
>(
|
||||
entry: subxt_core::storage::StorageEntry<'atblock, Addr>,
|
||||
entry: pezkuwi_subxt_core::storage::StorageEntry<'atblock, Addr>,
|
||||
client: &Client,
|
||||
block_hash: HashFor<T>,
|
||||
key_parts: KeyParts,
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@
|
||||
mod tx_client;
|
||||
mod tx_progress;
|
||||
|
||||
pub use subxt_core::tx::payload::{DefaultPayload, DynamicPayload, Payload, dynamic};
|
||||
pub use subxt_core::tx::signer::{self, Signer};
|
||||
pub use pezkuwi_subxt_core::tx::payload::{DefaultPayload, DynamicPayload, Payload, dynamic};
|
||||
pub use pezkuwi_subxt_core::tx::signer::{self, Signer};
|
||||
pub use tx_client::{
|
||||
DefaultParams, PartialTransaction, SubmittableTransaction, TransactionInvalid,
|
||||
TransactionUnknown, TxClient, ValidationResult,
|
||||
|
||||
+19
-19
@@ -13,7 +13,7 @@ use crate::{
|
||||
use codec::{Compact, Decode, Encode};
|
||||
use derive_where::derive_where;
|
||||
use futures::future::{TryFutureExt, try_join};
|
||||
use subxt_core::tx::TransactionVersion;
|
||||
use pezkuwi_subxt_core::tx::TransactionVersion;
|
||||
|
||||
/// A client for working with transactions.
|
||||
#[derive_where(Clone; Client)]
|
||||
@@ -41,7 +41,7 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
|
||||
where
|
||||
Call: Payload,
|
||||
{
|
||||
subxt_core::tx::validate(call, &self.client.metadata()).map_err(Into::into)
|
||||
pezkuwi_subxt_core::tx::validate(call, &self.client.metadata()).map_err(Into::into)
|
||||
}
|
||||
|
||||
/// Return the SCALE encoded bytes representing the call data of the transaction.
|
||||
@@ -49,7 +49,7 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
|
||||
where
|
||||
Call: Payload,
|
||||
{
|
||||
subxt_core::tx::call_data(call, &self.client.metadata()).map_err(Into::into)
|
||||
pezkuwi_subxt_core::tx::call_data(call, &self.client.metadata()).map_err(Into::into)
|
||||
}
|
||||
|
||||
/// Creates an unsigned transaction without submitting it. Depending on the metadata, we might end
|
||||
@@ -63,9 +63,9 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
|
||||
Call: Payload,
|
||||
{
|
||||
let metadata = self.client.metadata();
|
||||
let tx = match subxt_core::tx::suggested_version(&metadata)? {
|
||||
TransactionVersion::V4 => subxt_core::tx::create_v4_unsigned(call, &metadata),
|
||||
TransactionVersion::V5 => subxt_core::tx::create_v5_bare(call, &metadata),
|
||||
let tx = match pezkuwi_subxt_core::tx::suggested_version(&metadata)? {
|
||||
TransactionVersion::V4 => pezkuwi_subxt_core::tx::create_v4_unsigned(call, &metadata),
|
||||
TransactionVersion::V5 => pezkuwi_subxt_core::tx::create_v5_bare(call, &metadata),
|
||||
}?;
|
||||
|
||||
Ok(SubmittableTransaction {
|
||||
@@ -86,7 +86,7 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
|
||||
Call: Payload,
|
||||
{
|
||||
let metadata = self.client.metadata();
|
||||
let tx = subxt_core::tx::create_v4_unsigned(call, &metadata)?;
|
||||
let tx = pezkuwi_subxt_core::tx::create_v4_unsigned(call, &metadata)?;
|
||||
|
||||
Ok(SubmittableTransaction {
|
||||
client: self.client.clone(),
|
||||
@@ -106,7 +106,7 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
|
||||
Call: Payload,
|
||||
{
|
||||
let metadata = self.client.metadata();
|
||||
let tx = subxt_core::tx::create_v5_bare(call, &metadata)?;
|
||||
let tx = pezkuwi_subxt_core::tx::create_v5_bare(call, &metadata)?;
|
||||
|
||||
Ok(SubmittableTransaction {
|
||||
client: self.client.clone(),
|
||||
@@ -115,7 +115,7 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
|
||||
}
|
||||
|
||||
/// Create a partial transaction. Depending on the metadata, we might end up constructing either a v4 or
|
||||
/// v5 transaction. See [`subxt_core::tx`] if you'd like to manually pick the version to construct
|
||||
/// v5 transaction. See [`pezkuwi_subxt_core::tx`] if you'd like to manually pick the version to construct
|
||||
///
|
||||
/// Note: if not provided, the default account nonce will be set to 0 and the default mortality will be _immortal_.
|
||||
/// This is because this method runs offline, and so is unable to fetch the data needed for more appropriate values.
|
||||
@@ -128,12 +128,12 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
|
||||
Call: Payload,
|
||||
{
|
||||
let metadata = self.client.metadata();
|
||||
let tx = match subxt_core::tx::suggested_version(&metadata)? {
|
||||
let tx = match pezkuwi_subxt_core::tx::suggested_version(&metadata)? {
|
||||
TransactionVersion::V4 => PartialTransactionInner::V4(
|
||||
subxt_core::tx::create_v4_signed(call, &self.client.client_state(), params)?,
|
||||
pezkuwi_subxt_core::tx::create_v4_signed(call, &self.client.client_state(), params)?,
|
||||
),
|
||||
TransactionVersion::V5 => PartialTransactionInner::V5(
|
||||
subxt_core::tx::create_v5_general(call, &self.client.client_state(), params)?,
|
||||
pezkuwi_subxt_core::tx::create_v5_general(call, &self.client.client_state(), params)?,
|
||||
),
|
||||
};
|
||||
|
||||
@@ -158,7 +158,7 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
|
||||
where
|
||||
Call: Payload,
|
||||
{
|
||||
let tx = PartialTransactionInner::V4(subxt_core::tx::create_v4_signed(
|
||||
let tx = PartialTransactionInner::V4(pezkuwi_subxt_core::tx::create_v4_signed(
|
||||
call,
|
||||
&self.client.client_state(),
|
||||
params,
|
||||
@@ -185,7 +185,7 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
|
||||
where
|
||||
Call: Payload,
|
||||
{
|
||||
let tx = PartialTransactionInner::V5(subxt_core::tx::create_v5_general(
|
||||
let tx = PartialTransactionInner::V5(pezkuwi_subxt_core::tx::create_v5_general(
|
||||
call,
|
||||
&self.client.client_state(),
|
||||
params,
|
||||
@@ -382,8 +382,8 @@ pub struct PartialTransaction<T: Config, C> {
|
||||
}
|
||||
|
||||
enum PartialTransactionInner<T: Config> {
|
||||
V4(subxt_core::tx::PartialTransactionV4<T>),
|
||||
V5(subxt_core::tx::PartialTransactionV5<T>),
|
||||
V4(pezkuwi_subxt_core::tx::PartialTransactionV4<T>),
|
||||
V5(pezkuwi_subxt_core::tx::PartialTransactionV5<T>),
|
||||
}
|
||||
|
||||
impl<T, C> PartialTransaction<T, C>
|
||||
@@ -455,7 +455,7 @@ where
|
||||
/// This represents an transaction that has been signed and is ready to submit.
|
||||
pub struct SubmittableTransaction<T, C> {
|
||||
client: C,
|
||||
inner: subxt_core::tx::Transaction<T>,
|
||||
inner: pezkuwi_subxt_core::tx::Transaction<T>,
|
||||
}
|
||||
|
||||
impl<T, C> SubmittableTransaction<T, C>
|
||||
@@ -473,7 +473,7 @@ where
|
||||
pub fn from_bytes(client: C, tx_bytes: Vec<u8>) -> Self {
|
||||
Self {
|
||||
client,
|
||||
inner: subxt_core::tx::Transaction::from_bytes(tx_bytes),
|
||||
inner: pezkuwi_subxt_core::tx::Transaction::from_bytes(tx_bytes),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -638,7 +638,7 @@ async fn inject_account_nonce_and_block<T: Config, Client: OnlineClientT<T>>(
|
||||
account_id: &T::AccountId,
|
||||
params: &mut <T::ExtrinsicParams as ExtrinsicParams<T>>::Params,
|
||||
) -> Result<(), ExtrinsicError> {
|
||||
use subxt_core::config::transaction_extensions::Params;
|
||||
use pezkuwi_subxt_core::config::transaction_extensions::Params;
|
||||
|
||||
let block_ref = client
|
||||
.backend()
|
||||
|
||||
@@ -358,7 +358,7 @@ impl<T: Config, C: OnlineClientT<T>> TxInBlock<T, C> {
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use subxt_core::client::RuntimeVersion;
|
||||
use pezkuwi_subxt_core::client::RuntimeVersion;
|
||||
|
||||
use crate::{
|
||||
SubstrateConfig,
|
||||
@@ -393,7 +393,7 @@ mod test {
|
||||
unimplemented!("just a mock impl to satisfy trait bounds")
|
||||
}
|
||||
|
||||
fn client_state(&self) -> subxt_core::client::ClientState<SubstrateConfig> {
|
||||
fn client_state(&self) -> pezkuwi_subxt_core::client::ClientState<SubstrateConfig> {
|
||||
unimplemented!("just a mock impl to satisfy trait bounds")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
|
||||
use crate::macros::cfg_jsonrpsee;
|
||||
|
||||
pub use subxt_core::utils::{
|
||||
pub use pezkuwi_subxt_core::utils::{
|
||||
AccountId32, Encoded, Era, H160, H256, H512, KeyedVec, MultiAddress, MultiSignature,
|
||||
PhantomDataSendSync, Static, UncheckedExtrinsic, WrapperKeepOpaque, Yes, bits,
|
||||
strip_compact_prefix, to_hex,
|
||||
};
|
||||
|
||||
pub use subxt_rpcs::utils::url_is_secure;
|
||||
pub use pezkuwi_subxt_rpcs::utils::url_is_secure;
|
||||
|
||||
cfg_jsonrpsee! {
|
||||
mod fetch_chain_spec;
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
mod view_function_types;
|
||||
mod view_functions_client;
|
||||
|
||||
pub use subxt_core::view_functions::payload::{DynamicPayload, Payload, StaticPayload, dynamic};
|
||||
pub use pezkuwi_subxt_core::view_functions::payload::{DynamicPayload, Payload, StaticPayload, dynamic};
|
||||
pub use view_function_types::ViewFunctionsApi;
|
||||
pub use view_functions_client::ViewFunctionsClient;
|
||||
|
||||
@@ -41,7 +41,7 @@ where
|
||||
/// Return an error if the payload was not valid or something went wrong trying to validate it (ie
|
||||
/// the View Function in question do not exist at all)
|
||||
pub fn validate<Call: Payload>(&self, payload: Call) -> Result<(), ViewFunctionError> {
|
||||
subxt_core::view_functions::validate(payload, &self.client.metadata()).map_err(Into::into)
|
||||
pezkuwi_subxt_core::view_functions::validate(payload, &self.client.metadata()).map_err(Into::into)
|
||||
}
|
||||
|
||||
/// Execute a View Function call.
|
||||
@@ -58,12 +58,12 @@ where
|
||||
let metadata = client.metadata();
|
||||
|
||||
// Validate the View Function payload hash against the compile hash from codegen.
|
||||
subxt_core::view_functions::validate(&payload, &metadata)?;
|
||||
pezkuwi_subxt_core::view_functions::validate(&payload, &metadata)?;
|
||||
|
||||
// Assemble the data to call the "execute_view_function" runtime API, which
|
||||
// then calls the relevant view function.
|
||||
let call_name = subxt_core::view_functions::CALL_NAME;
|
||||
let call_args = subxt_core::view_functions::call_args(&payload, &metadata)?;
|
||||
let call_name = pezkuwi_subxt_core::view_functions::CALL_NAME;
|
||||
let call_args = pezkuwi_subxt_core::view_functions::call_args(&payload, &metadata)?;
|
||||
|
||||
// Make the call.
|
||||
let bytes = client
|
||||
@@ -74,7 +74,7 @@ where
|
||||
|
||||
// Decode the response.
|
||||
let value =
|
||||
subxt_core::view_functions::decode_value(&mut &*bytes, &payload, &metadata)?;
|
||||
pezkuwi_subxt_core::view_functions::decode_value(&mut &*bytes, &payload, &metadata)?;
|
||||
Ok(value)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user