Refactoring Checkpoint: (WIP)

This commit is contained in:
2025-12-14 10:29:31 +03:00
parent 6588d9a1f2
commit 0c5d19e3a0
1423 changed files with 6413 additions and 6062 deletions
@@ -52,7 +52,7 @@
//! # `GenesisConfig` for `runtimes`
//!
//! The runtime genesis config struct consists of configs for every pallet. For the [_demonstration
//! runtime_][`chain_spec_guide_runtime`] used in this guide, it consists of `SystemConfig`,
//! runtime_][`pez_chain_spec_guide_runtime`] used in this guide, it consists of `SystemConfig`,
//! `BarConfig`, and `FooConfig`. This structure was automatically generated by a macro and it can
//! be sneak-peeked here: [`RuntimeGenesisConfig`]. For further reading on generated runtime
//! types, refer to [`frame_runtime_types`].
@@ -89,7 +89,7 @@
//! Please note that two functions are customized: `preset_names` and `get_preset`. The first one
//! just provides a `Vec` of the names of supported presets, while the latter delegates the call
//! to a function that maps the name to an actual preset:
//! [`chain_spec_guide_runtime::presets::get_builtin_preset`]
//! [`pez_chain_spec_guide_runtime::presets::get_builtin_preset`]
#![doc = docify::embed!("./src/reference_docs/chain_spec_runtime/src/presets.rs", get_builtin_preset)]
//!
//! ## Genesis state presets for runtime
@@ -159,18 +159,18 @@
//!
//! The [`chain_spec_builder`] util allows interaction with the runtime in order to list or display
//! presets and build the chain specification file. It is possible to use the tool with the
//! [_demonstration runtime_][`chain_spec_guide_runtime`]. To build the required packages, just run
//! [_demonstration runtime_][`pez_chain_spec_guide_runtime`]. To build the required packages, just run
//! the following command:
//!
//! ```ignore
//! cargo build -p pezstaging-chain-spec-builder -p chain-spec-guide-runtime --release
//! cargo build -p pezstaging-chain-spec-builder -p pez-chain-spec-guide-runtime --release
//! ```
//!
//! The `chain-spec-builder` util can also be installed with `cargo install`:
//!
//! ```ignore
//! cargo install pezstaging-chain-spec-builder
//! cargo build -p chain-spec-guide-runtime --release
//! cargo build -p pez-chain-spec-guide-runtime --release
//! ```
//! Here are some examples in the form of rust tests:
//! ## Listing available preset names:
@@ -183,9 +183,9 @@
#![doc = docify::embed!("./src/reference_docs/chain_spec_runtime/tests/chain_spec_builder_tests.rs", cmd_generate_para_chain_spec)]
//!
//! [`RuntimeGenesisConfig`]:
//! chain_spec_guide_runtime::runtime::RuntimeGenesisConfig
//! pez_chain_spec_guide_runtime::runtime::RuntimeGenesisConfig
//! [`FooStruct`]:
//! chain_spec_guide_runtime::pallets::FooStruct
//! pez_chain_spec_guide_runtime::pallets::FooStruct
//! [`impl_runtime_apis`]: frame::runtime::prelude::impl_runtime_apis
//! [`build_state`]: pezframe_support::genesis_builder_helper::build_state
//! [`get_preset`]: pezframe_support::genesis_builder_helper::get_preset
@@ -1,5 +1,5 @@
[package]
name = "chain-spec-guide-runtime"
name = "pez-chain-spec-guide-runtime"
description = "A minimal runtime for chain spec guide"
version = "0.0.0"
license = "MIT-0"
@@ -8,7 +8,7 @@ homepage.workspace = true
repository.workspace = true
edition.workspace = true
publish = false
documentation = "https://docs.rs/chain-spec-guide-runtime"
documentation = "https://docs.rs/pez-chain-spec-guide-runtime"
[dependencies]
codec = { workspace = true }
@@ -39,8 +39,8 @@ use pezsp_genesis_builder::PresetId;
/// The runtime version.
#[runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("minimal-template-runtime"),
impl_name: alloc::borrow::Cow::Borrowed("minimal-template-runtime"),
spec_name: alloc::borrow::Cow::Borrowed("pez-minimal-template-runtime"),
impl_name: alloc::borrow::Cow::Borrowed("pez-minimal-template-runtime"),
authoring_version: 1,
spec_version: 0,
impl_version: 1,
@@ -3,8 +3,8 @@ use serde_json::{json, Value};
use std::str;
fn wasm_file_path() -> &'static str {
chain_spec_guide_runtime::runtime::WASM_BINARY_PATH
.expect("chain_spec_guide_runtime wasm should exist. qed")
pez_chain_spec_guide_runtime::runtime::WASM_BINARY_PATH
.expect("pez_chain_spec_guide_runtime wasm should exist. qed")
}
const CHAIN_SPEC_BUILDER_PATH: &str = "../../../../../target/release/chain-spec-builder";
@@ -189,7 +189,7 @@ fn generate_para_chain_spec() {
#[docify::export_content]
fn preset_4_json() {
assert_eq!(
chain_spec_guide_runtime::presets::preset_4(),
pez_chain_spec_guide_runtime::presets::preset_4(),
json!({
"foo": {
"someEnum": {
@@ -269,7 +269,7 @@ impl<AccountId> AuthorProvider<AccountId> for () {
pub mod runtime {
use super::*;
use pezcumulus_pallet_aura_ext::pallet;
use pezcumulus_pezpallet_aura_ext::pallet;
use frame::{runtime::prelude::*, testing_prelude::*};
construct_runtime!(
+3 -3
View File
@@ -123,8 +123,8 @@
//! consensus engine to work, and that particular runtime-api is implemented by a pallet
//! corresponding to that consensus engine.
//!
//! For example, taking a snippet from [`solochain_template_runtime`], the runtime has to provide
//! this additional runtime-api (compared to [`minimal_template_runtime`]), if the node software is
//! For example, taking a snippet from [`pez_solochain_template_runtime`], the runtime has to provide
//! this additional runtime-api (compared to [`pez_minimal_template_runtime`]), if the node software is
//! configured to use the Aura consensus engine:
//!
//! ```text
@@ -196,6 +196,6 @@
//! [`--dev-block-time`]: pezkuwi_omni_node_lib::cli::Cli::dev_block_time
//! [`pezkuwi-omni-node`]: https://crates.io/crates/polkadot-omni-node
//! [`chain-spec-builder`]: https://crates.io/crates/pezstaging-chain-spec-builder
//! [`pezcumulus-pezpallet-teyrchain-system`]: https://docs.rs/pezcumulus-pezpallet-parachain-system/latest/pezcumulus_pallet_parachain_system/
//! [`pezcumulus-pezpallet-teyrchain-system`]: https://docs.rs/pezcumulus-pezpallet-parachain-system/latest/pezcumulus_pezpallet_parachain_system/
//! [`pezframe-system`]: https://docs.rs/pezframe-system/latest/pezframe_system/
//! [`block number`]: https://docs.rs/pezframe-system/latest/pezframe_system/pallet/storage_types/struct.Number.html
@@ -50,7 +50,7 @@
//! - [`WeightReclaim`](pezframe_system::WeightReclaim): A transaction extension for the relay chain
//! that reclaims unused weight after executing a transaction.
//!
//! - [`StorageWeightReclaim`](pezcumulus_pallet_weight_reclaim::StorageWeightReclaim): A transaction
//! - [`StorageWeightReclaim`](pezcumulus_pezpallet_weight_reclaim::StorageWeightReclaim): A transaction
//! extension for teyrchains that reclaims unused storage weight after executing a transaction.
//!
//! For more information about these extensions, follow the link to the type documentation.
@@ -43,7 +43,7 @@
//!
//! ## Usage
//!
//! > Note: You can see a live example in the `pezstaging-node-cli` and `kitchensink-runtime` crates.
//! > Note: You can see a live example in the `pezstaging-node-cli` and `pez-kitchensink-runtime` crates.
//!
//! The umbrella crate can be added to your runtime crate like this:
//!