Complete rebrand: Polkadot→Pezkuwi, Substrate→Bizinikiwi

- Replace PolkadotConfig with PezkuwiConfig
- Replace SubstrateConfig with BizinikiwConfig
- Rename config module files (polkadot.rs→pezkuwi.rs, substrate.rs→bizinikiwi.rs)
- Update all documentation and examples
- All 165 files updated, cargo check passes
This commit is contained in:
2025-12-21 21:42:34 +03:00
parent 99e4ee3ab8
commit 7af0bcd262
166 changed files with 2395 additions and 2395 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ license.workspace = true
repository.workspace = true
documentation.workspace = true
homepage.workspace = true
description = "Subxt integration tests that rely on the Substrate binary"
description = "Subxt integration tests that rely on the Bizinikiwi binary"
[features]
default = []
@@ -42,7 +42,7 @@ regex = { workspace = true }
scale-info = { workspace = true, features = ["bit-vec"] }
scale-value = { workspace = true }
serde = { workspace = true }
substrate-runner = { workspace = true }
bizinikiwi-runner = { workspace = true }
subxt-test-macro = { path = "subxt-test-macro" }
syn = { workspace = true }
test-runtime = { workspace = true }
@@ -12,7 +12,7 @@ use crate::utils::node_runtime;
#[cfg(fullclient)]
use pezkuwi_subxt::{
config::{
DefaultExtrinsicParamsBuilder, SubstrateConfig,
DefaultExtrinsicParamsBuilder, BizinikiwConfig,
transaction_extensions::{ChargeAssetTxPayment, CheckMortality, CheckNonce},
},
utils::Era,
@@ -268,9 +268,9 @@ async fn fetch_block_and_decode_extrinsic_details() {
/// A helper function to submit a transaction with some params and then get it back in a block,
/// so that we can test the decoding of it.
async fn submit_extrinsic_and_get_it_back(
api: &pezkuwi_subxt::OnlineClient<SubstrateConfig>,
params: pezkuwi_subxt::config::DefaultExtrinsicParamsBuilder<SubstrateConfig>,
) -> pezkuwi_subxt::blocks::ExtrinsicDetails<SubstrateConfig, pezkuwi_subxt::OnlineClient<SubstrateConfig>> {
api: &pezkuwi_subxt::OnlineClient<BizinikiwConfig>,
params: pezkuwi_subxt::config::DefaultExtrinsicParamsBuilder<BizinikiwConfig>,
) -> pezkuwi_subxt::blocks::ExtrinsicDetails<BizinikiwConfig, pezkuwi_subxt::OnlineClient<BizinikiwConfig>> {
let alice = dev::alice();
let bob = dev::bob();
@@ -313,7 +313,7 @@ async fn decode_transaction_extensions_from_blocks() {
let nonce1_static = extensions1.find::<CheckNonce>().unwrap().unwrap();
let tip1 = extensions1.tip().unwrap();
let tip1_static: u128 = extensions1
.find::<ChargeAssetTxPayment<SubstrateConfig>>()
.find::<ChargeAssetTxPayment<BizinikiwConfig>>()
.unwrap()
.unwrap()
.tip();
@@ -326,7 +326,7 @@ async fn decode_transaction_extensions_from_blocks() {
let nonce2_static = extensions2.find::<CheckNonce>().unwrap().unwrap();
let tip2 = extensions2.tip().unwrap();
let tip2_static: u128 = extensions2
.find::<ChargeAssetTxPayment<SubstrateConfig>>()
.find::<ChargeAssetTxPayment<BizinikiwConfig>>()
.unwrap()
.unwrap()
.tip();
@@ -393,7 +393,7 @@ async fn decode_block_mortality() {
let mortality = tx
.transaction_extensions()
.unwrap()
.find::<CheckMortality<SubstrateConfig>>()
.find::<CheckMortality<BizinikiwConfig>>()
.unwrap()
.unwrap();
@@ -411,7 +411,7 @@ async fn decode_block_mortality() {
let mortality = tx
.transaction_extensions()
.unwrap()
.find::<CheckMortality<SubstrateConfig>>()
.find::<CheckMortality<BizinikiwConfig>>()
.unwrap()
.unwrap();
@@ -429,7 +429,7 @@ async fn decode_block_mortality() {
let mortality = tx
.transaction_extensions()
.unwrap()
.find::<CheckMortality<SubstrateConfig>>()
.find::<CheckMortality<BizinikiwConfig>>()
.unwrap()
.unwrap();
@@ -192,7 +192,7 @@ async fn external_signing() {
#[cfg(fullclient)]
// TODO: Investigate and fix this test failure when using the ChainHeadBackend.
// (https://github.com/paritytech/subxt/issues/1308)
// (https://github.com/pezkuwichain/subxt/issues/1308)
#[cfg(legacy_backend)]
#[subxt_test]
async fn submit_large_extrinsic() {
@@ -267,7 +267,7 @@ async fn decode_a_module_error() {
}
#[subxt_test]
async fn unsigned_extrinsic_is_same_shape_as_polkadotjs() {
async fn unsigned_extrinsic_is_same_shape_as_pezkuwijs() {
let ctx = test_context().await;
let api = ctx.client();
@@ -280,8 +280,8 @@ async fn unsigned_extrinsic_is_same_shape_as_polkadotjs() {
let actual_tx_bytes = actual_tx.encoded();
// How these were obtained:
// - start local substrate node.
// - open polkadot.js UI in browser and point at local node.
// - start local bizinikiwi node.
// - open pezkuwi.js UI in browser and point at local node.
// - open dev console (may need to refresh page now) and find the WS connection.
// - create a balances.transferAllowDeath to ALICE (doesn't matter who from) with 12345 and "submit unsigned".
// - find the submitAndWatchExtrinsic call in the WS connection to get these bytes:
@@ -290,7 +290,7 @@ async fn unsigned_extrinsic_is_same_shape_as_polkadotjs() {
)
.unwrap();
// Make sure our encoding is the same as the encoding polkadot UI created.
// Make sure our encoding is the same as the encoding pezkuwi UI created.
assert_eq!(actual_tx_bytes, expected_tx_bytes);
}
@@ -393,8 +393,8 @@ async fn partial_fee_estimate_correct() {
// This test runs OK locally but fails sporadically in CI eg:
//
// https://github.com/paritytech/subxt/actions/runs/13374953009/job/37353887719?pr=1910#step:7:178
// https://github.com/paritytech/subxt/actions/runs/13385878645/job/37382498200#step:6:163
// https://github.com/pezkuwichain/subxt/actions/runs/13374953009/job/37353887719?pr=1910#step:7:178
// https://github.com/pezkuwichain/subxt/actions/runs/13385878645/job/37382498200#step:6:163
//
// While those errors were timeouts, I also saw errors like "intersections size is 1".
/*
@@ -8,10 +8,10 @@
/// Generate by running this at the root of the repository:
///
/// ```text
/// cargo run --bin subxt -- codegen --file artifacts/polkadot_metadata_full.scale | rustfmt > testing/integration-tests/src/full_client/codegen/polkadot.rs
/// cargo run --bin subxt -- codegen --file artifacts/pezkuwi_metadata_full.scale | rustfmt > testing/integration-tests/src/full_client/codegen/pezkuwi.rs
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
mod polkadot;
mod pezkuwi;
mod documentation;
@@ -17,9 +17,9 @@ use scale_info::{
build::{Fields, Variants},
meta_type,
};
use pezkuwi_subxt::{Metadata, OfflineClient, OnlineClient, SubstrateConfig};
use pezkuwi_subxt::{Metadata, OfflineClient, OnlineClient, BizinikiwConfig};
async fn fetch_v15_metadata(client: &OnlineClient<SubstrateConfig>) -> RuntimeMetadataV15 {
async fn fetch_v15_metadata(client: &OnlineClient<BizinikiwConfig>) -> RuntimeMetadataV15 {
let payload = node_runtime::apis().metadata().metadata_at_version(15);
let runtime_metadata_bytes = client
.runtime_api()
@@ -40,7 +40,7 @@ async fn fetch_v15_metadata(client: &OnlineClient<SubstrateConfig>) -> RuntimeMe
v15_metadata
}
async fn metadata_to_api(metadata: Metadata, ctx: &TestContext) -> OfflineClient<SubstrateConfig> {
async fn metadata_to_api(metadata: Metadata, ctx: &TestContext) -> OfflineClient<BizinikiwConfig> {
OfflineClient::new(
ctx.client().genesis_hash(),
ctx.client().runtime_version(),
@@ -2,7 +2,7 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
// TODO: Re-enable these once V16 is stable in Substrate nightlies,
// TODO: Re-enable these once V16 is stable in Bizinikiwi nightlies,
// and test-runtime is updated to pull in V16 metadata by default.
/*
use crate::{subxt_test, test_context};
@@ -7,7 +7,7 @@ use crate::{subxt_test, test_context};
use frame_decode::extrinsics::ExtrinsicType;
use pezkuwi_subxt_signer::sr25519::dev;
// TODO: When VerifySignature exists on the substrate kitchensink runtime,
// TODO: When VerifySignature exists on the bizinikiwi kitchensink runtime,
// let's try actuallty submitting v4 and v5 signed extrinsics to verify that
// they are actually accepted by the node.
@@ -14,7 +14,7 @@
//! using `OnceCell`. However, during the initialization, tokio::spawn is used
//! to multiplex between subxt requests and node responses. The #[tokio::test]
//! macro internally creates a new Runtime for each individual test. This means
//! that only the first test, which spawns the substrate binary and synchronizes
//! that only the first test, which spawns the bizinikiwi binary and synchronizes
//! the light client, would have access to the background task. The cleanup process
//! would destroy the spawned background task, preventing subsequent tests from
//! accessing it.
@@ -33,13 +33,13 @@ use std::sync::Arc;
use pezkuwi_subxt::backend::chain_head::ChainHeadBackend;
use pezkuwi_subxt::backend::rpc::RpcClient;
use pezkuwi_subxt::dynamic::Value;
use pezkuwi_subxt::{client::OnlineClient, config::PolkadotConfig, lightclient::LightClient};
use pezkuwi_subxt::{client::OnlineClient, config::PezkuwiConfig, lightclient::LightClient};
use pezkuwi_subxt_metadata::Metadata;
type Client = OnlineClient<PolkadotConfig>;
type Client = OnlineClient<PezkuwiConfig>;
/// The Polkadot chainspec.
const POLKADOT_SPEC: &str = include_str!("../../../../artifacts/demo_chain_specs/polkadot.json");
/// The Pezkuwi chainspec.
const POLKADOT_SPEC: &str = include_str!("../../../../artifacts/demo_chain_specs/pezkuwi.json");
// Check that we can subscribe to non-finalized blocks.
async fn non_finalized_headers_subscription(api: &Client) -> Result<(), pezkuwi_subxt::Error> {
@@ -165,11 +165,11 @@ async fn dynamic_events(api: &Client) -> Result<(), pezkuwi_subxt::Error> {
}
async fn run_test(backend: BackendType) -> Result<(), pezkuwi_subxt::Error> {
// Note: This code fetches the chainspec from the Polkadot public RPC node.
// Note: This code fetches the chainspec from the Pezkuwi public RPC node.
// This is not recommended for production use, as it may be slow and unreliable.
// However, this can come in handy for testing purposes.
//
// let chainspec = pezkuwi_subxt::utils::fetch_chainspec_from_rpc_node("wss://rpc.polkadot.io:443")
// let chainspec = pezkuwi_subxt::utils::fetch_chainspec_from_rpc_node("wss://rpc.pezkuwi.io:443")
// .await
// .unwrap();
// let chain_config = chainspec.get();
@@ -182,7 +182,7 @@ async fn run_test(backend: BackendType) -> Result<(), pezkuwi_subxt::Error> {
BackendType::Unstable => {
let backend =
ChainHeadBackend::builder().build_with_background_driver(RpcClient::new(rpc));
let api: OnlineClient<PolkadotConfig> =
let api: OnlineClient<PezkuwiConfig> =
OnlineClient::from_backend(Arc::new(backend)).await?;
api
}
@@ -4,14 +4,14 @@
pub(crate) use crate::{node_runtime, utils::TestNodeProcess};
use pezkuwi_subxt::SubstrateConfig;
use pezkuwi_subxt::BizinikiwConfig;
use pezkuwi_subxt::client::OnlineClient;
use super::node_proc::RpcClientKind;
/// `substrate-node` should be installed on the $PATH. We fall back
/// to also checking for an older `substrate` binary.
const SUBSTRATE_NODE_PATHS: &str = "substrate-node,substrate";
/// `bizinikiwi-node` should be installed on the $PATH. We fall back
/// to also checking for an older `bizinikiwi` binary.
const SUBSTRATE_NODE_PATHS: &str = "bizinikiwi-node,bizinikiwi";
pub async fn test_context_with(authority: String, rpc_client_kind: RpcClientKind) -> TestContext {
let paths =
@@ -21,14 +21,14 @@ pub async fn test_context_with(authority: String, rpc_client_kind: RpcClientKind
let mut proc = TestContext::build(&paths);
proc.with_authority(authority);
proc.with_rpc_client_kind(rpc_client_kind);
proc.spawn::<SubstrateConfig>().await.unwrap()
proc.spawn::<BizinikiwConfig>().await.unwrap()
}
pub type TestConfig = SubstrateConfig;
pub type TestConfig = BizinikiwConfig;
pub type TestContext = TestNodeProcess<SubstrateConfig>;
pub type TestContext = TestNodeProcess<BizinikiwConfig>;
pub type TestClient = OnlineClient<SubstrateConfig>;
pub type TestClient = OnlineClient<BizinikiwConfig>;
pub async fn test_context() -> TestContext {
test_context_with("alice".to_string(), RpcClientKind::Legacy).await
@@ -6,7 +6,7 @@ use std::cell::RefCell;
use std::ffi::{OsStr, OsString};
use std::sync::Arc;
use std::time::Duration;
use substrate_runner::SubstrateNode;
use bizinikiwi_runner::BizinikiwiNode;
use pezkuwi_subxt::backend::rpc::reconnecting_rpc_client::{ExponentialBackoff, RpcClientBuilder};
use pezkuwi_subxt::{
Config, OnlineClient,
@@ -35,10 +35,10 @@ fn get_url(port: Option<u16>) -> String {
}
}
/// Spawn a local substrate node for testing subxt.
/// Spawn a local bizinikiwi node for testing subxt.
pub struct TestNodeProcess<R: Config> {
// Keep a handle to the node; once it's dropped the node is killed.
proc: Option<SubstrateNode>,
proc: Option<BizinikiwiNode>,
// Lazily construct these when asked for.
chainhead_backend: RefCell<Option<OnlineClient<R>>>,
@@ -165,14 +165,14 @@ impl TestNodeProcessBuilder {
self
}
/// Spawn the substrate node at the given path, and wait for rpc to be initialized.
/// Spawn the bizinikiwi node at the given path, and wait for rpc to be initialized.
pub async fn spawn<R>(self) -> Result<TestNodeProcess<R>, String>
where
R: Config,
{
// Only spawn a process if a URL to target wasn't provided as an env var.
let proc = if !is_url_provided() {
let mut node_builder = SubstrateNode::builder();
let mut node_builder = BizinikiwiNode::builder();
node_builder.binary_paths(&self.node_paths);
if let Some(authority) = &self.authority {
@@ -267,14 +267,14 @@ async fn build_chainhead_backend<T: Config>(
#[cfg(lightclient)]
async fn build_light_client<T: Config>(
maybe_proc: &Option<SubstrateNode>,
maybe_proc: &Option<BizinikiwiNode>,
) -> Result<OnlineClient<T>, String> {
use pezkuwi_subxt::lightclient::{ChainConfig, LightClient};
let proc = if let Some(proc) = maybe_proc {
proc
} else {
return Err("Cannot build light client: no substrate node is running (you can't start a light client when pointing to an external node)".into());
return Err("Cannot build light client: no bizinikiwi node is running (you can't start a light client when pointing to an external node)".into());
};
// RPC endpoint. Only localhost works.
@@ -3,7 +3,7 @@
// see LICENSE for license details.
use pezkuwi_subxt::{
Config, OnlineClient, SubstrateConfig, backend::StreamOf, blocks::Block, client::OnlineClientT,
Config, OnlineClient, BizinikiwConfig, backend::StreamOf, blocks::Block, client::OnlineClientT,
error::BackendError,
};
@@ -33,7 +33,7 @@ pub async fn wait_for_number_of_blocks<C: Config>(
/// and one relies on something to included in finalized block in ner future.
pub async fn consume_initial_blocks(
blocks: &mut StreamOf<
Result<Block<SubstrateConfig, OnlineClient<SubstrateConfig>>, BackendError>,
Result<Block<BizinikiwConfig, OnlineClient<BizinikiwConfig>>, BackendError>,
>,
) {
use tokio::time::{Duration, Instant, interval_at};