feat: Rebrand Polkadot/Substrate references to PezkuwiChain
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
@@ -0,0 +1,153 @@
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// This file is part of Pezcumulus.
|
||||
|
||||
// Pezcumulus is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Pezcumulus is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Pezcumulus. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use cumulus_client_service::TeyrchainHostFunctions;
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use cumulus_test_runtime::AccountId;
|
||||
use pezsc_chain_spec::GenesisConfigBuilderRuntimeCaller;
|
||||
use pezsc_service::{ChainType, GenericChainSpec};
|
||||
use serde_json::json;
|
||||
|
||||
/// Get the chain spec for a specific teyrchain ID.
|
||||
/// The given accounts are initialized with funds in addition
|
||||
/// to the default known accounts.
|
||||
pub fn get_chain_spec_with_extra_endowed(
|
||||
id: Option<ParaId>,
|
||||
extra_endowed_accounts: Vec<AccountId>,
|
||||
code: &[u8],
|
||||
) -> GenericChainSpec {
|
||||
let runtime_caller = GenesisConfigBuilderRuntimeCaller::<TeyrchainHostFunctions>::new(code);
|
||||
let mut development_preset = runtime_caller
|
||||
.get_named_preset(Some(&pezsp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET.to_string()))
|
||||
.expect("development preset is available on test runtime; qed");
|
||||
|
||||
// Extract existing balances
|
||||
let existing_balances = development_preset
|
||||
.get("balances")
|
||||
.and_then(|b| b.get("balances"))
|
||||
.and_then(|b| b.as_array())
|
||||
.cloned()
|
||||
.unwrap_or_default();
|
||||
|
||||
// Create new balances by combining existing and extra accounts
|
||||
let mut all_balances = existing_balances;
|
||||
all_balances.extend(extra_endowed_accounts.into_iter().map(|a| json!([a, 1u64 << 60])));
|
||||
|
||||
let mut patch_json = json!({
|
||||
"balances": {
|
||||
"balances": all_balances,
|
||||
},
|
||||
});
|
||||
|
||||
if let Some(id) = id {
|
||||
// Merge teyrchain ID if given, otherwise use the one from the preset.
|
||||
pezsc_chain_spec::json_merge(
|
||||
&mut patch_json,
|
||||
json!({
|
||||
"teyrchainInfo": {
|
||||
"teyrchainId": id,
|
||||
},
|
||||
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
pezsc_chain_spec::json_merge(&mut development_preset, patch_json.into());
|
||||
|
||||
GenericChainSpec::builder(code, None)
|
||||
.with_name("Local Testnet")
|
||||
.with_id(pezsp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET)
|
||||
.with_chain_type(ChainType::Local)
|
||||
.with_genesis_config_patch(development_preset)
|
||||
.build()
|
||||
}
|
||||
|
||||
/// Get the chain spec for a specific teyrchain ID.
|
||||
pub fn get_chain_spec(id: Option<ParaId>) -> GenericChainSpec {
|
||||
get_chain_spec_with_extra_endowed(
|
||||
id,
|
||||
Default::default(),
|
||||
cumulus_test_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
|
||||
)
|
||||
}
|
||||
|
||||
/// Get the chain spec for a specific teyrchain ID.
|
||||
pub fn get_elastic_scaling_chain_spec(id: Option<ParaId>) -> GenericChainSpec {
|
||||
get_chain_spec_with_extra_endowed(
|
||||
id,
|
||||
Default::default(),
|
||||
cumulus_test_runtime::elastic_scaling::WASM_BINARY
|
||||
.expect("WASM binary was not built, please build it!"),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn get_relay_parent_offset_chain_spec(id: Option<ParaId>) -> GenericChainSpec {
|
||||
get_chain_spec_with_extra_endowed(
|
||||
id,
|
||||
Default::default(),
|
||||
cumulus_test_runtime::relay_parent_offset::WASM_BINARY
|
||||
.expect("WASM binary was not built, please build it!"),
|
||||
)
|
||||
}
|
||||
|
||||
/// Get the chain spec for a specific teyrchain ID.
|
||||
pub fn get_elastic_scaling_500ms_chain_spec(id: Option<ParaId>) -> GenericChainSpec {
|
||||
get_chain_spec_with_extra_endowed(
|
||||
id,
|
||||
Default::default(),
|
||||
cumulus_test_runtime::elastic_scaling_500ms::WASM_BINARY
|
||||
.expect("WASM binary was not built, please build it!"),
|
||||
)
|
||||
}
|
||||
|
||||
/// Get the chain spec for a specific teyrchain ID.
|
||||
pub fn get_elastic_scaling_mvp_chain_spec(id: Option<ParaId>) -> GenericChainSpec {
|
||||
get_chain_spec_with_extra_endowed(
|
||||
id,
|
||||
Default::default(),
|
||||
cumulus_test_runtime::elastic_scaling_mvp::WASM_BINARY
|
||||
.expect("WASM binary was not built, please build it!"),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn get_elastic_scaling_multi_block_slot_chain_spec(id: Option<ParaId>) -> GenericChainSpec {
|
||||
get_chain_spec_with_extra_endowed(
|
||||
id,
|
||||
Default::default(),
|
||||
cumulus_test_runtime::elastic_scaling_multi_block_slot::WASM_BINARY
|
||||
.expect("WASM binary was not built, please build it!"),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn get_sync_backing_chain_spec(id: Option<ParaId>) -> GenericChainSpec {
|
||||
get_chain_spec_with_extra_endowed(
|
||||
id,
|
||||
Default::default(),
|
||||
cumulus_test_runtime::sync_backing::WASM_BINARY
|
||||
.expect("WASM binary was not built, please build it!"),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn get_async_backing_chain_spec(id: Option<ParaId>) -> GenericChainSpec {
|
||||
get_chain_spec_with_extra_endowed(
|
||||
id,
|
||||
Default::default(),
|
||||
cumulus_test_runtime::async_backing::WASM_BINARY
|
||||
.expect("WASM binary was not built, please build it!"),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user