fix: resolve cargo-clippy CI errors in vendor crates
- Fix rebrand issues in pezkuwi-subxt signer (sp_core -> pezsp_core, sp_keyring -> pezsp_keyring, sp_runtime -> pezsp_runtime) - Fix pezkuwi-zombienet-sdk tests (subxt::PolkadotConfig -> pezkuwi_subxt::PezkuwiConfig) - Correct artifact paths in subxt examples (polkadot_metadata_*.scale) - Fix type conversion issues in subxt examples (explicit constructors instead of .into() for generated types) - Add pezkuwi-subxt-utils-stripmetadata dev-dependency to metadata crate - Use original polkadot module from external frame-decode crate - Fix Display trait usage for generated AccountId32 types
This commit is contained in:
Generated
+1
@@ -14553,6 +14553,7 @@ dependencies = [
|
|||||||
"hashbrown 0.15.5",
|
"hashbrown 0.15.5",
|
||||||
"parity-scale-codec",
|
"parity-scale-codec",
|
||||||
"pezkuwi-subxt-codegen",
|
"pezkuwi-subxt-codegen",
|
||||||
|
"pezkuwi-subxt-utils-stripmetadata",
|
||||||
"pezsp-crypto-hashing",
|
"pezsp-crypto-hashing",
|
||||||
"scale-info",
|
"scale-info",
|
||||||
"scale-info-legacy",
|
"scale-info-legacy",
|
||||||
|
|||||||
+2
-2
@@ -173,11 +173,11 @@ std = [
|
|||||||
"pezpallet-verify-signature?/std",
|
"pezpallet-verify-signature?/std",
|
||||||
"pezpallet-vesting?/std",
|
"pezpallet-vesting?/std",
|
||||||
"pezpallet-whitelist?/std",
|
"pezpallet-whitelist?/std",
|
||||||
|
"pezpallet-xcm-benchmarks?/std",
|
||||||
"pezpallet-xcm-bridge-hub-router?/std",
|
"pezpallet-xcm-bridge-hub-router?/std",
|
||||||
"pezpallet-xcm-bridge-hub?/std",
|
"pezpallet-xcm-bridge-hub?/std",
|
||||||
"pezpallet-xcm-precompiles?/std",
|
"pezpallet-xcm-precompiles?/std",
|
||||||
"pezpallet-xcm?/std",
|
"pezpallet-xcm?/std",
|
||||||
"pezpallet-xcm-benchmarks?/std",
|
|
||||||
"pezsc-executor?/std",
|
"pezsc-executor?/std",
|
||||||
"pezsp-api-proc-macro?/std",
|
"pezsp-api-proc-macro?/std",
|
||||||
"pezsp-api?/std",
|
"pezsp-api?/std",
|
||||||
@@ -465,11 +465,11 @@ runtime-benchmarks = [
|
|||||||
"pezpallet-verify-signature?/runtime-benchmarks",
|
"pezpallet-verify-signature?/runtime-benchmarks",
|
||||||
"pezpallet-vesting?/runtime-benchmarks",
|
"pezpallet-vesting?/runtime-benchmarks",
|
||||||
"pezpallet-whitelist?/runtime-benchmarks",
|
"pezpallet-whitelist?/runtime-benchmarks",
|
||||||
|
"pezpallet-xcm-benchmarks?/runtime-benchmarks",
|
||||||
"pezpallet-xcm-bridge-hub-router?/runtime-benchmarks",
|
"pezpallet-xcm-bridge-hub-router?/runtime-benchmarks",
|
||||||
"pezpallet-xcm-bridge-hub?/runtime-benchmarks",
|
"pezpallet-xcm-bridge-hub?/runtime-benchmarks",
|
||||||
"pezpallet-xcm-precompiles?/runtime-benchmarks",
|
"pezpallet-xcm-precompiles?/runtime-benchmarks",
|
||||||
"pezpallet-xcm?/runtime-benchmarks",
|
"pezpallet-xcm?/runtime-benchmarks",
|
||||||
"pezpallet-xcm-benchmarks?/runtime-benchmarks",
|
|
||||||
"pezsc-authority-discovery?/runtime-benchmarks",
|
"pezsc-authority-discovery?/runtime-benchmarks",
|
||||||
"pezsc-basic-authorship?/runtime-benchmarks",
|
"pezsc-basic-authorship?/runtime-benchmarks",
|
||||||
"pezsc-block-builder?/runtime-benchmarks",
|
"pezsc-block-builder?/runtime-benchmarks",
|
||||||
|
|||||||
+1
-1
@@ -222,7 +222,7 @@ mod tests {
|
|||||||
use scale_value::Composite;
|
use scale_value::Composite;
|
||||||
|
|
||||||
fn test_metadata() -> Metadata {
|
fn test_metadata() -> Metadata {
|
||||||
let metadata_bytes = include_bytes!("../../../artifacts/pezkuwi_metadata_small.scale");
|
let metadata_bytes = include_bytes!("../../../artifacts/polkadot_metadata_small.scale");
|
||||||
Metadata::decode(&mut &metadata_bytes[..]).expect("Valid metadata")
|
Metadata::decode(&mut &metadata_bytes[..]).expect("Valid metadata")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -162,8 +162,8 @@ impl core::str::FromStr for AccountId32 {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
use sp_core::{self, crypto::Ss58Codec};
|
use pezsp_core::{self, crypto::Ss58Codec};
|
||||||
use sp_keyring::sr25519::Keyring;
|
use pezsp_keyring::sr25519::Keyring;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ss58_is_compatible_with_bizinikiwi_impl() {
|
fn ss58_is_compatible_with_bizinikiwi_impl() {
|
||||||
@@ -179,7 +179,7 @@ mod test {
|
|||||||
|
|
||||||
// Both should decode from ss58 back to the same:
|
// Both should decode from ss58 back to the same:
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
sp_core::crypto::AccountId32::from_ss58check(&bizinikiwi_ss58).unwrap(),
|
pezsp_core::crypto::AccountId32::from_ss58check(&bizinikiwi_ss58).unwrap(),
|
||||||
bizinikiwi_account
|
bizinikiwi_account
|
||||||
);
|
);
|
||||||
assert_eq!(AccountId32::from_ss58check(&bizinikiwi_ss58).unwrap(), local_account);
|
assert_eq!(AccountId32::from_ss58check(&bizinikiwi_ss58).unwrap(), local_account);
|
||||||
|
|||||||
+1
@@ -50,6 +50,7 @@ bitvec = { workspace = true, features = ["alloc"] }
|
|||||||
criterion = { workspace = true }
|
criterion = { workspace = true }
|
||||||
frame-decode = { workspace = true, features = ["legacy-types"] }
|
frame-decode = { workspace = true, features = ["legacy-types"] }
|
||||||
pezkuwi-subxt-codegen = { workspace = true }
|
pezkuwi-subxt-codegen = { workspace = true }
|
||||||
|
pezkuwi-subxt-utils-stripmetadata = { workspace = true }
|
||||||
scale-info = { workspace = true, features = ["bit-vec"] }
|
scale-info = { workspace = true, features = ["bit-vec"] }
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ use pezkuwi_subxt_metadata::Metadata;
|
|||||||
use std::{fs, path::Path};
|
use std::{fs, path::Path};
|
||||||
|
|
||||||
fn load_metadata() -> Metadata {
|
fn load_metadata() -> Metadata {
|
||||||
let bytes = fs::read(Path::new("../artifacts/pezkuwi_metadata_full.scale"))
|
let bytes = fs::read(Path::new("../artifacts/polkadot_metadata_full.scale"))
|
||||||
.expect("Cannot read metadata blob");
|
.expect("Cannot read metadata blob");
|
||||||
let meta: RuntimeMetadataPrefixed =
|
let meta: RuntimeMetadataPrefixed =
|
||||||
Decode::decode(&mut &*bytes).expect("Cannot decode scale metadata");
|
Decode::decode(&mut &*bytes).expect("Cannot decode scale metadata");
|
||||||
|
|||||||
+2
-1
@@ -35,7 +35,8 @@ fn legacy_kusama_metadata(version: u8) -> (u64, RuntimeMetadata) {
|
|||||||
/// Load our kusama types.
|
/// Load our kusama types.
|
||||||
/// TODO: This is WRONG at the moment; change to point to kusama types when they exist:
|
/// TODO: This is WRONG at the moment; change to point to kusama types when they exist:
|
||||||
fn kusama_types() -> scale_info_legacy::ChainTypeRegistry {
|
fn kusama_types() -> scale_info_legacy::ChainTypeRegistry {
|
||||||
frame_decode::legacy_types::pezkuwi::relay_chain()
|
// frame-decode is an external crate (v0.15.0) that uses original naming
|
||||||
|
frame_decode::legacy_types::polkadot::relay_chain()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sanitizing paths changes things between old and new, so disable this in tests by default
|
/// Sanitizing paths changes things between old and new, so disable this in tests by default
|
||||||
|
|||||||
+2
-2
@@ -352,7 +352,7 @@ mod test {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
use sp_core::{self, crypto::Pair as _, ecdsa::Pair as SpPair};
|
use pezsp_core::{self, crypto::Pair as _, ecdsa::Pair as SpPair};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn check_from_phrase_matches() {
|
fn check_from_phrase_matches() {
|
||||||
@@ -413,7 +413,7 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn check_signing_and_verifying_matches() {
|
fn check_signing_and_verifying_matches() {
|
||||||
use sp_core::ecdsa::Signature as SpSignature;
|
use pezsp_core::ecdsa::Signature as SpSignature;
|
||||||
|
|
||||||
for _ in 0..20 {
|
for _ in 0..20 {
|
||||||
let (sp_pair, phrase, _seed) = SpPair::generate_with_phrase(Some("Testing"));
|
let (sp_pair, phrase, _seed) = SpPair::generate_with_phrase(Some("Testing"));
|
||||||
|
|||||||
+3
-3
@@ -341,7 +341,7 @@ mod test {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
use sp_core::{self, crypto::Pair as _, sr25519::Pair as SpPair};
|
use pezsp_core::{self, crypto::Pair as _, sr25519::Pair as SpPair};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn check_from_phrase_matches() {
|
fn check_from_phrase_matches() {
|
||||||
@@ -399,7 +399,7 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn check_dev_accounts_match() {
|
fn check_dev_accounts_match() {
|
||||||
use sp_keyring::sr25519::Keyring::*;
|
use pezsp_keyring::sr25519::Keyring::*;
|
||||||
|
|
||||||
assert_eq!(dev::alice().public_key().0, Alice.public().0);
|
assert_eq!(dev::alice().public_key().0, Alice.public().0);
|
||||||
assert_eq!(dev::bob().public_key().0, Bob.public().0);
|
assert_eq!(dev::bob().public_key().0, Bob.public().0);
|
||||||
@@ -413,7 +413,7 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn check_signing_and_verifying_matches() {
|
fn check_signing_and_verifying_matches() {
|
||||||
use sp_core::sr25519::Signature as SpSignature;
|
use pezsp_core::sr25519::Signature as SpSignature;
|
||||||
|
|
||||||
for _ in 0..20 {
|
for _ in 0..20 {
|
||||||
let (sp_pair, phrase, _seed) = SpPair::generate_with_phrase(Some("Testing"));
|
let (sp_pair, phrase, _seed) = SpPair::generate_with_phrase(Some("Testing"));
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
#![allow(missing_docs, unused)]
|
#![allow(missing_docs, unused)]
|
||||||
|
|
||||||
use pezkuwi_subxt::{config::bizinikiwi::MultiAddress, Config, OnlineClient, PezkuwiConfig};
|
use pezkuwi_subxt::{Config, OnlineClient, PezkuwiConfig};
|
||||||
use sp_core::{sr25519, Pair as _};
|
use pezsp_core::{sr25519, Pair as _};
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
/// A concrete PairSigner implementation which relies on `sr25519::Pair` for signing
|
/// A concrete PairSigner implementation which relies on `sr25519::Pair` for signing
|
||||||
@@ -20,7 +20,7 @@ mod pair_signer {
|
|||||||
config::bizinikiwi::{AccountId32, MultiSignature},
|
config::bizinikiwi::{AccountId32, MultiSignature},
|
||||||
tx::Signer,
|
tx::Signer,
|
||||||
};
|
};
|
||||||
use sp_runtime::{
|
use pezsp_runtime::{
|
||||||
traits::{IdentifyAccount, Verify},
|
traits::{IdentifyAccount, Verify},
|
||||||
MultiSignature as SpMultiSignature,
|
MultiSignature as SpMultiSignature,
|
||||||
};
|
};
|
||||||
@@ -90,7 +90,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
let dest = {
|
let dest = {
|
||||||
let acc = sr25519::Pair::from_string("//Bob", None)?;
|
let acc = sr25519::Pair::from_string("//Bob", None)?;
|
||||||
MultiAddress::Address32(acc.public().0)
|
pezkuwi::runtime_types::sp_runtime::multiaddress::MultiAddress::Address32(acc.public().0)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Build a balance transfer extrinsic.
|
// Build a balance transfer extrinsic.
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
use pezkuwi_subxt::{
|
use pezkuwi_subxt::{
|
||||||
utils::{AccountId32, MultiAddress},
|
utils::{AccountId32 as UtilAccountId32, MultiAddress as UtilMultiAddress},
|
||||||
OnlineClient, PezkuwiConfig,
|
OnlineClient, PezkuwiConfig,
|
||||||
};
|
};
|
||||||
|
|
||||||
use codec::Decode;
|
use codec::Decode;
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
use pezkuwi::balances::calls::types::TransferKeepAlive;
|
use pezkuwi::balances::calls::types::TransferKeepAlive;
|
||||||
|
use pezkuwi::runtime_types::sp_runtime::multiaddress::MultiAddress;
|
||||||
|
use pezkuwi::runtime_types::sp_core::crypto::AccountId32;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
@@ -37,9 +39,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
let addr_bytes =
|
let addr_bytes =
|
||||||
transfer.details.address_bytes().expect("TransferKeepAlive should be signed");
|
transfer.details.address_bytes().expect("TransferKeepAlive should be signed");
|
||||||
let sender = MultiAddress::<AccountId32, ()>::decode(&mut &addr_bytes[..])
|
// Use utility types for decoding as they implement the Decode trait
|
||||||
|
let sender = UtilMultiAddress::<UtilAccountId32, ()>::decode(&mut &addr_bytes[..])
|
||||||
.expect("Decoding should work");
|
.expect("Decoding should work");
|
||||||
let sender = display_address(&sender);
|
let sender = display_util_address(&sender);
|
||||||
let receiver = display_address(&transfer.value.dest);
|
let receiver = display_address(&transfer.value.dest);
|
||||||
let value = transfer.value.value;
|
let value = transfer.value.value;
|
||||||
let tip = extensions.tip().expect("Should have tip");
|
let tip = extensions.tip().expect("Should have tip");
|
||||||
@@ -56,6 +59,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
fn display_address(addr: &MultiAddress<AccountId32, ()>) -> String {
|
fn display_address(addr: &MultiAddress<AccountId32, ()>) -> String {
|
||||||
if let MultiAddress::Id(id32) = addr {
|
if let MultiAddress::Id(id32) = addr {
|
||||||
|
format!("{id32:?}")
|
||||||
|
} else {
|
||||||
|
"MultiAddress::...".into()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn display_util_address(addr: &UtilMultiAddress<UtilAccountId32, ()>) -> String {
|
||||||
|
if let UtilMultiAddress::Id(id32) = addr {
|
||||||
format!("{id32}")
|
format!("{id32}")
|
||||||
} else {
|
} else {
|
||||||
"MultiAddress::...".into()
|
"MultiAddress::...".into()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ use futures::StreamExt;
|
|||||||
use pezkuwi_subxt::{client::OnlineClient, lightclient::LightClient, PezkuwiConfig};
|
use pezkuwi_subxt::{client::OnlineClient, lightclient::LightClient, PezkuwiConfig};
|
||||||
|
|
||||||
// Generate an interface that we can use from the node's metadata.
|
// Generate an interface that we can use from the node's metadata.
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
const POLKADOT_SPEC: &str = include_str!("../../artifacts/demo_chain_specs/pezkuwi.json");
|
const POLKADOT_SPEC: &str = include_str!("../../artifacts/demo_chain_specs/polkadot.json");
|
||||||
const ASSET_HUB_SPEC: &str =
|
const ASSET_HUB_SPEC: &str =
|
||||||
include_str!("../../artifacts/demo_chain_specs/pezkuwi_asset_hub.json");
|
include_str!("../../artifacts/demo_chain_specs/polkadot_asset_hub.json");
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use pezkuwi_subxt::{
|
|||||||
use pezkuwi_subxt_signer::sr25519::dev;
|
use pezkuwi_subxt_signer::sr25519::dev;
|
||||||
|
|
||||||
// Generate an interface that we can use from the node's metadata.
|
// Generate an interface that we can use from the node's metadata.
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -35,7 +35,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let api = OnlineClient::<PezkuwiConfig>::from_rpc_client(chain_rpc).await?;
|
let api = OnlineClient::<PezkuwiConfig>::from_rpc_client(chain_rpc).await?;
|
||||||
|
|
||||||
// Build a balance transfer extrinsic.
|
// Build a balance transfer extrinsic.
|
||||||
let dest = dev::bob().public_key().into();
|
let dest = pezkuwi::runtime_types::sp_runtime::multiaddress::MultiAddress::Id(
|
||||||
|
pezkuwi::runtime_types::sp_core::crypto::AccountId32(dev::bob().public_key().0),
|
||||||
|
);
|
||||||
let balance_transfer_tx = pezkuwi::tx().balances().transfer_allow_death(dest, 10_000);
|
let balance_transfer_tx = pezkuwi::tx().balances().transfer_allow_death(dest, 10_000);
|
||||||
|
|
||||||
// Submit the balance transfer extrinsic from Alice, and wait for it to be successful
|
// Submit the balance transfer extrinsic from Alice, and wait for it to be successful
|
||||||
|
|||||||
+7
-3
@@ -6,7 +6,7 @@ use pezkuwi_subxt::{
|
|||||||
};
|
};
|
||||||
use pezkuwi_subxt_signer::sr25519::dev;
|
use pezkuwi_subxt_signer::sr25519::dev;
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -37,13 +37,17 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let bob = dev::bob();
|
let bob = dev::bob();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let current_nonce = rpc.system_account_next_index(&alice.public_key().into()).await?;
|
let alice_account_id = pezkuwi_subxt::config::bizinikiwi::AccountId32(alice.public_key().0);
|
||||||
|
let current_nonce = rpc.system_account_next_index(&alice_account_id).await?;
|
||||||
|
|
||||||
let ext_params = Params::new().mortal(8).nonce(current_nonce).build();
|
let ext_params = Params::new().mortal(8).nonce(current_nonce).build();
|
||||||
|
|
||||||
|
let dest = pezkuwi::runtime_types::sp_runtime::multiaddress::MultiAddress::Id(
|
||||||
|
pezkuwi::runtime_types::sp_core::crypto::AccountId32(bob.public_key().0),
|
||||||
|
);
|
||||||
let balance_transfer = pezkuwi::tx()
|
let balance_transfer = pezkuwi::tx()
|
||||||
.balances()
|
.balances()
|
||||||
.transfer_allow_death(bob.public_key().into(), 1_000_000);
|
.transfer_allow_death(dest, 1_000_000);
|
||||||
|
|
||||||
let ext_hash = api
|
let ext_hash = api
|
||||||
.tx()
|
.tx()
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
// `scale_value::Value` type as output, and a vec of those as inputs,
|
// `scale_value::Value` type as output, and a vec of those as inputs,
|
||||||
// but since we know the input + return types we can pass them directly.
|
// 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.
|
// There is one input argument, so the inputs are a tuple of one element.
|
||||||
let account: AccountId32 = dev::alice().public_key().into();
|
let account = AccountId32(dev::alice().public_key().0);
|
||||||
let runtime_api_call = pezkuwi_subxt::dynamic::runtime_api_call::<_, u64>(
|
let runtime_api_call = pezkuwi_subxt::dynamic::runtime_api_call::<_, u64>(
|
||||||
"AccountNonceApi",
|
"AccountNonceApi",
|
||||||
"account_nonce",
|
"account_nonce",
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ use pezkuwi_subxt::{
|
|||||||
OnlineClient, PezkuwiConfig,
|
OnlineClient, PezkuwiConfig,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
use pezkuwi_subxt::{config::PezkuwiConfig, OnlineClient};
|
use pezkuwi_subxt::{config::PezkuwiConfig, OnlineClient};
|
||||||
use pezkuwi_subxt_signer::sr25519::dev;
|
use pezkuwi_subxt_signer::sr25519::dev;
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -12,7 +12,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
// Create a runtime API payload that calls into
|
// Create a runtime API payload that calls into
|
||||||
// `AccountNonceApi_account_nonce` function.
|
// `AccountNonceApi_account_nonce` function.
|
||||||
let account = dev::alice().public_key().into();
|
let account = pezkuwi::runtime_types::sp_core::crypto::AccountId32(dev::alice().public_key().0);
|
||||||
let runtime_api_call = pezkuwi::apis().account_nonce_api().account_nonce(account);
|
let runtime_api_call = pezkuwi::apis().account_nonce_api().account_nonce(account);
|
||||||
|
|
||||||
// Submit the call and get back a result.
|
// Submit the call and get back a result.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
// 3. Metadata (I'll load it from the downloaded metadata, but you can use `subxt metadata >
|
// 3. Metadata (I'll load it from the downloaded metadata, but you can use `subxt metadata >
|
||||||
// file.scale` to download it):
|
// file.scale` to download it):
|
||||||
let metadata = {
|
let metadata = {
|
||||||
let bytes = std::fs::read("./artifacts/pezkuwi_metadata_small.scale").unwrap();
|
let bytes = std::fs::read("./artifacts/polkadot_metadata_small.scale").unwrap();
|
||||||
Metadata::decode(&mut &*bytes).unwrap()
|
Metadata::decode(&mut &*bytes).unwrap()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use pezkuwi_subxt::config::{
|
|||||||
use pezkuwi_subxt_signer::sr25519::dev;
|
use pezkuwi_subxt_signer::sr25519::dev;
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(
|
#[pezkuwi_subxt::subxt(
|
||||||
runtime_metadata_path = "../artifacts/pezkuwi_metadata_full.scale",
|
runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale",
|
||||||
derive_for_type(
|
derive_for_type(
|
||||||
path = "staging_xcm::v3::multilocation::MultiLocation",
|
path = "staging_xcm::v3::multilocation::MultiLocation",
|
||||||
derive = "Clone, codec::Encode",
|
derive = "Clone, codec::Encode",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use pezkuwi_subxt::{
|
|||||||
};
|
};
|
||||||
use pezkuwi_subxt_signer::sr25519::dev;
|
use pezkuwi_subxt_signer::sr25519::dev;
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_full.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_full.scale")]
|
||||||
pub mod runtime {}
|
pub mod runtime {}
|
||||||
|
|
||||||
// We don't need to construct this at runtime,
|
// We don't need to construct this at runtime,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use pezkuwi_subxt_signer::sr25519::dev;
|
|||||||
use scale_encode::EncodeAsType;
|
use scale_encode::EncodeAsType;
|
||||||
use scale_info::PortableRegistry;
|
use scale_info::PortableRegistry;
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod runtime {}
|
pub mod runtime {}
|
||||||
|
|
||||||
// We don't need to construct this at runtime,
|
// We don't need to construct this at runtime,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use pezkuwi_subxt::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Generate an interface that we can use from the node's metadata.
|
// Generate an interface that we can use from the node's metadata.
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use pezkuwi_subxt::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Generate an interface that we can use from the node's metadata.
|
// Generate an interface that we can use from the node's metadata.
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
|||||||
+2
-2
@@ -3,14 +3,14 @@ use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
|||||||
use pezkuwi_subxt_signer::sr25519::dev;
|
use pezkuwi_subxt_signer::sr25519::dev;
|
||||||
|
|
||||||
// Generate an interface that we can use from the node's metadata.
|
// Generate an interface that we can use from the node's metadata.
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
// Create a new API client, configured to talk to Pezkuwi nodes.
|
// Create a new API client, configured to talk to Pezkuwi nodes.
|
||||||
let api = OnlineClient::<PezkuwiConfig>::new().await?;
|
let api = OnlineClient::<PezkuwiConfig>::new().await?;
|
||||||
let account = dev::alice().public_key().into();
|
let account = pezkuwi::runtime_types::sp_core::crypto::AccountId32(dev::alice().public_key().0);
|
||||||
|
|
||||||
// Build a storage query to access account information.
|
// Build a storage query to access account information.
|
||||||
let storage_query = pezkuwi::storage().system().account();
|
let storage_query = pezkuwi::storage().system().account();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
// here, we assume that there is one value to provide at this entry
|
// 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
|
// 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.
|
// return type and so we set it to `Value`, which anything can decode into.
|
||||||
let account: AccountId32 = dev::alice().public_key().into();
|
let account = AccountId32(dev::alice().public_key().0);
|
||||||
let storage_query =
|
let storage_query =
|
||||||
pezkuwi_subxt::dynamic::storage::<(AccountId32,), Value>("System", "Account");
|
pezkuwi_subxt::dynamic::storage::<(AccountId32,), Value>("System", "Account");
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
use pezkuwi_subxt::{ext::futures::StreamExt, OnlineClient, PezkuwiConfig};
|
use pezkuwi_subxt::{ext::futures::StreamExt, OnlineClient, PezkuwiConfig};
|
||||||
|
|
||||||
// Generate an interface that we can use from the node's metadata.
|
// Generate an interface that we can use from the node's metadata.
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -34,7 +34,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let value = kv.value().decode()?;
|
let value = kv.value().decode()?;
|
||||||
|
|
||||||
let value_data = value.data;
|
let value_data = value.data;
|
||||||
println!("{account_id32}:\n {value_data:?}");
|
println!("{account_id32:?}:\n {value_data:?}");
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
+4
-2
@@ -3,7 +3,7 @@ use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
|||||||
use pezkuwi_subxt_signer::sr25519::dev;
|
use pezkuwi_subxt_signer::sr25519::dev;
|
||||||
|
|
||||||
// Generate an interface that we can use from the node's metadata.
|
// Generate an interface that we can use from the node's metadata.
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -12,7 +12,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let api = OnlineClient::<PezkuwiConfig>::new().await?;
|
let api = OnlineClient::<PezkuwiConfig>::new().await?;
|
||||||
|
|
||||||
// Build a balance transfer extrinsic.
|
// Build a balance transfer extrinsic.
|
||||||
let dest = dev::bob().public_key().into();
|
let dest = pezkuwi::runtime_types::sp_runtime::multiaddress::MultiAddress::Id(
|
||||||
|
pezkuwi::runtime_types::sp_core::crypto::AccountId32(dev::bob().public_key().0),
|
||||||
|
);
|
||||||
let balance_transfer_tx = pezkuwi::tx().balances().transfer_allow_death(dest, 10_000);
|
let balance_transfer_tx = pezkuwi::tx().balances().transfer_allow_death(dest, 10_000);
|
||||||
|
|
||||||
// Submit the balance transfer extrinsic from Alice, and wait for it to be successful
|
// Submit the balance transfer extrinsic from Alice, and wait for it to be successful
|
||||||
|
|||||||
+4
-2
@@ -2,7 +2,7 @@
|
|||||||
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
|
||||||
use pezkuwi_subxt_signer::sr25519::dev;
|
use pezkuwi_subxt_signer::sr25519::dev;
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -27,7 +27,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn balance_transfer() -> Box<dyn pezkuwi_subxt::tx::Payload> {
|
fn balance_transfer() -> Box<dyn pezkuwi_subxt::tx::Payload> {
|
||||||
let dest = dev::bob().public_key().into();
|
let dest = pezkuwi::runtime_types::sp_runtime::multiaddress::MultiAddress::Id(
|
||||||
|
pezkuwi::runtime_types::sp_core::crypto::AccountId32(dev::bob().public_key().0),
|
||||||
|
);
|
||||||
Box::new(pezkuwi::tx().balances().transfer_allow_death(dest, 10_000))
|
Box::new(pezkuwi::tx().balances().transfer_allow_death(dest, 10_000))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -4,7 +4,7 @@ use pezkuwi_subxt_signer::sr25519::dev;
|
|||||||
|
|
||||||
type BoxedError = Box<dyn std::error::Error + Send + Sync + 'static>;
|
type BoxedError = Box<dyn std::error::Error + Send + Sync + 'static>;
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -19,7 +19,9 @@ async fn signing_example() -> Result<(), BoxedError> {
|
|||||||
let api = OnlineClient::<PezkuwiConfig>::new().await?;
|
let api = OnlineClient::<PezkuwiConfig>::new().await?;
|
||||||
|
|
||||||
// Build a balance transfer extrinsic.
|
// Build a balance transfer extrinsic.
|
||||||
let dest = dev::bob().public_key().into();
|
let dest = pezkuwi::runtime_types::sp_runtime::multiaddress::MultiAddress::Id(
|
||||||
|
pezkuwi::runtime_types::sp_core::crypto::AccountId32(dev::bob().public_key().0),
|
||||||
|
);
|
||||||
let balance_transfer_tx = pezkuwi::tx().balances().transfer_allow_death(dest, 10_000);
|
let balance_transfer_tx = pezkuwi::tx().balances().transfer_allow_death(dest, 10_000);
|
||||||
|
|
||||||
let alice = dev::alice();
|
let alice = dev::alice();
|
||||||
|
|||||||
+4
-2
@@ -3,7 +3,7 @@ use pezkuwi_subxt::{tx::TxStatus, OnlineClient, PezkuwiConfig};
|
|||||||
use pezkuwi_subxt_signer::sr25519::dev;
|
use pezkuwi_subxt_signer::sr25519::dev;
|
||||||
|
|
||||||
// Generate an interface that we can use from the node's metadata.
|
// Generate an interface that we can use from the node's metadata.
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -12,7 +12,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let api = OnlineClient::<PezkuwiConfig>::new().await?;
|
let api = OnlineClient::<PezkuwiConfig>::new().await?;
|
||||||
|
|
||||||
// Build a balance transfer extrinsic.
|
// Build a balance transfer extrinsic.
|
||||||
let dest = dev::bob().public_key().into();
|
let dest = pezkuwi::runtime_types::sp_runtime::multiaddress::MultiAddress::Id(
|
||||||
|
pezkuwi::runtime_types::sp_core::crypto::AccountId32(dev::bob().public_key().0),
|
||||||
|
);
|
||||||
let balance_transfer_tx = pezkuwi::tx().balances().transfer_allow_death(dest, 10_000);
|
let balance_transfer_tx = pezkuwi::tx().balances().transfer_allow_death(dest, 10_000);
|
||||||
|
|
||||||
// Submit the balance transfer extrinsic from Alice, and then monitor the
|
// Submit the balance transfer extrinsic from Alice, and then monitor the
|
||||||
|
|||||||
+4
-2
@@ -4,7 +4,7 @@ use pezkuwi_subxt::{
|
|||||||
};
|
};
|
||||||
use pezkuwi_subxt_signer::sr25519::dev;
|
use pezkuwi_subxt_signer::sr25519::dev;
|
||||||
|
|
||||||
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
|
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata_small.scale")]
|
||||||
pub mod pezkuwi {}
|
pub mod pezkuwi {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -13,7 +13,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let api = OnlineClient::<PezkuwiConfig>::new().await?;
|
let api = OnlineClient::<PezkuwiConfig>::new().await?;
|
||||||
|
|
||||||
// Build a balance transfer extrinsic.
|
// Build a balance transfer extrinsic.
|
||||||
let dest = dev::bob().public_key().into();
|
let dest = pezkuwi::runtime_types::sp_runtime::multiaddress::MultiAddress::Id(
|
||||||
|
pezkuwi::runtime_types::sp_core::crypto::AccountId32(dev::bob().public_key().0),
|
||||||
|
);
|
||||||
let tx = pezkuwi::tx().balances().transfer_allow_death(dest, 10_000);
|
let tx = pezkuwi::tx().balances().transfer_allow_death(dest, 10_000);
|
||||||
|
|
||||||
// Configure the transaction parameters; we give a small tip and set the
|
// Configure the transaction parameters; we give a small tip and set the
|
||||||
|
|||||||
+1
-1
@@ -468,7 +468,7 @@ mod test {
|
|||||||
// Decode the storage key as first item from sequence of params:
|
// Decode the storage key as first item from sequence of params:
|
||||||
let params = params.map(|p| p.get().to_string());
|
let params = params.map(|p| p.get().to_string());
|
||||||
let rpc_params = jsonrpsee::types::Params::new(params.as_deref());
|
let rpc_params = jsonrpsee::types::Params::new(params.as_deref());
|
||||||
let key: sp_core::Bytes = rpc_params.sequence().next().unwrap();
|
let key: pezsp_core::Bytes = rpc_params.sequence().next().unwrap();
|
||||||
let key = std::str::from_utf8(&key.0).unwrap();
|
let key = std::str::from_utf8(&key.0).unwrap();
|
||||||
// Fetch the response to use from our map, popping it from the front.
|
// Fetch the response to use from our map, popping it from the front.
|
||||||
let values = values.get_mut(key).unwrap();
|
let values = values.get_mut(key).unwrap();
|
||||||
|
|||||||
+1
-1
@@ -864,7 +864,7 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn transaction_validity_decoding_is_ok() {
|
fn transaction_validity_decoding_is_ok() {
|
||||||
use sp_runtime::{
|
use pezsp_runtime::{
|
||||||
transaction_validity as sp, transaction_validity::TransactionValidity as T,
|
transaction_validity as sp, transaction_validity::TransactionValidity as T,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -40,7 +40,7 @@ async fn rococo_local_with_omni_node_and_wasm_runtime() {
|
|||||||
|
|
||||||
// omni-collator-1
|
// omni-collator-1
|
||||||
let collator = network.get_node("omni-collator-1").unwrap();
|
let collator = network.get_node("omni-collator-1").unwrap();
|
||||||
let client = collator.wait_client::<subxt::PolkadotConfig>().await.unwrap();
|
let client = collator.wait_client::<pezkuwi_subxt::PezkuwiConfig>().await.unwrap();
|
||||||
|
|
||||||
// wait 1 blocks
|
// wait 1 blocks
|
||||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||||
@@ -50,7 +50,7 @@ async fn rococo_local_with_omni_node_and_wasm_runtime() {
|
|||||||
|
|
||||||
// omni-collator-2
|
// omni-collator-2
|
||||||
let collator = network.get_node("omni-collator-2").unwrap();
|
let collator = network.get_node("omni-collator-2").unwrap();
|
||||||
let client = collator.wait_client::<subxt::PolkadotConfig>().await.unwrap();
|
let client = collator.wait_client::<pezkuwi_subxt::PezkuwiConfig>().await.unwrap();
|
||||||
|
|
||||||
// wait 1 blocks
|
// wait 1 blocks
|
||||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||||
|
|||||||
+2
-2
@@ -41,7 +41,7 @@ async fn polkadot_local_with_chain_spec_runtime() {
|
|||||||
|
|
||||||
// asset-hub-collator-1
|
// asset-hub-collator-1
|
||||||
let collator = network.get_node("asset-hub-collator-1").unwrap();
|
let collator = network.get_node("asset-hub-collator-1").unwrap();
|
||||||
let client = collator.wait_client::<subxt::PolkadotConfig>().await.unwrap();
|
let client = collator.wait_client::<pezkuwi_subxt::PezkuwiConfig>().await.unwrap();
|
||||||
|
|
||||||
// wait 1 blocks
|
// wait 1 blocks
|
||||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||||
@@ -51,7 +51,7 @@ async fn polkadot_local_with_chain_spec_runtime() {
|
|||||||
|
|
||||||
// asset-hub-collator-2
|
// asset-hub-collator-2
|
||||||
let collator = network.get_node("asset-hub-collator-2").unwrap();
|
let collator = network.get_node("asset-hub-collator-2").unwrap();
|
||||||
let client = collator.wait_client::<subxt::PolkadotConfig>().await.unwrap();
|
let client = collator.wait_client::<pezkuwi_subxt::PezkuwiConfig>().await.unwrap();
|
||||||
|
|
||||||
// wait 1 blocks
|
// wait 1 blocks
|
||||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||||
|
|||||||
+3
-3
@@ -62,7 +62,7 @@ async fn ci_k8s_basic_functionalities_should_works() {
|
|||||||
|
|
||||||
let (_best_block_pass, client) = try_join!(
|
let (_best_block_pass, client) = try_join!(
|
||||||
alice.wait_metric(BEST_BLOCK_METRIC, |x| x > 5_f64),
|
alice.wait_metric(BEST_BLOCK_METRIC, |x| x > 5_f64),
|
||||||
alice.wait_client::<subxt::PolkadotConfig>()
|
alice.wait_client::<pezkuwi_subxt::PezkuwiConfig>()
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ async fn ci_k8s_basic_functionalities_should_works() {
|
|||||||
|
|
||||||
// collator
|
// collator
|
||||||
let collator = network.get_node("collator").unwrap();
|
let collator = network.get_node("collator").unwrap();
|
||||||
let client = collator.wait_client::<subxt::PolkadotConfig>().await.unwrap();
|
let client = collator.wait_client::<pezkuwi_subxt::PezkuwiConfig>().await.unwrap();
|
||||||
|
|
||||||
// wait 3 blocks
|
// wait 3 blocks
|
||||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(3);
|
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(3);
|
||||||
@@ -143,7 +143,7 @@ async fn ci_k8s_basic_functionalities_should_works() {
|
|||||||
collator.pause().await.unwrap();
|
collator.pause().await.unwrap();
|
||||||
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
|
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
|
||||||
|
|
||||||
let r = collator.wait_client_with_timeout::<subxt::PolkadotConfig>(1_u32).await;
|
let r = collator.wait_client_with_timeout::<pezkuwi_subxt::PezkuwiConfig>(1_u32).await;
|
||||||
assert!(r.is_err());
|
assert!(r.is_err());
|
||||||
|
|
||||||
// tear down (optional if you don't detach the network)
|
// tear down (optional if you don't detach the network)
|
||||||
|
|||||||
Reference in New Issue
Block a user