fix: Add workspace dependencies for vendored pezkuwi-subxt and zombienet-sdk
- Add all missing workspace dependencies required by vendor crates - Include external crates: scale-*, sp-core, sc-chain-spec, kube, etc. - Include subxt dependencies: smoldot, web-time, wasm-bindgen, etc. - Regenerate umbrella crate with updated dependencies - Apply zepter std feature propagation fixes to vendor crates - Apply rustfmt formatting to vendor and pezframe files
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
|
||||
#![allow(missing_docs, unused)]
|
||||
|
||||
use sp_core::{Pair as _, sr25519};
|
||||
use pezkuwi_subxt::{Config, OnlineClient, PezkuwiConfig, config::bizinikiwi::MultiAddress};
|
||||
use pezkuwi_subxt::{config::bizinikiwi::MultiAddress, Config, OnlineClient, PezkuwiConfig};
|
||||
use sp_core::{sr25519, Pair as _};
|
||||
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
pub mod pezkuwi {}
|
||||
@@ -16,14 +16,14 @@ pub mod pezkuwi {}
|
||||
/// and that PezkuwiConfig is the runtime configuration.
|
||||
mod pair_signer {
|
||||
use super::*;
|
||||
use sp_runtime::{
|
||||
MultiSignature as SpMultiSignature,
|
||||
traits::{IdentifyAccount, Verify},
|
||||
};
|
||||
use pezkuwi_subxt::{
|
||||
config::bizinikiwi::{AccountId32, MultiSignature},
|
||||
tx::Signer,
|
||||
};
|
||||
use sp_runtime::{
|
||||
traits::{IdentifyAccount, Verify},
|
||||
MultiSignature as SpMultiSignature,
|
||||
};
|
||||
|
||||
/// A [`Signer`] implementation for [`sp_core::sr25519::Pair`].
|
||||
#[derive(Clone)]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt::{
|
||||
OnlineClient, PezkuwiConfig,
|
||||
utils::{AccountId32, MultiAddress},
|
||||
OnlineClient, PezkuwiConfig,
|
||||
};
|
||||
|
||||
use codec::Decode;
|
||||
@@ -55,5 +55,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
|
||||
fn display_address(addr: &MultiAddress<AccountId32, ()>) -> String {
|
||||
if let MultiAddress::Id(id32) = addr { format!("{id32}") } else { "MultiAddress::...".into() }
|
||||
if let MultiAddress::Id(id32) = addr {
|
||||
format!("{id32}")
|
||||
} else {
|
||||
"MultiAddress::...".into()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig, dynamic::Value};
|
||||
use pezkuwi_subxt::{dynamic::Value, OnlineClient, PezkuwiConfig};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use futures::StreamExt;
|
||||
use pezkuwi_subxt::{PezkuwiConfig, client::OnlineClient, lightclient::LightClient};
|
||||
use pezkuwi_subxt::{client::OnlineClient, lightclient::LightClient, PezkuwiConfig};
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{
|
||||
PezkuwiConfig,
|
||||
client::OnlineClient,
|
||||
lightclient::{ChainConfig, LightClient},
|
||||
utils::fetch_chainspec_from_rpc_node,
|
||||
PezkuwiConfig,
|
||||
};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{
|
||||
OnlineClient, PezkuwiConfig,
|
||||
backend::{legacy::LegacyRpcMethods, rpc::RpcClient},
|
||||
config::DefaultExtrinsicParamsBuilder as Params,
|
||||
OnlineClient, PezkuwiConfig,
|
||||
};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
pub mod pezkuwi {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt::{config::PezkuwiConfig, utils::AccountId32, OnlineClient};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{OnlineClient, config::PezkuwiConfig, utils::AccountId32};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
@@ -13,8 +13,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// but since we know the input + return types we can pass them directly.
|
||||
// There is one input argument, so the inputs are a tuple of one element.
|
||||
let account: AccountId32 = dev::alice().public_key().into();
|
||||
let runtime_api_call =
|
||||
pezkuwi_subxt::dynamic::runtime_api_call::<_, u64>("AccountNonceApi", "account_nonce", (account,));
|
||||
let runtime_api_call = pezkuwi_subxt::dynamic::runtime_api_call::<_, u64>(
|
||||
"AccountNonceApi",
|
||||
"account_nonce",
|
||||
(account,),
|
||||
);
|
||||
|
||||
// Submit the call to get back a result.
|
||||
let nonce = api.runtime_api().at_latest().await?.call(runtime_api_call).await?;
|
||||
|
||||
+1
-1
@@ -1,10 +1,10 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt::{
|
||||
OnlineClient, PezkuwiConfig,
|
||||
ext::{
|
||||
codec::{Compact, Decode},
|
||||
frame_metadata::RuntimeMetadataPrefixed,
|
||||
},
|
||||
OnlineClient, PezkuwiConfig,
|
||||
};
|
||||
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt::{config::PezkuwiConfig, OnlineClient};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{OnlineClient, config::PezkuwiConfig};
|
||||
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
pub mod pezkuwi {}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt::{
|
||||
backend::rpc::{RawRpcFuture, RawRpcSubscription, RawValue, RpcClient, RpcClientT},
|
||||
OnlineClient, PezkuwiConfig,
|
||||
};
|
||||
use std::{
|
||||
fmt::Write,
|
||||
pin::Pin,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
use pezkuwi_subxt::{
|
||||
OnlineClient, PezkuwiConfig,
|
||||
backend::rpc::{RawRpcFuture, RawRpcSubscription, RawValue, RpcClient, RpcClientT},
|
||||
};
|
||||
|
||||
// A dummy RPC client that doesn't actually handle requests properly
|
||||
// at all, but instead just logs what requests to it were made.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt::{
|
||||
OfflineClient, config::PezkuwiConfig, ext::codec::Decode, metadata::Metadata, utils::H256,
|
||||
config::PezkuwiConfig, ext::codec::Decode, metadata::Metadata, utils::H256, OfflineClient,
|
||||
};
|
||||
|
||||
#[tokio::main]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::config::{
|
||||
Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder, PezkuwiConfig, BizinikiwConfig,
|
||||
BizinikiwConfig, Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder, PezkuwiConfig,
|
||||
};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[pezkuwi_subxt::subxt(
|
||||
runtime_metadata_path = "../artifacts/pezkuwi_metadata_full.scale",
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#![allow(missing_docs)]
|
||||
use codec::Encode;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{
|
||||
client::ClientState,
|
||||
config::{
|
||||
Config, ExtrinsicParams, ExtrinsicParamsEncoder, ExtrinsicParamsError, HashFor,
|
||||
transaction_extensions::Params,
|
||||
transaction_extensions::Params, Config, ExtrinsicParams, ExtrinsicParamsEncoder,
|
||||
ExtrinsicParamsError, HashFor,
|
||||
},
|
||||
};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_full.scale")]
|
||||
pub mod runtime {}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#![allow(missing_docs)]
|
||||
use codec::Encode;
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use scale_encode::EncodeAsType;
|
||||
use scale_info::PortableRegistry;
|
||||
use pezkuwi_subxt::{
|
||||
client::ClientState,
|
||||
config::{
|
||||
Config, DefaultExtrinsicParamsBuilder, ExtrinsicParams, ExtrinsicParamsEncoder,
|
||||
ExtrinsicParamsError, transaction_extensions,
|
||||
transaction_extensions, Config, DefaultExtrinsicParamsBuilder, ExtrinsicParams,
|
||||
ExtrinsicParamsEncoder, ExtrinsicParamsError,
|
||||
},
|
||||
};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use scale_encode::EncodeAsType;
|
||||
use scale_info::PortableRegistry;
|
||||
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
pub mod runtime {}
|
||||
|
||||
@@ -10,8 +10,8 @@ use std::time::Duration;
|
||||
|
||||
use futures::StreamExt;
|
||||
use pezkuwi_subxt::{
|
||||
OnlineClient, PezkuwiConfig,
|
||||
backend::rpc::reconnecting_rpc_client::{ExponentialBackoff, RpcClient},
|
||||
OnlineClient, PezkuwiConfig,
|
||||
};
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
use futures::StreamExt;
|
||||
use pezkuwi_subxt::{
|
||||
OnlineClient, PezkuwiConfig,
|
||||
backend::{
|
||||
chain_head::{ChainHeadBackend, ChainHeadBackendBuilder},
|
||||
rpc::RpcClient,
|
||||
},
|
||||
OnlineClient, PezkuwiConfig,
|
||||
};
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{
|
||||
OnlineClient, PezkuwiConfig,
|
||||
dynamic::{At, Value},
|
||||
utils::AccountId32,
|
||||
OnlineClient, PezkuwiConfig,
|
||||
};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
@@ -16,7 +16,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// to access a value; an AccountId32. In this example we don't know the
|
||||
// return type and so we set it to `Value`, which anything can decode into.
|
||||
let account: AccountId32 = dev::alice().public_key().into();
|
||||
let storage_query = pezkuwi_subxt::dynamic::storage::<(AccountId32,), Value>("System", "Account");
|
||||
let storage_query =
|
||||
pezkuwi_subxt::dynamic::storage::<(AccountId32,), Value>("System", "Account");
|
||||
|
||||
// Use that query to access a storage entry, fetch a result and decode the value.
|
||||
let client_at = api.storage().at_latest().await?;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig, ext::futures::StreamExt};
|
||||
use pezkuwi_subxt::{ext::futures::StreamExt, OnlineClient, PezkuwiConfig};
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt::{
|
||||
OnlineClient, PezkuwiConfig,
|
||||
dynamic::{At, Value},
|
||||
ext::futures::StreamExt,
|
||||
utils::AccountId32,
|
||||
OnlineClient, PezkuwiConfig,
|
||||
};
|
||||
|
||||
#[tokio::main]
|
||||
@@ -15,7 +15,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// here, we assume that there is one value to provide at this entry
|
||||
// to access a value; an AccountId32. In this example we don't know the
|
||||
// return type and so we set it to `Value`, which anything can decode into.
|
||||
let storage_query = pezkuwi_subxt::dynamic::storage::<(AccountId32,), Value>("System", "Account");
|
||||
let storage_query =
|
||||
pezkuwi_subxt::dynamic::storage::<(AccountId32,), Value>("System", "Account");
|
||||
|
||||
// Use that query to access a storage entry, iterate over it and decode values.
|
||||
let client_at = api.storage().at_latest().await?;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use pezkuwi_subxt_core::utils::AccountId20;
|
||||
use pezkuwi_subxt_signer::eth::{Signature, dev};
|
||||
use pezkuwi_subxt::OnlineClient;
|
||||
use pezkuwi_subxt_core::utils::AccountId20;
|
||||
use pezkuwi_subxt_signer::eth::{dev, Signature};
|
||||
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/frontier_metadata_small.scale")]
|
||||
mod eth_runtime {}
|
||||
@@ -19,8 +19,10 @@ impl pezkuwi_subxt::Config for EthRuntimeConfig {
|
||||
type Address = AccountId20;
|
||||
type Signature = Signature;
|
||||
type Hasher = pezkuwi_subxt::config::bizinikiwi::BlakeTwo256;
|
||||
type Header =
|
||||
pezkuwi_subxt::config::bizinikiwi::BizinikiwiHeader<u32, pezkuwi_subxt::config::bizinikiwi::BlakeTwo256>;
|
||||
type Header = pezkuwi_subxt::config::bizinikiwi::BizinikiwiHeader<
|
||||
u32,
|
||||
pezkuwi_subxt::config::bizinikiwi::BlakeTwo256,
|
||||
>;
|
||||
type ExtrinsicParams = pezkuwi_subxt::config::BizinikiwiExtrinsicParams<Self>;
|
||||
type AssetId = u32;
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
pub mod pezkuwi {}
|
||||
@@ -36,7 +36,7 @@ fn remark() -> Box<dyn pezkuwi_subxt::tx::Payload> {
|
||||
}
|
||||
|
||||
fn dynamic_remark() -> Box<dyn pezkuwi_subxt::tx::Payload> {
|
||||
use pezkuwi_subxt::dynamic::{Value, tx};
|
||||
use pezkuwi_subxt::dynamic::{tx, Value};
|
||||
let tx_payload = tx("System", "remark", vec![Value::from_bytes("Hello")]);
|
||||
|
||||
Box::new(tx_payload)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
type BoxedError = Box<dyn std::error::Error + Send + Sync + 'static>;
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt::{tx::TxStatus, OnlineClient, PezkuwiConfig};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig, tx::TxStatus};
|
||||
|
||||
// Generate an interface that we can use from the node's metadata.
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
#![allow(missing_docs)]
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
use pezkuwi_subxt::{
|
||||
OnlineClient, PezkuwiConfig, config::pezkuwi::PezkuwiExtrinsicParamsBuilder as Params,
|
||||
config::pezkuwi::PezkuwiExtrinsicParamsBuilder as Params, OnlineClient, PezkuwiConfig,
|
||||
};
|
||||
use pezkuwi_subxt_signer::sr25519::dev;
|
||||
|
||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
||||
pub mod pezkuwi {}
|
||||
|
||||
@@ -227,8 +227,8 @@ pub(super) mod test_utils {
|
||||
BestBlockChanged, Finalized, Initialized, NewBlock,
|
||||
};
|
||||
use std::sync::{
|
||||
Arc,
|
||||
atomic::{AtomicUsize, Ordering},
|
||||
Arc,
|
||||
};
|
||||
|
||||
/// Given some events, returns a follow stream getter that we can use in
|
||||
|
||||
@@ -297,10 +297,12 @@ impl<H: Hash> Shared<H> {
|
||||
.collect();
|
||||
|
||||
shared.block_events_for_new_subscriptions.retain(|ev| match ev {
|
||||
FollowEvent::NewBlock(new_block_ev) =>
|
||||
!to_remove.contains(&new_block_ev.block_hash.hash()),
|
||||
FollowEvent::BestBlockChanged(best_block_ev) =>
|
||||
!to_remove.contains(&best_block_ev.best_block_hash.hash()),
|
||||
FollowEvent::NewBlock(new_block_ev) => {
|
||||
!to_remove.contains(&new_block_ev.block_hash.hash())
|
||||
},
|
||||
FollowEvent::BestBlockChanged(best_block_ev) => {
|
||||
!to_remove.contains(&best_block_ev.best_block_hash.hash())
|
||||
},
|
||||
_ => true,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
|
||||
// see LICENSE for license details.
|
||||
|
||||
use super::{ChainHeadRpcMethods, follow_stream::FollowStream};
|
||||
use super::{follow_stream::FollowStream, ChainHeadRpcMethods};
|
||||
use crate::{
|
||||
config::{Config, Hash, HashFor},
|
||||
error::BackendError,
|
||||
@@ -229,20 +229,27 @@ impl<H: Hash> Stream for FollowStreamUnpin<H> {
|
||||
FollowStreamMsg::Event(FollowEvent::Stop)
|
||||
},
|
||||
// These events aren't interesting; we just forward them on:
|
||||
FollowStreamMsg::Event(FollowEvent::OperationBodyDone(details)) =>
|
||||
FollowStreamMsg::Event(FollowEvent::OperationBodyDone(details)),
|
||||
FollowStreamMsg::Event(FollowEvent::OperationCallDone(details)) =>
|
||||
FollowStreamMsg::Event(FollowEvent::OperationCallDone(details)),
|
||||
FollowStreamMsg::Event(FollowEvent::OperationStorageItems(details)) =>
|
||||
FollowStreamMsg::Event(FollowEvent::OperationStorageItems(details)),
|
||||
FollowStreamMsg::Event(FollowEvent::OperationWaitingForContinue(details)) =>
|
||||
FollowStreamMsg::Event(FollowEvent::OperationWaitingForContinue(details)),
|
||||
FollowStreamMsg::Event(FollowEvent::OperationStorageDone(details)) =>
|
||||
FollowStreamMsg::Event(FollowEvent::OperationStorageDone(details)),
|
||||
FollowStreamMsg::Event(FollowEvent::OperationInaccessible(details)) =>
|
||||
FollowStreamMsg::Event(FollowEvent::OperationInaccessible(details)),
|
||||
FollowStreamMsg::Event(FollowEvent::OperationError(details)) =>
|
||||
FollowStreamMsg::Event(FollowEvent::OperationError(details)),
|
||||
FollowStreamMsg::Event(FollowEvent::OperationBodyDone(details)) => {
|
||||
FollowStreamMsg::Event(FollowEvent::OperationBodyDone(details))
|
||||
},
|
||||
FollowStreamMsg::Event(FollowEvent::OperationCallDone(details)) => {
|
||||
FollowStreamMsg::Event(FollowEvent::OperationCallDone(details))
|
||||
},
|
||||
FollowStreamMsg::Event(FollowEvent::OperationStorageItems(details)) => {
|
||||
FollowStreamMsg::Event(FollowEvent::OperationStorageItems(details))
|
||||
},
|
||||
FollowStreamMsg::Event(FollowEvent::OperationWaitingForContinue(details)) => {
|
||||
FollowStreamMsg::Event(FollowEvent::OperationWaitingForContinue(details))
|
||||
},
|
||||
FollowStreamMsg::Event(FollowEvent::OperationStorageDone(details)) => {
|
||||
FollowStreamMsg::Event(FollowEvent::OperationStorageDone(details))
|
||||
},
|
||||
FollowStreamMsg::Event(FollowEvent::OperationInaccessible(details)) => {
|
||||
FollowStreamMsg::Event(FollowEvent::OperationInaccessible(details))
|
||||
},
|
||||
FollowStreamMsg::Event(FollowEvent::OperationError(details)) => {
|
||||
FollowStreamMsg::Event(FollowEvent::OperationError(details))
|
||||
},
|
||||
};
|
||||
|
||||
// Return our event.
|
||||
@@ -352,8 +359,8 @@ impl<H: Hash> FollowStreamUnpin<H> {
|
||||
|
||||
let mut blocks_to_unpin = vec![];
|
||||
for (hash, details) in &self.pinned {
|
||||
if rel_block_age.saturating_sub(details.rel_block_age) >= self.max_block_life ||
|
||||
(unpin_flags.contains(hash) && details.can_be_unpinned)
|
||||
if rel_block_age.saturating_sub(details.rel_block_age) >= self.max_block_life
|
||||
|| (unpin_flags.contains(hash) && details.can_be_unpinned)
|
||||
{
|
||||
// The block is too old, or it's been flagged to be unpinned and won't be in a
|
||||
// future backend event, so we can unpin it for real now.
|
||||
@@ -460,7 +467,7 @@ impl<H: Hash> Drop for BlockRef<H> {
|
||||
#[cfg(test)]
|
||||
pub(super) mod test_utils {
|
||||
use super::{
|
||||
super::follow_stream::{FollowStream, test_utils::test_stream_getter},
|
||||
super::follow_stream::{test_utils::test_stream_getter, FollowStream},
|
||||
*,
|
||||
};
|
||||
use crate::config::bizinikiwi::H256;
|
||||
|
||||
+37
-26
@@ -19,21 +19,21 @@ mod storage_items;
|
||||
use self::follow_stream_driver::FollowStreamFinalizedHeads;
|
||||
use crate::{
|
||||
backend::{
|
||||
Backend, BlockRef, BlockRefT, RuntimeVersion, StorageResponse, StreamOf, StreamOfResults,
|
||||
TransactionStatus, utils::retry,
|
||||
utils::retry, Backend, BlockRef, BlockRefT, RuntimeVersion, StorageResponse, StreamOf,
|
||||
StreamOfResults, TransactionStatus,
|
||||
},
|
||||
config::{Config, Hash, HashFor},
|
||||
error::{BackendError, RpcError},
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
use follow_stream_driver::{FollowStreamDriver, FollowStreamDriverHandle};
|
||||
use futures::{Stream, StreamExt, future::Either};
|
||||
use futures::{future::Either, Stream, StreamExt};
|
||||
use pezkuwi_subxt_rpcs::{
|
||||
RpcClient,
|
||||
methods::chain_head::{
|
||||
FollowEvent, MethodResponse, RuntimeEvent, StorageQuery, StorageQueryType,
|
||||
StorageResultType,
|
||||
},
|
||||
RpcClient,
|
||||
};
|
||||
use std::{collections::HashMap, task::Poll};
|
||||
use storage_items::StorageItems;
|
||||
@@ -432,8 +432,9 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for ChainHeadBackend<T> {
|
||||
.events()
|
||||
.filter_map(|ev| {
|
||||
let out = match ev {
|
||||
FollowEvent::Initialized(init) =>
|
||||
init.finalized_block_hashes.last().map(|b| b.clone().into()),
|
||||
FollowEvent::Initialized(init) => {
|
||||
init.finalized_block_hashes.last().map(|b| b.clone().into())
|
||||
},
|
||||
_ => None,
|
||||
};
|
||||
std::future::ready(out)
|
||||
@@ -597,22 +598,28 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for ChainHeadBackend<T> {
|
||||
match tx_status {
|
||||
RpcTransactionStatus::Validated => TransactionStatus::Validated,
|
||||
RpcTransactionStatus::Broadcasted => TransactionStatus::Broadcasted,
|
||||
RpcTransactionStatus::BestChainBlockIncluded { block: None } =>
|
||||
TransactionStatus::NoLongerInBestBlock,
|
||||
RpcTransactionStatus::BestChainBlockIncluded { block: Some(block) } =>
|
||||
RpcTransactionStatus::BestChainBlockIncluded { block: None } => {
|
||||
TransactionStatus::NoLongerInBestBlock
|
||||
},
|
||||
RpcTransactionStatus::BestChainBlockIncluded { block: Some(block) } => {
|
||||
TransactionStatus::InBestBlock {
|
||||
hash: BlockRef::from_hash(block.hash),
|
||||
},
|
||||
RpcTransactionStatus::Finalized { block } =>
|
||||
}
|
||||
},
|
||||
RpcTransactionStatus::Finalized { block } => {
|
||||
TransactionStatus::InFinalizedBlock {
|
||||
hash: BlockRef::from_hash(block.hash),
|
||||
},
|
||||
RpcTransactionStatus::Error { error } =>
|
||||
TransactionStatus::Error { message: error },
|
||||
RpcTransactionStatus::Invalid { error } =>
|
||||
TransactionStatus::Invalid { message: error },
|
||||
RpcTransactionStatus::Dropped { error } =>
|
||||
TransactionStatus::Dropped { message: error },
|
||||
}
|
||||
},
|
||||
RpcTransactionStatus::Error { error } => {
|
||||
TransactionStatus::Error { message: error }
|
||||
},
|
||||
RpcTransactionStatus::Invalid { error } => {
|
||||
TransactionStatus::Invalid { message: error }
|
||||
},
|
||||
RpcTransactionStatus::Dropped { error } => {
|
||||
TransactionStatus::Dropped { message: error }
|
||||
},
|
||||
}
|
||||
})
|
||||
.map_err(Into::into)
|
||||
@@ -782,15 +789,19 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for ChainHeadBackend<T> {
|
||||
};
|
||||
TransactionStatus::InBestBlock { hash: block_ref }
|
||||
},
|
||||
RpcTransactionStatus::BestChainBlockIncluded { block: None } =>
|
||||
TransactionStatus::NoLongerInBestBlock,
|
||||
RpcTransactionStatus::BestChainBlockIncluded { block: None } => {
|
||||
TransactionStatus::NoLongerInBestBlock
|
||||
},
|
||||
RpcTransactionStatus::Broadcasted => TransactionStatus::Broadcasted,
|
||||
RpcTransactionStatus::Dropped { error, .. } =>
|
||||
TransactionStatus::Dropped { message: error },
|
||||
RpcTransactionStatus::Error { error } =>
|
||||
TransactionStatus::Error { message: error },
|
||||
RpcTransactionStatus::Invalid { error } =>
|
||||
TransactionStatus::Invalid { message: error },
|
||||
RpcTransactionStatus::Dropped { error, .. } => {
|
||||
TransactionStatus::Dropped { message: error }
|
||||
},
|
||||
RpcTransactionStatus::Error { error } => {
|
||||
TransactionStatus::Error { message: error }
|
||||
},
|
||||
RpcTransactionStatus::Invalid { error } => {
|
||||
TransactionStatus::Invalid { message: error }
|
||||
},
|
||||
RpcTransactionStatus::Validated => TransactionStatus::Validated,
|
||||
};
|
||||
return Poll::Ready(Some(Ok(tx_progress_ev)));
|
||||
|
||||
+10
-10
@@ -8,15 +8,15 @@
|
||||
use self::rpc_methods::TransactionStatus as RpcTransactionStatus;
|
||||
use crate::{
|
||||
backend::{
|
||||
utils::{retry, retry_stream},
|
||||
Backend, BlockRef, RuntimeVersion, StorageResponse, StreamOf, StreamOfResults,
|
||||
TransactionStatus,
|
||||
utils::{retry, retry_stream},
|
||||
},
|
||||
config::{Config, HashFor, Header},
|
||||
error::BackendError,
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
use futures::{Future, FutureExt, Stream, StreamExt, TryStreamExt, future, future::Either, stream};
|
||||
use futures::{future, future::Either, stream, Future, FutureExt, Stream, StreamExt, TryStreamExt};
|
||||
use pezkuwi_subxt_rpcs::RpcClient;
|
||||
use std::{
|
||||
collections::VecDeque,
|
||||
@@ -360,10 +360,10 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for LegacyBackend<T> {
|
||||
let sub = self.methods.author_submit_and_watch_extrinsic(extrinsic).await?;
|
||||
|
||||
let sub = sub.filter_map(|r| {
|
||||
let mapped = r
|
||||
.map_err(|e| e.into())
|
||||
.map(|tx| {
|
||||
match tx {
|
||||
let mapped =
|
||||
r.map_err(|e| e.into())
|
||||
.map(|tx| {
|
||||
match tx {
|
||||
// We ignore these because they don't map nicely to the new API. They don't
|
||||
// signal "end states" so this should be fine.
|
||||
RpcTransactionStatus::Future => None,
|
||||
@@ -394,8 +394,8 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for LegacyBackend<T> {
|
||||
.into(),
|
||||
}),
|
||||
}
|
||||
})
|
||||
.transpose();
|
||||
})
|
||||
.transpose();
|
||||
|
||||
future::ready(mapped)
|
||||
});
|
||||
@@ -504,8 +504,8 @@ impl<T: Config> Stream for StorageFetchDescendantKeysStream<T> {
|
||||
|
||||
match keys {
|
||||
Ok(mut keys) => {
|
||||
if this.pagination_start_key.is_some() &&
|
||||
keys.first() == this.pagination_start_key.as_ref()
|
||||
if this.pagination_start_key.is_some()
|
||||
&& keys.first() == this.pagination_start_key.as_ref()
|
||||
{
|
||||
// Currently, Smoldot returns the "start key" as the first key in the
|
||||
// input (see https://github.com/smol-dot/smoldot/issues/1692), whereas Bizinikiwi doesn't.
|
||||
|
||||
+11
-14
@@ -25,9 +25,8 @@ use std::{pin::Pin, sync::Arc};
|
||||
/// [`crate::ext::pezkuwi_subxt_rpcs`].
|
||||
pub mod rpc {
|
||||
pub use pezkuwi_subxt_rpcs::{
|
||||
RpcClient, RpcClientT,
|
||||
client::{RawRpcFuture, RawRpcSubscription, RawValue, RpcParams},
|
||||
rpc_params,
|
||||
rpc_params, RpcClient, RpcClientT,
|
||||
};
|
||||
|
||||
crate::macros::cfg_reconnecting_rpc_client! {
|
||||
@@ -123,7 +122,7 @@ pub trait Backend<T: Config>: sealed::Sealed + Send + Sync + 'static {
|
||||
|
||||
/// A stream of all new runtime versions as they occur.
|
||||
async fn stream_runtime_version(&self)
|
||||
-> Result<StreamOfResults<RuntimeVersion>, BackendError>;
|
||||
-> Result<StreamOfResults<RuntimeVersion>, BackendError>;
|
||||
|
||||
/// A stream of all new block headers as they arrive.
|
||||
async fn stream_all_block_headers(
|
||||
@@ -390,10 +389,10 @@ mod test {
|
||||
use crate::backend::StorageResponse;
|
||||
use core::convert::Infallible;
|
||||
use futures::StreamExt;
|
||||
use pezkuwi_subxt_core::{Config, config::DefaultExtrinsicParams};
|
||||
use pezkuwi_subxt_core::{config::DefaultExtrinsicParams, Config};
|
||||
use pezkuwi_subxt_rpcs::client::{
|
||||
MockRpcClient,
|
||||
mock_rpc_client::{Json, MockRpcClientBuilder},
|
||||
MockRpcClient,
|
||||
};
|
||||
use primitive_types::H256;
|
||||
use rpc::RpcClientT;
|
||||
@@ -429,7 +428,7 @@ mod test {
|
||||
mod legacy {
|
||||
use super::*;
|
||||
use crate::{
|
||||
backend::legacy::{LegacyBackend, rpc_methods::RuntimeVersion},
|
||||
backend::legacy::{rpc_methods::RuntimeVersion, LegacyBackend},
|
||||
error::RpcError,
|
||||
};
|
||||
|
||||
@@ -688,7 +687,7 @@ mod test {
|
||||
I: IntoIterator<Item = usize> + Send,
|
||||
I::IntoIter: Send + Sync + 'static,
|
||||
{
|
||||
use pezkuwi_subxt_rpcs::{Error, UserError, client::mock_rpc_client::AndThen};
|
||||
use pezkuwi_subxt_rpcs::{client::mock_rpc_client::AndThen, Error, UserError};
|
||||
|
||||
let recv = Arc::new(tokio::sync::Mutex::new(recv));
|
||||
let mut ids = ids.into_iter();
|
||||
@@ -824,13 +823,11 @@ mod test {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert!(
|
||||
response
|
||||
.next()
|
||||
.await
|
||||
.unwrap()
|
||||
.is_err_and(|e| matches!(e, BackendError::Other(e) if e == "error"))
|
||||
);
|
||||
assert!(response
|
||||
.next()
|
||||
.await
|
||||
.unwrap()
|
||||
.is_err_and(|e| matches!(e, BackendError::Other(e) if e == "error")));
|
||||
assert!(response.next().await.is_none());
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
use super::{StreamOf, StreamOfResults};
|
||||
use crate::error::BackendError;
|
||||
use futures::{FutureExt, Stream, StreamExt, future::BoxFuture};
|
||||
use futures::{future::BoxFuture, FutureExt, Stream, StreamExt};
|
||||
use std::{future::Future, pin::Pin, task::Poll};
|
||||
|
||||
/// Resubscribe callback.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// see LICENSE for license details.
|
||||
|
||||
use crate::{
|
||||
blocks::block_types::{CachedEvents, get_events},
|
||||
blocks::block_types::{get_events, CachedEvents},
|
||||
client::{OfflineClientT, OnlineClientT},
|
||||
config::{Config, HashFor},
|
||||
error::{EventsError, ExtrinsicDecodeErrorAt, ExtrinsicError},
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../examples/tx_basic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! This example assumes that a Pezkuwi node is running locally (Subxt endeavors to support all
|
||||
//! recent releases). Typically, to use Subxt to talk to some custom Bizinikiwi node (for example a
|
||||
//! parachain node), you'll want to:
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/setup_client_custom_rpc.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Creating an [`crate::OfflineClient`]:
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/setup_client_offline.rs")]
|
||||
|
||||
+2
-2
@@ -161,7 +161,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str ! ("../../../examples/setup_config_transaction_extension.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Implementing [`crate::config::ExtrinsicParams`] from scratch
|
||||
//!
|
||||
//! Alternately, you are free to implement [`crate::config::ExtrinsicParams`] entirely from scratch if you know exactly what "extra" and
|
||||
@@ -171,7 +171,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str ! ("../../../examples/setup_config_custom.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Using a type from the metadata as a config parameter
|
||||
//!
|
||||
//! You can also use types that are generated from chain metadata as type parameters of the Config trait.
|
||||
|
||||
+3
-3
@@ -58,7 +58,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/blocks_subscribing.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Statically decode the extrinsic into [a specific pallet call](crate::blocks::ExtrinsicDetails::as_extrinsic())
|
||||
//!
|
||||
//! This is useful if you are expecting a specific extrinsic to be part of some block. If the extrinsic you try to decode
|
||||
@@ -73,7 +73,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/block_decoding_static.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Dynamically decode the extrinsic
|
||||
//!
|
||||
//! Sometimes you might use subxt with metadata that is not known at compile time. In this case, you do not
|
||||
@@ -87,7 +87,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/block_decoding_dynamic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ## Decoding transaction extensions
|
||||
//!
|
||||
//! Extrinsics can contain transaction extensions. The transaction extensions can be different across chains.
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/constants_static.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! And here's one using a dynamic query:
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/constants_dynamic.rs")]
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/light_client_basic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Connecting to a local node
|
||||
//!
|
||||
//! This example connects to a local chain and submits a transaction. To run this, you first need
|
||||
@@ -41,7 +41,7 @@
|
||||
//! ```text
|
||||
//! pezkuwi --dev --node-key 0000000000000000000000000000000000000000000000000000000000000001
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! Then, the following code will download a chain spec from this local node, alter the bootnodes
|
||||
//! to point only to the local node, and then submit a transaction through it.
|
||||
//! ```rust,ignore
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/runtime_apis_static.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Making a dynamic Runtime API call
|
||||
//!
|
||||
//! If you'd prefer to construct the call at runtime, you can do this using the
|
||||
@@ -66,7 +66,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/runtime_apis_dynamic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Making a raw call
|
||||
//!
|
||||
//! This is generally discouraged in favour of one of the above, but may be necessary (especially if
|
||||
|
||||
+3
-3
@@ -57,14 +57,14 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/storage_fetch.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! For completeness, below is an example using a dynamic query instead. Dynamic queries can define the types that
|
||||
//! they wish to accept inputs and decode the return value into ([`crate::dynamic::Value`] can be used here anywhere we
|
||||
//! are not sure of the specific types).
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/storage_fetch_dynamic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Iterating storage entries
|
||||
//!
|
||||
//! Many storage entries are maps of values; as well as fetching individual values, it's possible to
|
||||
@@ -72,7 +72,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/storage_iterating.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! Here's the same logic but using dynamically constructed values instead:
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/storage_iterating_dynamic.rs")]
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/tx_basic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Providing transaction parameters
|
||||
//!
|
||||
//! If you'd like to provide parameters (such as mortality) to the transaction, you can use
|
||||
@@ -170,7 +170,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/tx_with_params.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! This example doesn't wait for the transaction to be included in a block; it just submits it and
|
||||
//! hopes for the best!
|
||||
//!
|
||||
@@ -180,7 +180,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/tx_boxed.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Custom handling of transaction status updates
|
||||
//!
|
||||
//! If you'd like more control or visibility over exactly which status updates are being emitted for
|
||||
@@ -188,7 +188,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/tx_status_stream.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ### Signing transactions externally
|
||||
//!
|
||||
//! Subxt also allows you to get hold of the signer payload and hand that off to something else to be
|
||||
@@ -196,6 +196,6 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../../../examples/tx_partial.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! Take a look at the API docs for [`crate::tx::TxProgress`], [`crate::tx::TxStatus`] and
|
||||
//! [`crate::tx::TxInBlock`] for more options.
|
||||
|
||||
+1
-1
@@ -3,7 +3,6 @@
|
||||
// see LICENSE for license details.
|
||||
|
||||
use crate::{
|
||||
Metadata,
|
||||
blocks::BlocksClient,
|
||||
config::{Config, HashFor},
|
||||
constants::ConstantsClient,
|
||||
@@ -13,6 +12,7 @@ use crate::{
|
||||
storage::StorageClient,
|
||||
tx::TxClient,
|
||||
view_functions::ViewFunctionsClient,
|
||||
Metadata,
|
||||
};
|
||||
|
||||
use derive_where::derive_where;
|
||||
|
||||
+3
-3
@@ -4,8 +4,7 @@
|
||||
|
||||
use super::{OfflineClient, OfflineClientT};
|
||||
use crate::{
|
||||
Metadata,
|
||||
backend::{Backend, BackendExt, StreamOfResults, legacy::LegacyBackend, rpc::RpcClient},
|
||||
backend::{legacy::LegacyBackend, rpc::RpcClient, Backend, BackendExt, StreamOfResults},
|
||||
blocks::{BlockRef, BlocksClient},
|
||||
config::{Config, HashFor},
|
||||
constants::ConstantsClient,
|
||||
@@ -16,9 +15,10 @@ use crate::{
|
||||
storage::StorageClient,
|
||||
tx::TxClient,
|
||||
view_functions::ViewFunctionsClient,
|
||||
Metadata,
|
||||
};
|
||||
use derive_where::derive_where;
|
||||
use futures::{TryFutureExt, future};
|
||||
use futures::{future, TryFutureExt};
|
||||
use pezkuwi_subxt_core::client::{ClientState, RuntimeVersion};
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
|
||||
// see LICENSE for license details.
|
||||
|
||||
use crate::{Config, client::OfflineClientT, error::ConstantError};
|
||||
use crate::{client::OfflineClientT, error::ConstantError, Config};
|
||||
use derive_where::derive_where;
|
||||
use pezkuwi_subxt_core::constants::address::Address;
|
||||
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@
|
||||
mod constants_client;
|
||||
|
||||
pub use constants_client::ConstantsClient;
|
||||
pub use pezkuwi_subxt_core::constants::address::{Address, DynamicAddress, StaticAddress, dynamic};
|
||||
pub use pezkuwi_subxt_core::constants::address::{dynamic, Address, DynamicAddress, StaticAddress};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::{Config, client::OfflineClientT, error::CustomValueError};
|
||||
use crate::{client::OfflineClientT, error::CustomValueError, Config};
|
||||
use derive_where::derive_where;
|
||||
|
||||
use pezkuwi_subxt_core::custom_values::address::{Address, Maybe};
|
||||
@@ -45,13 +45,13 @@ impl<T: Config, Client: OfflineClientT<T>> CustomValuesClient<T, Client> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::{
|
||||
Metadata, OfflineClient, BizinikiwConfig,
|
||||
custom_values::{self, CustomValuesClient},
|
||||
BizinikiwConfig, Metadata, OfflineClient,
|
||||
};
|
||||
use codec::Encode;
|
||||
use pezkuwi_subxt_core::client::RuntimeVersion;
|
||||
use scale_decode::DecodeAsType;
|
||||
use scale_info::{TypeInfo, form::PortableForm};
|
||||
use scale_info::{form::PortableForm, TypeInfo};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Encode, TypeInfo, DecodeAsType)]
|
||||
|
||||
+1
-1
@@ -8,5 +8,5 @@ mod custom_values_client;
|
||||
|
||||
pub use custom_values_client::CustomValuesClient;
|
||||
pub use pezkuwi_subxt_core::custom_values::address::{
|
||||
Address, DynamicAddress, StaticAddress, dynamic,
|
||||
dynamic, Address, DynamicAddress, StaticAddress,
|
||||
};
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
use super::{DispatchErrorDecodeError, ModuleErrorDecodeError, ModuleErrorDetailsError};
|
||||
use crate::metadata::Metadata;
|
||||
use core::fmt::Debug;
|
||||
use scale_decode::{DecodeAsType, TypeResolver, visitor::DecodeAsTypeResult};
|
||||
use scale_decode::{visitor::DecodeAsTypeResult, DecodeAsType, TypeResolver};
|
||||
use std::{borrow::Cow, marker::PhantomData};
|
||||
|
||||
/// An error dispatching a transaction.
|
||||
|
||||
+41
-35
@@ -178,7 +178,9 @@ pub enum BackendError {
|
||||
MetadataVersionNotFound(u32),
|
||||
#[error("Backend error: Could not codec::Decode Runtime API response: {0}")]
|
||||
CouldNotScaleDecodeRuntimeResponse(codec::Error),
|
||||
#[error("Backend error: Could not codec::Decode metadata bytes into pezkuwi_subxt::Metadata: {0}")]
|
||||
#[error(
|
||||
"Backend error: Could not codec::Decode metadata bytes into pezkuwi_subxt::Metadata: {0}"
|
||||
)]
|
||||
CouldNotDecodeMetadata(codec::Error),
|
||||
// This is for errors in `Backend` implementations which aren't any of the "pre-defined" set
|
||||
// above:
|
||||
@@ -253,11 +255,11 @@ pub enum BlockError {
|
||||
impl BlockError {
|
||||
fn backend_error(&self) -> Option<&BackendError> {
|
||||
match self {
|
||||
BlockError::CouldNotGetBlockHeader { reason: e, .. } |
|
||||
BlockError::CouldNotGetLatestBlock(e) |
|
||||
BlockError::CouldNotSubscribeToAllBlocks(e) |
|
||||
BlockError::CouldNotSubscribeToBestBlocks(e) |
|
||||
BlockError::CouldNotSubscribeToFinalizedBlocks(e) => Some(e),
|
||||
BlockError::CouldNotGetBlockHeader { reason: e, .. }
|
||||
| BlockError::CouldNotGetLatestBlock(e)
|
||||
| BlockError::CouldNotSubscribeToAllBlocks(e)
|
||||
| BlockError::CouldNotSubscribeToBestBlocks(e)
|
||||
| BlockError::CouldNotSubscribeToFinalizedBlocks(e) => Some(e),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -305,10 +307,10 @@ pub enum OnlineClientError {
|
||||
impl OnlineClientError {
|
||||
fn backend_error(&self) -> Option<&BackendError> {
|
||||
match self {
|
||||
OnlineClientError::CannotGetLatestFinalizedBlock(e) |
|
||||
OnlineClientError::CannotGetGenesisHash(e) |
|
||||
OnlineClientError::CannotGetCurrentRuntimeVersion(e) |
|
||||
OnlineClientError::CannotFetchMetadata(e) => Some(e),
|
||||
OnlineClientError::CannotGetLatestFinalizedBlock(e)
|
||||
| OnlineClientError::CannotGetGenesisHash(e)
|
||||
| OnlineClientError::CannotGetCurrentRuntimeVersion(e)
|
||||
| OnlineClientError::CannotFetchMetadata(e) => Some(e),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -328,7 +330,9 @@ pub enum RuntimeUpdaterError {
|
||||
CannotGetNextRuntimeVersion(BackendError),
|
||||
#[error("Error subscribing to runtime updates: Cannot stream finalized blocks: {0}")]
|
||||
CannotStreamFinalizedBlocks(BackendError),
|
||||
#[error("Error subscribing to runtime updates: Cannot get next finalized block in stream: {0}")]
|
||||
#[error(
|
||||
"Error subscribing to runtime updates: Cannot get next finalized block in stream: {0}"
|
||||
)]
|
||||
CannotGetNextFinalizedBlock(BackendError),
|
||||
#[error("Cannot fetch new metadata for runtime update: {0}")]
|
||||
CannotFetchNewMetadata(BackendError),
|
||||
@@ -345,11 +349,11 @@ pub enum RuntimeUpdaterError {
|
||||
impl RuntimeUpdaterError {
|
||||
fn backend_error(&self) -> Option<&BackendError> {
|
||||
match self {
|
||||
RuntimeUpdaterError::CannotStreamRuntimeVersion(e) |
|
||||
RuntimeUpdaterError::CannotGetNextRuntimeVersion(e) |
|
||||
RuntimeUpdaterError::CannotStreamFinalizedBlocks(e) |
|
||||
RuntimeUpdaterError::CannotGetNextFinalizedBlock(e) |
|
||||
RuntimeUpdaterError::CannotFetchNewMetadata(e) => Some(e),
|
||||
RuntimeUpdaterError::CannotStreamRuntimeVersion(e)
|
||||
| RuntimeUpdaterError::CannotGetNextRuntimeVersion(e)
|
||||
| RuntimeUpdaterError::CannotStreamFinalizedBlocks(e)
|
||||
| RuntimeUpdaterError::CannotGetNextFinalizedBlock(e)
|
||||
| RuntimeUpdaterError::CannotFetchNewMetadata(e) => Some(e),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -369,7 +373,9 @@ pub enum RuntimeUpdateeApplyError {
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum RuntimeApiError {
|
||||
#[error("Cannot access Runtime APIs at latest block: Cannot fetch latest finalized block: {0}")]
|
||||
#[error(
|
||||
"Cannot access Runtime APIs at latest block: Cannot fetch latest finalized block: {0}"
|
||||
)]
|
||||
CannotGetLatestFinalizedBlock(BackendError),
|
||||
#[error("{0}")]
|
||||
OfflineError(#[from] CoreRuntimeApiError),
|
||||
@@ -380,8 +386,8 @@ pub enum RuntimeApiError {
|
||||
impl RuntimeApiError {
|
||||
fn backend_error(&self) -> Option<&BackendError> {
|
||||
match self {
|
||||
RuntimeApiError::CannotGetLatestFinalizedBlock(e) |
|
||||
RuntimeApiError::CannotCallApi(e) => Some(e),
|
||||
RuntimeApiError::CannotGetLatestFinalizedBlock(e)
|
||||
| RuntimeApiError::CannotCallApi(e) => Some(e),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -403,8 +409,8 @@ pub enum EventsError {
|
||||
impl EventsError {
|
||||
fn backend_error(&self) -> Option<&BackendError> {
|
||||
match self {
|
||||
EventsError::CannotGetLatestFinalizedBlock(e) |
|
||||
EventsError::CannotFetchEventBytes(e) => Some(e),
|
||||
EventsError::CannotGetLatestFinalizedBlock(e)
|
||||
| EventsError::CannotFetchEventBytes(e) => Some(e),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -456,12 +462,12 @@ pub enum ExtrinsicError {
|
||||
impl ExtrinsicError {
|
||||
fn backend_error(&self) -> Option<&BackendError> {
|
||||
match self {
|
||||
ExtrinsicError::CannotGetBlockBody(e) |
|
||||
ExtrinsicError::CannotGetLatestFinalizedBlock(e) |
|
||||
ExtrinsicError::ErrorSubmittingTransaction(e) |
|
||||
ExtrinsicError::TransactionStatusStreamError(e) |
|
||||
ExtrinsicError::CannotGetFeeInfo(e) |
|
||||
ExtrinsicError::CannotGetValidationInfo(e) => Some(e),
|
||||
ExtrinsicError::CannotGetBlockBody(e)
|
||||
| ExtrinsicError::CannotGetLatestFinalizedBlock(e)
|
||||
| ExtrinsicError::ErrorSubmittingTransaction(e)
|
||||
| ExtrinsicError::TransactionStatusStreamError(e)
|
||||
| ExtrinsicError::CannotGetFeeInfo(e)
|
||||
| ExtrinsicError::CannotGetValidationInfo(e) => Some(e),
|
||||
ExtrinsicError::AccountNonceError { reason, .. } => reason.backend_error(),
|
||||
_ => None,
|
||||
}
|
||||
@@ -486,8 +492,8 @@ pub enum ViewFunctionError {
|
||||
impl ViewFunctionError {
|
||||
fn backend_error(&self) -> Option<&BackendError> {
|
||||
match self {
|
||||
ViewFunctionError::CannotGetLatestFinalizedBlock(e) |
|
||||
ViewFunctionError::CannotCallApi(e) => Some(e),
|
||||
ViewFunctionError::CannotGetLatestFinalizedBlock(e)
|
||||
| ViewFunctionError::CannotCallApi(e) => Some(e),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -565,8 +571,8 @@ impl TransactionEventsError {
|
||||
fn backend_error(&self) -> Option<&BackendError> {
|
||||
match self {
|
||||
TransactionEventsError::CannotFetchBlockBody { error, .. } => Some(error),
|
||||
TransactionEventsError::CannotDecodeEventInBlock { error, .. } |
|
||||
TransactionEventsError::CannotFetchEventsForTransaction { error, .. } => error.backend_error(),
|
||||
TransactionEventsError::CannotDecodeEventInBlock { error, .. }
|
||||
| TransactionEventsError::CannotFetchEventsForTransaction { error, .. } => error.backend_error(),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -658,10 +664,10 @@ pub enum StorageError {
|
||||
impl StorageError {
|
||||
fn backend_error(&self) -> Option<&BackendError> {
|
||||
match self {
|
||||
StorageError::CannotGetLatestFinalizedBlock(e) |
|
||||
StorageError::CannotFetchValue(e) |
|
||||
StorageError::CannotIterateValues(e) |
|
||||
StorageError::StreamFailure(e) => Some(e),
|
||||
StorageError::CannotGetLatestFinalizedBlock(e)
|
||||
| StorageError::CannotFetchValue(e)
|
||||
| StorageError::CannotIterateValues(e)
|
||||
| StorageError::StreamFailure(e) => Some(e),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
Metadata,
|
||||
config::{Config, HashFor},
|
||||
error::EventsError,
|
||||
Metadata,
|
||||
};
|
||||
use derive_where::derive_where;
|
||||
use pezkuwi_subxt_core::events::{EventDetails as CoreEventDetails, Events as CoreEvents};
|
||||
|
||||
+1
-1
@@ -11,8 +11,8 @@ mod events_type;
|
||||
|
||||
use crate::{client::OnlineClientT, error::EventsError};
|
||||
use pezkuwi_subxt_core::{
|
||||
Metadata,
|
||||
config::{Config, HashFor},
|
||||
Metadata,
|
||||
};
|
||||
|
||||
pub use events_client::EventsClient;
|
||||
|
||||
+6
-6
@@ -8,7 +8,7 @@
|
||||
//! ```rust,ignore
|
||||
#![doc = include_str!("../examples/tx_basic.rs")]
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! Take a look at [the Subxt guide](book) to learn more about how to use Subxt.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
@@ -60,10 +60,10 @@ pub mod view_functions;
|
||||
pub mod config {
|
||||
pub use pezkuwi_subxt_core::{
|
||||
config::{
|
||||
Config, DefaultExtrinsicParams, DefaultExtrinsicParamsBuilder, ExtrinsicParams,
|
||||
ExtrinsicParamsEncoder, Hash, HashFor, Hasher, Header, PezkuwiConfig,
|
||||
PezkuwiExtrinsicParams, BizinikiwConfig, BizinikiwiExtrinsicParams,
|
||||
TransactionExtension, pezkuwi, bizinikiwi, transaction_extensions,
|
||||
bizinikiwi, pezkuwi, transaction_extensions, BizinikiwConfig,
|
||||
BizinikiwiExtrinsicParams, Config, DefaultExtrinsicParams,
|
||||
DefaultExtrinsicParamsBuilder, ExtrinsicParams, ExtrinsicParamsEncoder, Hash, HashFor,
|
||||
Hasher, Header, PezkuwiConfig, PezkuwiExtrinsicParams, TransactionExtension,
|
||||
},
|
||||
error::ExtrinsicParamsError,
|
||||
};
|
||||
@@ -88,7 +88,7 @@ cfg_unstable_light_client! {
|
||||
// but leave most types behind their respective modules.
|
||||
pub use crate::{
|
||||
client::{OfflineClient, OnlineClient},
|
||||
config::{Config, PezkuwiConfig, BizinikiwConfig},
|
||||
config::{BizinikiwConfig, Config, PezkuwiConfig},
|
||||
error::Error,
|
||||
metadata::Metadata,
|
||||
};
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ mod runtime_client;
|
||||
mod runtime_types;
|
||||
|
||||
pub use pezkuwi_subxt_core::runtime_api::payload::{
|
||||
DynamicPayload, Payload, StaticPayload, dynamic,
|
||||
dynamic, DynamicPayload, Payload, StaticPayload,
|
||||
};
|
||||
pub use runtime_client::RuntimeApiClient;
|
||||
pub use runtime_types::RuntimeApi;
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@
|
||||
mod storage_client;
|
||||
mod storage_client_at;
|
||||
|
||||
pub use pezkuwi_subxt_core::storage::address::{Address, DynamicAddress, StaticAddress, dynamic};
|
||||
pub use pezkuwi_subxt_core::storage::address::{dynamic, Address, DynamicAddress, StaticAddress};
|
||||
pub use storage_client::StorageClient;
|
||||
pub use storage_client_at::{StorageClientAt, StorageEntryClient, StorageKeyValue, StorageValue};
|
||||
|
||||
@@ -11,9 +11,9 @@ use crate::{
|
||||
use derive_where::derive_where;
|
||||
use futures::StreamExt;
|
||||
use pezkuwi_subxt_core::{
|
||||
Metadata,
|
||||
storage::{PrefixOf, address::Address},
|
||||
storage::{address::Address, PrefixOf},
|
||||
utils::{Maybe, Yes},
|
||||
Metadata,
|
||||
};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
@@ -100,7 +100,7 @@ where
|
||||
key_parts: KeyParts,
|
||||
) -> Result<
|
||||
impl futures::Stream<Item = Result<StorageKeyValue<'_, Addr>, StorageError>>
|
||||
+ use<'_, Addr, Client, T, KeyParts>,
|
||||
+ use<'_, Addr, Client, T, KeyParts>,
|
||||
StorageError,
|
||||
> {
|
||||
let entry = pezkuwi_subxt_core::storage::entry(addr, &self.metadata)?;
|
||||
@@ -283,7 +283,7 @@ where
|
||||
key_parts: KeyParts,
|
||||
) -> Result<
|
||||
impl futures::Stream<Item = Result<StorageKeyValue<'atblock, Addr>, StorageError>>
|
||||
+ use<'atblock, Addr, Client, T, KeyParts>,
|
||||
+ use<'atblock, Addr, Client, T, KeyParts>,
|
||||
StorageError,
|
||||
> {
|
||||
iter(self.inner.clone(), &self.client, self.block_ref.hash(), key_parts).await
|
||||
@@ -357,7 +357,7 @@ async fn iter<
|
||||
key_parts: KeyParts,
|
||||
) -> Result<
|
||||
impl futures::Stream<Item = Result<StorageKeyValue<'atblock, Addr>, StorageError>>
|
||||
+ use<'atblock, Addr, Client, T, KeyParts>,
|
||||
+ use<'atblock, Addr, Client, T, KeyParts>,
|
||||
StorageError,
|
||||
> {
|
||||
let key_bytes = entry.iter_key(key_parts)?;
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ mod tx_client;
|
||||
mod tx_progress;
|
||||
|
||||
pub use pezkuwi_subxt_core::tx::{
|
||||
payload::{DefaultPayload, DynamicPayload, Payload, dynamic},
|
||||
payload::{dynamic, DefaultPayload, DynamicPayload, Payload},
|
||||
signer::{self, Signer},
|
||||
};
|
||||
pub use tx_client::{
|
||||
|
||||
+24
-18
@@ -12,7 +12,7 @@ use crate::{
|
||||
};
|
||||
use codec::{Compact, Decode, Encode};
|
||||
use derive_where::derive_where;
|
||||
use futures::future::{TryFutureExt, try_join};
|
||||
use futures::future::{try_join, TryFutureExt};
|
||||
use pezkuwi_subxt_core::tx::TransactionVersion;
|
||||
|
||||
/// A client for working with transactions.
|
||||
@@ -122,18 +122,20 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
|
||||
{
|
||||
let metadata = self.client.metadata();
|
||||
let tx = match pezkuwi_subxt_core::tx::suggested_version(&metadata)? {
|
||||
TransactionVersion::V4 =>
|
||||
TransactionVersion::V4 => {
|
||||
PartialTransactionInner::V4(pezkuwi_subxt_core::tx::create_v4_signed(
|
||||
call,
|
||||
&self.client.client_state(),
|
||||
params,
|
||||
)?),
|
||||
TransactionVersion::V5 =>
|
||||
)?)
|
||||
},
|
||||
TransactionVersion::V5 => {
|
||||
PartialTransactionInner::V5(pezkuwi_subxt_core::tx::create_v5_general(
|
||||
call,
|
||||
&self.client.client_state(),
|
||||
params,
|
||||
)?),
|
||||
)?)
|
||||
},
|
||||
};
|
||||
|
||||
Ok(PartialTransaction { client: self.client.clone(), inner: tx })
|
||||
@@ -419,10 +421,12 @@ where
|
||||
signature: &T::Signature,
|
||||
) -> SubmittableTransaction<T, C> {
|
||||
let tx = match &mut self.inner {
|
||||
PartialTransactionInner::V4(tx) =>
|
||||
tx.sign_with_account_and_signature(account_id.clone(), signature),
|
||||
PartialTransactionInner::V5(tx) =>
|
||||
tx.sign_with_account_and_signature(account_id, signature),
|
||||
PartialTransactionInner::V4(tx) => {
|
||||
tx.sign_with_account_and_signature(account_id.clone(), signature)
|
||||
},
|
||||
PartialTransactionInner::V5(tx) => {
|
||||
tx.sign_with_account_and_signature(account_id, signature)
|
||||
},
|
||||
};
|
||||
|
||||
SubmittableTransaction { client: self.client.clone(), inner: tx }
|
||||
@@ -509,22 +513,24 @@ where
|
||||
// If we get a bad status or error back straight away then error, else return the hash.
|
||||
match sub.next().await {
|
||||
Some(Ok(status)) => match status {
|
||||
TransactionStatus::Validated |
|
||||
TransactionStatus::Broadcasted |
|
||||
TransactionStatus::InBestBlock { .. } |
|
||||
TransactionStatus::NoLongerInBestBlock |
|
||||
TransactionStatus::InFinalizedBlock { .. } => Ok(ext_hash),
|
||||
TransactionStatus::Validated
|
||||
| TransactionStatus::Broadcasted
|
||||
| TransactionStatus::InBestBlock { .. }
|
||||
| TransactionStatus::NoLongerInBestBlock
|
||||
| TransactionStatus::InFinalizedBlock { .. } => Ok(ext_hash),
|
||||
TransactionStatus::Error { message } => Err(
|
||||
ExtrinsicError::TransactionStatusError(TransactionStatusError::Error(message)),
|
||||
),
|
||||
TransactionStatus::Invalid { message } =>
|
||||
TransactionStatus::Invalid { message } => {
|
||||
Err(ExtrinsicError::TransactionStatusError(TransactionStatusError::Invalid(
|
||||
message,
|
||||
))),
|
||||
TransactionStatus::Dropped { message } =>
|
||||
)))
|
||||
},
|
||||
TransactionStatus::Dropped { message } => {
|
||||
Err(ExtrinsicError::TransactionStatusError(TransactionStatusError::Dropped(
|
||||
message,
|
||||
))),
|
||||
)))
|
||||
},
|
||||
},
|
||||
Some(Err(e)) => Err(ExtrinsicError::TransactionStatusStreamError(e)),
|
||||
None => Err(ExtrinsicError::UnexpectedEndOfTransactionStatusStream),
|
||||
|
||||
+1
-1
@@ -347,11 +347,11 @@ mod test {
|
||||
use pezkuwi_subxt_core::client::RuntimeVersion;
|
||||
|
||||
use crate::{
|
||||
BizinikiwConfig,
|
||||
backend::{StreamOfResults, TransactionStatus},
|
||||
client::{OfflineClientT, OnlineClientT},
|
||||
config::{Config, HashFor},
|
||||
tx::TxProgress,
|
||||
BizinikiwConfig,
|
||||
};
|
||||
|
||||
type MockTxProgress = TxProgress<BizinikiwConfig, MockClient>;
|
||||
|
||||
+3
-3
@@ -5,9 +5,9 @@
|
||||
//! Miscellaneous utility helpers.
|
||||
|
||||
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,
|
||||
bits, strip_compact_prefix, to_hex, AccountId32, Encoded, Era, KeyedVec, MultiAddress,
|
||||
MultiSignature, PhantomDataSendSync, Static, UncheckedExtrinsic, WrapperKeepOpaque, Yes, H160,
|
||||
H256, H512,
|
||||
};
|
||||
|
||||
pub use pezkuwi_subxt_rpcs::utils::url_is_secure;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ mod view_function_types;
|
||||
mod view_functions_client;
|
||||
|
||||
pub use pezkuwi_subxt_core::view_functions::payload::{
|
||||
DynamicPayload, Payload, StaticPayload, dynamic,
|
||||
dynamic, DynamicPayload, Payload, StaticPayload,
|
||||
};
|
||||
pub use view_function_types::ViewFunctionsApi;
|
||||
pub use view_functions_client::ViewFunctionsClient;
|
||||
|
||||
Reference in New Issue
Block a user