Merge pull request #1 from pezkuwichain/claude/pezkuwi-terminology-guide-GYGUY

Complete Pezkuwi SDK rebrand of minimal template
This commit is contained in:
SatoshiQaziMuhammed
2025-12-25 10:13:31 +03:00
committed by GitHub
18 changed files with 11074 additions and 9906 deletions
Generated
+10817 -9662
View File
File diff suppressed because it is too large Load Diff
+40 -9
View File
@@ -1,29 +1,29 @@
[workspace.package] [workspace.package]
license = "MIT-0" license = "MIT-0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Pezkuwi <admin@pezkuwichain.io>"]
homepage = "https://paritytech.github.io/polkadot-sdk/" homepage = "https://github.com/pezkuwichain/"
repository = "https://github.com/paritytech/polkadot-sdk-minimal-template.git" repository = "https://github.com/pezkuwichain/pezkuwi-sdk-minimal-template.git"
edition = "2021" edition = "2021"
[workspace] [workspace]
default-members = ["pallets/template", "runtime"] default-members = ["pezpallets/template", "runtime"]
members = [ members = [
"node", "node",
"pallets/template", "pezpallets/template",
"runtime", "runtime",
] ]
resolver = "2" resolver = "2"
[workspace.dependencies] [workspace.dependencies]
minimal-template-runtime = { path = "./runtime", default-features = false } pez-minimal-template-runtime = { path = "./runtime", default-features = false }
pallet-minimal-template = { path = "./pallets/template", default-features = false } pezpallet-minimal-template = { path = "./pezpallets/template", default-features = false }
clap = { version = "4.5.13" } clap = { version = "4.5.13" }
docify = { version = "0.2.9" } docify = { version = "0.2.9" }
futures = { version = "0.3.31" } futures = { version = "0.3.31" }
futures-timer = { version = "3.0.2" } futures-timer = { version = "3.0.2" }
jsonrpsee = { version = "0.24.3" } jsonrpsee = { version = "0.24.3" }
polkadot-sdk = { version = "2503.0.1", default-features = false } pezkuwi-sdk = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main", default-features = false }
codec = { version = "3.7.4", default-features = false, package = "parity-scale-codec" } codec = { version = "3.7.5", default-features = false, package = "parity-scale-codec" }
scale-info = { version = "2.11.6", default-features = false } scale-info = { version = "2.11.6", default-features = false }
serde_json = { version = "1.0.132", default-features = false } serde_json = { version = "1.0.132", default-features = false }
@@ -36,3 +36,34 @@ codegen-units = 1
inherits = "release" inherits = "release"
lto = true lto = true
[patch.crates-io]
# Map rebranded Pezkuwi packages from the forked Pezkuwi SDK repository
pezkuwi-sdk = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezframe-support = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezframe-system = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezpallet-balances = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezpallet-sudo = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezpallet-timestamp = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezpallet-transaction-payment = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezpallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsp-api = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsp-keyring = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsp-weights = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsp-io = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsp-runtime = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsp-genesis-builder = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsp-timestamp = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsp-block-builder = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsp-blockchain = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-cli = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-service = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-client-api = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-executor = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-telemetry = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-transaction-pool-api = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-transaction-pool = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-consensus = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-consensus-manual-seal = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-network = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-offchain = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
pezsc-basic-authorship = { git = "https://github.com/pezkuwichain/pezkuwi-sdk.git", branch = "main" }
+7 -7
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "minimal-template-node" name = "pez-minimal-template-node"
description = "A minimal Substrate-based Substrate node, ready for hacking." description = "A minimal Bizinikiwi-based node, ready for hacking."
version = "0.1.0" version = "0.1.0"
license = "Unlicense" license = "Unlicense"
authors.workspace = true authors.workspace = true
@@ -19,15 +19,15 @@ docify = { workspace = true }
futures = { features = ["thread-pool"], workspace = true } futures = { features = ["thread-pool"], workspace = true }
futures-timer = { workspace = true } futures-timer = { workspace = true }
jsonrpsee = { features = ["server"], workspace = true } jsonrpsee = { features = ["server"], workspace = true }
minimal-template-runtime.workspace = true pez-minimal-template-runtime.workspace = true
polkadot-sdk = { workspace = true, features = ["experimental", "node"] } pezkuwi-sdk = { workspace = true, features = ["experimental", "node"] }
[build-dependencies] [build-dependencies]
polkadot-sdk = { workspace = true, features = ["substrate-build-script-utils"] } pezkuwi-sdk = { workspace = true, features = ["bizinikiwi-build-script-utils"] }
[features] [features]
default = ["std"] default = ["std"]
std = [ std = [
"minimal-template-runtime/std", "pez-minimal-template-runtime/std",
"polkadot-sdk/std", "pezkuwi-sdk/std",
] ]
+3 -3
View File
@@ -1,6 +1,6 @@
// This file is part of Substrate. // This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd. // Copyright (C) Parity Technologies (UK) Ltd. and Kurdistan Blockchain Technologies Institute
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use polkadot_sdk::substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; use pezkuwi_sdk::bizinikiwi_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
fn main() { fn main() {
generate_cargo_keys(); generate_cargo_keys();
+9 -9
View File
@@ -1,6 +1,6 @@
// This file is part of Substrate. // This file is part of pezkuwi-sdk.
// Copyright (C) Parity Technologies (UK) Ltd. // Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,19 +15,19 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use minimal_template_runtime::WASM_BINARY; use pez_minimal_template_runtime::WASM_BINARY;
use polkadot_sdk::{ use pezkuwi_sdk::{
sc_service::{ChainType, Properties}, pezsc_service::{ChainType, Properties},
*, *,
}; };
/// This is a specialization of the general Substrate ChainSpec type. /// This is a specialization of the general bizinikiwi ChainSpec type.
pub type ChainSpec = sc_service::GenericChainSpec; pub type ChainSpec = pezsc_service::GenericChainSpec;
fn props() -> Properties { fn props() -> Properties {
let mut properties = Properties::new(); let mut properties = Properties::new();
properties.insert("tokenDecimals".to_string(), 0.into()); properties.insert("tokenDecimals".to_string(), 0.into());
properties.insert("tokenSymbol".to_string(), "MINI".into()); properties.insert("tokenSymbol".to_string(), "PEZ".into());
properties properties
} }
@@ -36,7 +36,7 @@ pub fn development_chain_spec() -> Result<ChainSpec, String> {
.with_name("Development") .with_name("Development")
.with_id("dev") .with_id("dev")
.with_chain_type(ChainType::Development) .with_chain_type(ChainType::Development)
.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET) .with_genesis_config_preset_name(pezsp_genesis_builder::DEV_RUNTIME_PRESET)
.with_properties(props()) .with_properties(props())
.build()) .build())
} }
+12 -13
View File
@@ -1,8 +1,7 @@
// This file is part of Substrate. // This file is part of pezkuwi-sdk.
// Copyright (C) Parity Technologies (UK) Ltd. // Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
@@ -15,7 +14,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use polkadot_sdk::{sc_cli::RunCmd, *}; use pezkuwi_sdk::{pezsc_cli::RunCmd, *};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum Consensus { pub enum Consensus {
@@ -56,29 +55,29 @@ pub struct Cli {
pub enum Subcommand { pub enum Subcommand {
/// Key management cli utilities /// Key management cli utilities
#[command(subcommand)] #[command(subcommand)]
Key(sc_cli::KeySubcommand), Key(pezsc_cli::KeySubcommand),
/// Build a chain specification. /// Build a chain specification.
BuildSpec(sc_cli::BuildSpecCmd), BuildSpec(pezsc_cli::BuildSpecCmd),
/// Validate blocks. /// Validate blocks.
CheckBlock(sc_cli::CheckBlockCmd), CheckBlock(pezsc_cli::CheckBlockCmd),
/// Export blocks. /// Export blocks.
ExportBlocks(sc_cli::ExportBlocksCmd), ExportBlocks(pezsc_cli::ExportBlocksCmd),
/// Export the state of a given block into a chain spec. /// Export the state of a given block into a chain spec.
ExportState(sc_cli::ExportStateCmd), ExportState(pezsc_cli::ExportStateCmd),
/// Import blocks. /// Import blocks.
ImportBlocks(sc_cli::ImportBlocksCmd), ImportBlocks(pezsc_cli::ImportBlocksCmd),
/// Remove the whole chain. /// Remove the whole chain.
PurgeChain(sc_cli::PurgeChainCmd), PurgeChain(pezsc_cli::PurgeChainCmd),
/// Revert the chain to a previous state. /// Revert the chain to a previous state.
Revert(sc_cli::RevertCmd), Revert(pezsc_cli::RevertCmd),
/// Db meta columns information. /// Db meta columns information.
ChainInfo(sc_cli::ChainInfoCmd), ChainInfo(pezsc_cli::ChainInfoCmd),
} }
+15 -15
View File
@@ -1,6 +1,6 @@
// This file is part of Substrate. // This file is part of pezkuwi-sdk.
// Copyright (C) Parity Technologies (UK) Ltd. // Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,15 +20,15 @@ use crate::{
cli::{Cli, Subcommand}, cli::{Cli, Subcommand},
service, service,
}; };
use polkadot_sdk::{sc_cli::SubstrateCli, sc_service::PartialComponents, *}; use pezkuwi_sdk::{pezsc_cli::BizinikiwiCli, pezsc_service::PartialComponents, *};
impl SubstrateCli for Cli { impl BizinikiwiCli for Cli {
fn impl_name() -> String { fn impl_name() -> String {
"Substrate Node".into() "Bizinikiwi Node".into()
} }
fn impl_version() -> String { fn impl_version() -> String {
env!("SUBSTRATE_CLI_IMPL_VERSION").into() env!("BIZINIKIWI_CLI_IMPL_VERSION").into()
} }
fn description() -> String { fn description() -> String {
@@ -47,7 +47,7 @@ impl SubstrateCli for Cli {
2017 2017
} }
fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> { fn load_spec(&self, id: &str) -> Result<Box<dyn pezsc_service::ChainSpec>, String> {
Ok(match id { Ok(match id {
"dev" => Box::new(chain_spec::development_chain_spec()?), "dev" => Box::new(chain_spec::development_chain_spec()?),
path => path =>
@@ -57,7 +57,7 @@ impl SubstrateCli for Cli {
} }
/// Parse and run command line arguments /// Parse and run command line arguments
pub fn run() -> sc_cli::Result<()> { pub fn run() -> pezsc_cli::Result<()> {
let cli = Cli::from_args(); let cli = Cli::from_args();
match &cli.subcommand { match &cli.subcommand {
@@ -111,20 +111,20 @@ pub fn run() -> sc_cli::Result<()> {
Some(Subcommand::ChainInfo(cmd)) => { Some(Subcommand::ChainInfo(cmd)) => {
let runner = cli.create_runner(cmd)?; let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| { runner.sync_run(|config| {
cmd.run::<minimal_template_runtime::interface::OpaqueBlock>(&config) cmd.run::<pez_minimal_template_runtime::interface::OpaqueBlock>(&config)
}) })
}, },
None => { None => {
let runner = cli.create_runner(&cli.run)?; let runner = cli.create_runner(&cli.run)?;
runner.run_node_until_exit(|config| async move { runner.run_node_until_exit(|config| async move {
match config.network.network_backend.unwrap_or_default() { match config.network.network_backend.unwrap_or_default() {
sc_network::config::NetworkBackendType::Libp2p => pezsc_network::config::NetworkBackendType::Libp2p =>
service::new_full::<sc_network::NetworkWorker<_, _>>(config, cli.consensus) service::new_full::<pezsc_network::NetworkWorker<_, _>>(config, cli.consensus)
.map_err(sc_cli::Error::Service), .map_err(pezsc_cli::Error::Service),
sc_network::config::NetworkBackendType::Litep2p => service::new_full::< pezsc_network::config::NetworkBackendType::Litep2p => service::new_full::<
sc_network::Litep2pNetworkBackend, pezsc_network::Litep2pNetworkBackend,
>(config, cli.consensus) >(config, cli.consensus)
.map_err(sc_cli::Error::Service), .map_err(pezsc_cli::Error::Service),
} }
}) })
}, },
+2 -2
View File
@@ -1,6 +1,6 @@
// This file is part of Polkadot Sdk. // This file is part of Pezkuwi Sdk.
// Copyright (C) Parity Technologies (UK) Ltd. // Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
+4 -4
View File
@@ -1,6 +1,6 @@
// This file is part of Substrate. // This file is part of pezkuwi-sdk.
// Copyright (C) Parity Technologies (UK) Ltd. // Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//! Substrate Node Template CLI library. //! Bizinikiwi Node Template CLI library.
#![warn(missing_docs)] #![warn(missing_docs)]
mod chain_spec; mod chain_spec;
@@ -24,6 +24,6 @@ mod command;
mod rpc; mod rpc;
mod service; mod service;
fn main() -> polkadot_sdk::sc_cli::Result<()> { fn main() -> pezkuwi_sdk::pezsc_cli::Result<()> {
command::run() command::run()
} }
+12 -12
View File
@@ -1,6 +1,6 @@
// This file is part of Substrate. // This file is part of pezkuwi-sdk.
// Copyright (C) Parity Technologies (UK) Ltd. // Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,17 +16,17 @@
// limitations under the License. // limitations under the License.
//! A collection of node-specific RPC methods. //! A collection of node-specific RPC methods.
//! Substrate provides the `sc-rpc` crate, which defines the core RPC layer //! bizinikiwi provides the `pezsc-rpc` crate, which defines the core RPC layer
//! used by Substrate nodes. This file extends those RPC definitions with //! used by bizinikiwi nodes. This file extends those RPC definitions with
//! capabilities that are specific to this project's runtime configuration. //! capabilities that are specific to this project's runtime configuration.
#![warn(missing_docs)] #![warn(missing_docs)]
use jsonrpsee::RpcModule; use jsonrpsee::RpcModule;
use minimal_template_runtime::interface::{AccountId, Nonce, OpaqueBlock}; use pez_minimal_template_runtime::interface::{AccountId, Nonce, OpaqueBlock};
use polkadot_sdk::{ use pezkuwi_sdk::{
sc_transaction_pool_api::TransactionPool, pezsc_transaction_pool_api::TransactionPool,
sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}, pezsp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata},
*, *,
}; };
use std::sync::Arc; use std::sync::Arc;
@@ -48,15 +48,15 @@ where
C: Send C: Send
+ Sync + Sync
+ 'static + 'static
+ sp_api::ProvideRuntimeApi<OpaqueBlock> + pezsp_api::ProvideRuntimeApi<OpaqueBlock>
+ HeaderBackend<OpaqueBlock> + HeaderBackend<OpaqueBlock>
+ HeaderMetadata<OpaqueBlock, Error = BlockChainError> + HeaderMetadata<OpaqueBlock, Error = BlockChainError>
+ 'static, + 'static,
C::Api: sp_block_builder::BlockBuilder<OpaqueBlock>, C::Api: pezsp_block_builder::BlockBuilder<OpaqueBlock>,
C::Api: substrate_frame_rpc_system::AccountNonceApi<OpaqueBlock, AccountId, Nonce>, C::Api: pezframe_rpc_system::AccountNonceApi<OpaqueBlock, AccountId, Nonce>,
P: TransactionPool + 'static, P: TransactionPool + 'static,
{ {
use polkadot_sdk::substrate_frame_rpc_system::{System, SystemApiServer}; use pezkuwi_sdk::pezframe_rpc_system::{System, SystemApiServer};
let mut module = RpcModule::new(()); let mut module = RpcModule::new(());
let FullDeps { client, pool } = deps; let FullDeps { client, pool } = deps;
+38 -38
View File
@@ -1,6 +1,6 @@
// This file is part of Substrate. // This file is part of pezkuwi-sdk.
// Copyright (C) Parity Technologies (UK) Ltd. // Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,34 +17,34 @@
use crate::cli::Consensus; use crate::cli::Consensus;
use futures::FutureExt; use futures::FutureExt;
use minimal_template_runtime::{interface::OpaqueBlock as Block, RuntimeApi}; use pez_minimal_template_runtime::{interface::OpaqueBlock as Block, RuntimeApi};
use polkadot_sdk::{ use pezkuwi_sdk::{
sc_client_api::backend::Backend, pezsc_client_api::backend::Backend,
sc_executor::WasmExecutor, pezsc_executor::WasmExecutor,
sc_service::{error::Error as ServiceError, Configuration, TaskManager}, pezsc_service::{error::Error as ServiceError, Configuration, TaskManager},
sc_telemetry::{Telemetry, TelemetryWorker}, pezsc_telemetry::{Telemetry, TelemetryWorker},
sc_transaction_pool_api::OffchainTransactionPoolFactory, pezsc_transaction_pool_api::OffchainTransactionPoolFactory,
sp_runtime::traits::Block as BlockT, pezsp_runtime::traits::Block as BlockT,
*, *,
}; };
use std::sync::Arc; use std::sync::Arc;
type HostFunctions = sp_io::SubstrateHostFunctions; type HostFunctions = pezsp_io::BizinikiwiHostFunctions;
#[docify::export] #[docify::export]
pub(crate) type FullClient = pub(crate) type FullClient =
sc_service::TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>; pezsc_service::TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>;
type FullBackend = sc_service::TFullBackend<Block>; type FullBackend = pezsc_service::TFullBackend<Block>;
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>; type FullSelectChain = pezsc_consensus::LongestChain<FullBackend, Block>;
/// Assembly of PartialComponents (enough to run chain ops subcommands) /// Assembly of PartialComponents (enough to run chain ops subcommands)
pub type Service = sc_service::PartialComponents< pub type Service = pezsc_service::PartialComponents<
FullClient, FullClient,
FullBackend, FullBackend,
FullSelectChain, FullSelectChain,
sc_consensus::DefaultImportQueue<Block>, pezsc_consensus::DefaultImportQueue<Block>,
sc_transaction_pool::TransactionPoolHandle<Block, FullClient>, pezsc_transaction_pool::TransactionPoolHandle<Block, FullClient>,
Option<Telemetry>, Option<Telemetry>,
>; >;
@@ -53,17 +53,17 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {
.telemetry_endpoints .telemetry_endpoints
.clone() .clone()
.filter(|x| !x.is_empty()) .filter(|x| !x.is_empty())
.map(|endpoints| -> Result<_, sc_telemetry::Error> { .map(|endpoints| -> Result<_, pezsc_telemetry::Error> {
let worker = TelemetryWorker::new(16)?; let worker = TelemetryWorker::new(16)?;
let telemetry = worker.handle().new_telemetry(endpoints); let telemetry = worker.handle().new_telemetry(endpoints);
Ok((worker, telemetry)) Ok((worker, telemetry))
}) })
.transpose()?; .transpose()?;
let executor = sc_service::new_wasm_executor(&config.executor); let executor = pezsc_service::new_wasm_executor(&config.executor);
let (client, backend, keystore_container, task_manager) = let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>( pezsc_service::new_full_parts::<Block, RuntimeApi, _>(
config, config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor, executor,
@@ -75,10 +75,10 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {
telemetry telemetry
}); });
let select_chain = sc_consensus::LongestChain::new(backend.clone()); let select_chain = pezsc_consensus::LongestChain::new(backend.clone());
let transaction_pool = Arc::from( let transaction_pool = Arc::from(
sc_transaction_pool::Builder::new( pezsc_transaction_pool::Builder::new(
task_manager.spawn_essential_handle(), task_manager.spawn_essential_handle(),
client.clone(), client.clone(),
config.role.is_authority().into(), config.role.is_authority().into(),
@@ -88,13 +88,13 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {
.build(), .build(),
); );
let import_queue = sc_consensus_manual_seal::import_queue( let import_queue = pezsc_consensus_manual_seal::import_queue(
Box::new(client.clone()), Box::new(client.clone()),
&task_manager.spawn_essential_handle(), &task_manager.spawn_essential_handle(),
config.prometheus_registry(), config.prometheus_registry(),
); );
Ok(sc_service::PartialComponents { Ok(pezsc_service::PartialComponents {
client, client,
backend, backend,
task_manager, task_manager,
@@ -107,11 +107,11 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {
} }
/// Builds a new service for a full client. /// Builds a new service for a full client.
pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Hash>>( pub fn new_full<Network: pezsc_network::NetworkBackend<Block, <Block as BlockT>::Hash>>(
config: Configuration, config: Configuration,
consensus: Consensus, consensus: Consensus,
) -> Result<TaskManager, ServiceError> { ) -> Result<TaskManager, ServiceError> {
let sc_service::PartialComponents { let pezsc_service::PartialComponents {
client, client,
backend, backend,
mut task_manager, mut task_manager,
@@ -122,7 +122,7 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
other: mut telemetry, other: mut telemetry,
} = new_partial(&config)?; } = new_partial(&config)?;
let net_config = sc_network::config::FullNetworkConfiguration::< let net_config = pezsc_network::config::FullNetworkConfiguration::<
Block, Block,
<Block as BlockT>::Hash, <Block as BlockT>::Hash,
Network, Network,
@@ -135,7 +135,7 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
); );
let (network, system_rpc_tx, tx_handler_controller, sync_service) = let (network, system_rpc_tx, tx_handler_controller, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams { pezsc_service::build_network(pezsc_service::BuildNetworkParams {
config: &config, config: &config,
net_config, net_config,
client: client.clone(), client: client.clone(),
@@ -150,7 +150,7 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
if config.offchain_worker.enabled { if config.offchain_worker.enabled {
let offchain_workers = let offchain_workers =
sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { pezsc_offchain::OffchainWorkers::new(pezsc_offchain::OffchainWorkerOptions {
runtime_api_provider: client.clone(), runtime_api_provider: client.clone(),
is_validator: config.role.is_authority(), is_validator: config.role.is_authority(),
keystore: Some(keystore_container.keystore()), keystore: Some(keystore_container.keystore()),
@@ -181,7 +181,7 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
let prometheus_registry = config.prometheus_registry().cloned(); let prometheus_registry = config.prometheus_registry().cloned();
let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { let _rpc_handlers = pezsc_service::spawn_tasks(pezsc_service::SpawnTasksParams {
network, network,
client: client.clone(), client: client.clone(),
keystore: keystore_container.keystore(), keystore: keystore_container.keystore(),
@@ -196,7 +196,7 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
telemetry: telemetry.as_mut(), telemetry: telemetry.as_mut(),
})?; })?;
let proposer = sc_basic_authorship::ProposerFactory::new( let proposer = pezsc_basic_authorship::ProposerFactory::new(
task_manager.spawn_handle(), task_manager.spawn_handle(),
client.clone(), client.clone(),
transaction_pool.clone(), transaction_pool.clone(),
@@ -206,7 +206,7 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
match consensus { match consensus {
Consensus::InstantSeal => { Consensus::InstantSeal => {
let params = sc_consensus_manual_seal::InstantSealParams { let params = pezsc_consensus_manual_seal::InstantSealParams {
block_import: client.clone(), block_import: client.clone(),
env: proposer, env: proposer,
client, client,
@@ -214,11 +214,11 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
select_chain, select_chain,
consensus_data_provider: None, consensus_data_provider: None,
create_inherent_data_providers: move |_, ()| async move { create_inherent_data_providers: move |_, ()| async move {
Ok(sp_timestamp::InherentDataProvider::from_system_time()) Ok(pezsp_timestamp::InherentDataProvider::from_system_time())
}, },
}; };
let authorship_future = sc_consensus_manual_seal::run_instant_seal(params); let authorship_future = pezsc_consensus_manual_seal::run_instant_seal(params);
task_manager.spawn_essential_handle().spawn_blocking( task_manager.spawn_essential_handle().spawn_blocking(
"instant-seal", "instant-seal",
@@ -231,7 +231,7 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
task_manager.spawn_handle().spawn("block_authoring", None, async move { task_manager.spawn_handle().spawn("block_authoring", None, async move {
loop { loop {
futures_timer::Delay::new(std::time::Duration::from_millis(block_time)).await; futures_timer::Delay::new(std::time::Duration::from_millis(block_time)).await;
sink.try_send(sc_consensus_manual_seal::EngineCommand::SealNewBlock { sink.try_send(pezsc_consensus_manual_seal::EngineCommand::SealNewBlock {
create_empty: true, create_empty: true,
finalize: true, finalize: true,
parent_hash: None, parent_hash: None,
@@ -241,7 +241,7 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
} }
}); });
let params = sc_consensus_manual_seal::ManualSealParams { let params = pezsc_consensus_manual_seal::ManualSealParams {
block_import: client.clone(), block_import: client.clone(),
env: proposer, env: proposer,
client, client,
@@ -250,10 +250,10 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
commands_stream: Box::pin(commands_stream), commands_stream: Box::pin(commands_stream),
consensus_data_provider: None, consensus_data_provider: None,
create_inherent_data_providers: move |_, ()| async move { create_inherent_data_providers: move |_, ()| async move {
Ok(sp_timestamp::InherentDataProvider::from_system_time()) Ok(pezsp_timestamp::InherentDataProvider::from_system_time())
}, },
}; };
let authorship_future = sc_consensus_manual_seal::run_manual_seal(params); let authorship_future = pezsc_consensus_manual_seal::run_manual_seal(params);
task_manager.spawn_essential_handle().spawn_blocking( task_manager.spawn_essential_handle().spawn_blocking(
"manual-seal", "manual-seal",
-26
View File
@@ -1,26 +0,0 @@
//! A shell pallet built with [`frame`].
//!
//! To get started with this pallet, try implementing the guide in
//! <https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html>
#![cfg_attr(not(feature = "std"), no_std)]
use frame::prelude::*;
use polkadot_sdk::polkadot_sdk_frame as frame;
// Re-export all pallet parts, this is needed to properly import the pallet into the runtime.
pub use pallet::*;
#[frame::pallet]
pub mod pallet {
use super::*;
#[pallet::config]
pub trait Config: polkadot_sdk::frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pallet::storage]
pub type Value<T> = StorageValue<Value = u32>;
}
@@ -1,6 +1,6 @@
[package] [package]
name = "pallet-minimal-template" name = "pezpallet-minimal-template"
description = "A minimal pallet built with FRAME, part of Polkadot Sdk." description = "A minimal pezpallet built with Pezframe, part of Pezkuwi SDK."
version = "0.1.0" version = "0.1.0"
license = "Unlicense" license = "Unlicense"
authors.workspace = true authors.workspace = true
@@ -14,10 +14,10 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
codec = { features = ["derive"], workspace = true } codec = { features = ["derive"], workspace = true }
polkadot-sdk = { workspace = true, features = ["experimental", "runtime"], default-features = false } pezkuwi-sdk = { workspace = true, features = ["experimental", "runtime"], default-features = false }
scale-info = { features = ["derive"], workspace = true } scale-info = { features = ["derive"], workspace = true }
[features] [features]
default = ["std"] default = ["std"]
std = ["codec/std", "polkadot-sdk/std", "scale-info/std"] std = ["codec/std", "pezkuwi-sdk/std", "scale-info/std"]
+25
View File
@@ -0,0 +1,25 @@
//! A shell pezpallet built with [`pezframe`].
//!
//! To get started with this pezpallet, try implementing the guide in
//! <https://github.com/pezkuwichain/pezkuwi-sdk>
#![cfg_attr(not(feature = "std"), no_std)]
use pezkuwi_sdk::pezkuwi_sdk_frame::deps::pezframe_support::pezpallet_prelude::*;
// Re-export all pezpallet parts, this is needed to properly import the pezpallet into the runtime.
pub use pallet::*;
#[pezkuwi_sdk::pezframe_support::pezpallet]
pub mod pallet {
use super::*;
#[pezpallet::config]
pub trait Config: pezkuwi_sdk::pezframe_system::Config {}
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pezpallet::storage]
pub type Value<T> = StorageValue<Value = u32>;
}
+7 -7
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "minimal-template-runtime" name = "pez-minimal-template-runtime"
description = "A solochain runtime template built with Substrate, part of Polkadot Sdk." description = "A solochain runtime template built with Bizinikiwi, part of Pezkuwi SDK."
version = "0.1.0" version = "0.1.0"
license = "Unlicense" license = "Unlicense"
authors.workspace = true authors.workspace = true
@@ -11,20 +11,20 @@ publish = false
[dependencies] [dependencies]
codec = { workspace = true } codec = { workspace = true }
pallet-minimal-template.workspace = true pezpallet-minimal-template.workspace = true
polkadot-sdk = { workspace = true, features = ["pallet-balances", "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "runtime"] } pezkuwi-sdk = { workspace = true, features = ["pezpallet-balances", "pezpallet-sudo", "pezpallet-timestamp", "pezpallet-transaction-payment", "pezpallet-transaction-payment-rpc-runtime-api", "runtime", "pezsp-api"] }
scale-info = { workspace = true } scale-info = { workspace = true }
serde_json = { workspace = true, default-features = false, features = ["alloc"] } serde_json = { workspace = true, default-features = false, features = ["alloc"] }
[build-dependencies] [build-dependencies]
polkadot-sdk = { optional = true, workspace = true, features = ["substrate-wasm-builder"] } pezkuwi-sdk = { optional = true, workspace = true, features = ["bizinikiwi-wasm-builder"] }
[features] [features]
default = ["std"] default = ["std"]
std = [ std = [
"codec/std", "codec/std",
"pallet-minimal-template/std", "pezpallet-minimal-template/std",
"polkadot-sdk/std", "pezkuwi-sdk/std",
"scale-info/std", "scale-info/std",
"serde_json/std", "serde_json/std",
] ]
+2 -17
View File
@@ -1,23 +1,8 @@
// This file is part of Substrate. //! Build script for pez-minimal-template-runtime.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
fn main() { fn main() {
#[cfg(feature = "std")] #[cfg(feature = "std")]
{ {
polkadot_sdk::substrate_wasm_builder::WasmBuilder::build_using_defaults(); pezkuwi_sdk::bizinikiwi_wasm_builder::WasmBuilder::build_using_defaults();
} }
} }
+77 -78
View File
@@ -1,21 +1,4 @@
// This file is part of Substrate. //! A minimal runtime that includes the template [`pezpallet`](`pezpallet_minimal_template`).
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! A minimal runtime that includes the template [`pallet`](`pallet_minimal_template`).
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
@@ -26,13 +9,14 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
extern crate alloc; extern crate alloc;
use alloc::vec::Vec; use alloc::vec::Vec;
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pezpallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
use polkadot_sdk::{ use pezkuwi_sdk::{
polkadot_sdk_frame::{ pezkuwi_sdk_frame::{
self as frame, self as frame,
deps::sp_genesis_builder, deps::pezsp_genesis_builder,
runtime::{apis, prelude::*}, runtime::{apis, prelude::*},
}, },
pezframe_system as frame_system,
*, *,
}; };
@@ -41,9 +25,10 @@ pub mod genesis_config_presets {
use super::*; use super::*;
use crate::{ use crate::{
interface::{Balance, MinimumBalance}, interface::{Balance, MinimumBalance},
sp_keyring::Sr25519Keyring, runtime::{BalancesConfig, RuntimeGenesisConfig, SudoConfig},
BalancesConfig, RuntimeGenesisConfig, SudoConfig,
}; };
#[cfg(feature = "std")]
use pezkuwi_sdk::pezsp_keyring::Sr25519Keyring;
use alloc::{vec, vec::Vec}; use alloc::{vec, vec::Vec};
use serde_json::Value; use serde_json::Value;
@@ -51,7 +36,7 @@ pub mod genesis_config_presets {
/// Returns a development genesis config preset. /// Returns a development genesis config preset.
pub fn development_config_genesis() -> Value { pub fn development_config_genesis() -> Value {
let endowment = <MinimumBalance as Get<Balance>>::get().max(1) * 1000; let endowment = <MinimumBalance as Get<Balance>>::get().max(1) * 1000;
frame_support::build_struct_json_patch!(RuntimeGenesisConfig { pezframe_support::build_struct_json_patch!(RuntimeGenesisConfig {
balances: BalancesConfig { balances: BalancesConfig {
balances: Sr25519Keyring::iter() balances: Sr25519Keyring::iter()
.map(|a| (a.to_account_id(), endowment)) .map(|a| (a.to_account_id(), endowment))
@@ -64,7 +49,7 @@ pub mod genesis_config_presets {
/// Get the set of the available genesis config presets. /// Get the set of the available genesis config presets.
pub fn get_preset(id: &PresetId) -> Option<Vec<u8>> { pub fn get_preset(id: &PresetId) -> Option<Vec<u8>> {
let patch = match id.as_ref() { let patch = match id.as_ref() {
sp_genesis_builder::DEV_RUNTIME_PRESET => development_config_genesis(), pezsp_genesis_builder::DEV_RUNTIME_PRESET => development_config_genesis(),
_ => return None, _ => return None,
}; };
Some( Some(
@@ -76,15 +61,15 @@ pub mod genesis_config_presets {
/// List of supported presets. /// List of supported presets.
pub fn preset_names() -> Vec<PresetId> { pub fn preset_names() -> Vec<PresetId> {
vec![PresetId::from(sp_genesis_builder::DEV_RUNTIME_PRESET)] vec![PresetId::from(pezsp_genesis_builder::DEV_RUNTIME_PRESET)]
} }
} }
/// The runtime version. /// The runtime version.
#[runtime_version] #[runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion { pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("minimal-template-runtime"), spec_name: alloc::borrow::Cow::Borrowed("pez-minimal-template-runtime"),
impl_name: alloc::borrow::Cow::Borrowed("minimal-template-runtime"), impl_name: alloc::borrow::Cow::Borrowed("pez-minimal-template-runtime"),
authoring_version: 1, authoring_version: 1,
spec_version: 0, spec_version: 0,
impl_version: 1, impl_version: 1,
@@ -117,16 +102,18 @@ type TxExtension = (
frame_system::CheckWeight<Runtime>, frame_system::CheckWeight<Runtime>,
// Ensures that the sender has enough funds to pay for the transaction // Ensures that the sender has enough funds to pay for the transaction
// and deducts the fee from the sender's account. // and deducts the fee from the sender's account.
pallet_transaction_payment::ChargeTransactionPayment<Runtime>, pezpallet_transaction_payment::ChargeTransactionPayment<Runtime>,
// Reclaim the unused weight from the block using post dispatch information. // Reclaim the unused weight from the block using post dispatch information.
// It must be last in the pipeline in order to catch the refund in previous transaction // It must be last in the pipeline in order to catch the refund in previous transaction
// extensions // extensions
frame_system::WeightReclaim<Runtime>, frame_system::WeightReclaim<Runtime>,
); );
// Composes the runtime by adding all the used pallets and deriving necessary types. // Composes the runtime by adding all the used pezpallets and deriving necessary types.
#[frame_construct_runtime] #[frame_construct_runtime]
mod runtime { pub mod runtime {
use super::*;
/// The main runtime type. /// The main runtime type.
#[runtime::runtime] #[runtime::runtime]
#[runtime::derive( #[runtime::derive(
@@ -141,72 +128,80 @@ mod runtime {
RuntimeTask, RuntimeTask,
RuntimeViewFunction RuntimeViewFunction
)] )]
#[derive(Clone, PartialEq, Eq)]
pub struct Runtime; pub struct Runtime;
/// Mandatory system pallet that should always be included in a FRAME runtime. /// Mandatory system pezpallet that should always be included in a FRAME runtime.
#[runtime::pallet_index(0)] #[runtime::pezpallet_index(0)]
pub type System = frame_system::Pallet<Runtime>; pub type System = pezframe_system::Pezpallet<Runtime>;
/// Provides a way for consensus systems to set and check the onchain time. /// Provides a way for consensus systems to set and check the onchain time.
#[runtime::pallet_index(1)] #[runtime::pezpallet_index(1)]
pub type Timestamp = pallet_timestamp::Pallet<Runtime>; pub type Timestamp = pezpallet_timestamp::Pezpallet<Runtime>;
/// Provides the ability to keep track of balances. /// Provides the ability to keep track of balances.
#[runtime::pallet_index(2)] #[runtime::pezpallet_index(2)]
pub type Balances = pallet_balances::Pallet<Runtime>; pub type Balances = pezpallet_balances::Pezpallet<Runtime>;
/// Provides a way to execute privileged functions. /// Provides a way to execute privileged functions.
#[runtime::pallet_index(3)] #[runtime::pezpallet_index(3)]
pub type Sudo = pallet_sudo::Pallet<Runtime>; pub type Sudo = pezpallet_sudo::Pezpallet<Runtime>;
/// Provides the ability to charge for extrinsic execution. /// Provides the ability to charge for extrinsic execution.
#[runtime::pallet_index(4)] #[runtime::pezpallet_index(4)]
pub type TransactionPayment = pallet_transaction_payment::Pallet<Runtime>; pub type TransactionPayment = pezpallet_transaction_payment::Pezpallet<Runtime>;
/// A minimal pallet template. /// A minimal pezpallet template.
#[runtime::pallet_index(5)] #[runtime::pezpallet_index(5)]
pub type Template = pallet_minimal_template::Pallet<Runtime>; pub type Template = pezpallet_minimal_template::Pezpallet<Runtime>;
} }
pub use runtime::{
Runtime, System, Timestamp, Balances, Sudo, TransactionPayment, Template,
RuntimeCall, RuntimeEvent, RuntimeError, RuntimeOrigin, RuntimeFreezeReason,
RuntimeHoldReason, RuntimeSlashReason, RuntimeLockId, RuntimeTask, RuntimeViewFunction,
AllPalletsWithSystem, RuntimeGenesisConfig, BalancesConfig, SudoConfig,
};
parameter_types! { parameter_types! {
pub const Version: RuntimeVersion = VERSION; pub const Version: RuntimeVersion = VERSION;
} }
/// Implements the types required for the system pallet. /// Implements the types required for the system pezpallet.
#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig)] #[derive_impl(frame_system::config_preludes::SolochainDefaultConfig)]
impl frame_system::Config for Runtime { impl frame_system::Config for Runtime {
type Block = Block; type Block = Block;
type Version = Version; type Version = Version;
// Use the account data from the balances pallet // Use the account data from the balances pezpallet
type AccountData = pallet_balances::AccountData<<Runtime as pallet_balances::Config>::Balance>; type AccountData = pezpallet_balances::AccountData<<Runtime as pezpallet_balances::Config>::Balance>;
} }
// Implements the types required for the balances pallet. // Implements the types required for the balances pezpallet.
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] #[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
impl pallet_balances::Config for Runtime { impl pezpallet_balances::Config for Runtime {
type AccountStore = System; type AccountStore = System;
} }
// Implements the types required for the sudo pallet. // Implements the types required for the sudo pezpallet.
#[derive_impl(pallet_sudo::config_preludes::TestDefaultConfig)] #[derive_impl(pezpallet_sudo::config_preludes::TestDefaultConfig)]
impl pallet_sudo::Config for Runtime {} impl pezpallet_sudo::Config for Runtime {}
// Implements the types required for the sudo pallet. // Implements the types required for the timestamp pezpallet.
#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] #[derive_impl(pezpallet_timestamp::config_preludes::TestDefaultConfig)]
impl pallet_timestamp::Config for Runtime {} impl pezpallet_timestamp::Config for Runtime {}
// Implements the types required for the transaction payment pallet. // Implements the types required for the transaction payment pezpallet.
#[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig)] #[derive_impl(pezpallet_transaction_payment::config_preludes::TestDefaultConfig)]
impl pallet_transaction_payment::Config for Runtime { impl pezpallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter<Balances, ()>; type OnChargeTransaction = pezpallet_transaction_payment::FungibleAdapter<Balances, ()>;
// Setting fee as independent of the weight of the extrinsic for demo purposes // Setting fee as independent of the weight of the extrinsic for demo purposes
type WeightToFee = NoFee<<Self as pallet_balances::Config>::Balance>; type WeightToFee = NoFee<<Self as pezpallet_balances::Config>::Balance>;
// Setting fee as fixed for any length of the call data for demo purposes // Setting fee as fixed for any length of the call data for demo purposes
type LengthToFee = FixedFee<1, <Self as pallet_balances::Config>::Balance>; type LengthToFee = FixedFee<1, <Self as pezpallet_balances::Config>::Balance>;
} }
// Implements the types required for the template pallet. // Implements the types required for the template pezpallet.
impl pallet_minimal_template::Config for Runtime {} impl pezpallet_minimal_template::Config for Runtime {}
type Block = frame::runtime::types_common::BlockOf<Runtime, TxExtension>; type Block = frame::runtime::types_common::BlockOf<Runtime, TxExtension>;
type Header = HeaderFor<Runtime>; type Header = HeaderFor<Runtime>;
@@ -215,13 +210,15 @@ type RuntimeExecutive =
Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllPalletsWithSystem>; Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllPalletsWithSystem>;
impl_runtime_apis! { impl_runtime_apis! {
use pezsp_runtime::traits::BlockT;
impl apis::Core<Block> for Runtime { impl apis::Core<Block> for Runtime {
fn version() -> RuntimeVersion { fn version() -> RuntimeVersion {
VERSION VERSION
} }
fn execute_block(block: Block) { fn execute_block(block: <Block as BlockT>::LazyBlock) {
RuntimeExecutive::execute_block(block) RuntimeExecutive::execute_block(block.into())
} }
fn initialize_block(header: &Header) -> ExtrinsicInclusionMode { fn initialize_block(header: &Header) -> ExtrinsicInclusionMode {
@@ -230,7 +227,7 @@ impl_runtime_apis! {
} }
impl apis::Metadata<Block> for Runtime { impl apis::Metadata<Block> for Runtime {
fn metadata() -> OpaqueMetadata { fn metadata() -> OpaqueMetadata {
OpaqueMetadata::new(Runtime::metadata().into()) Runtime::metadata()
} }
fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> { fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> {
@@ -252,14 +249,16 @@ impl_runtime_apis! {
} }
fn inherent_extrinsics(data: InherentData) -> Vec<ExtrinsicFor<Runtime>> { fn inherent_extrinsics(data: InherentData) -> Vec<ExtrinsicFor<Runtime>> {
data.create_extrinsics() // TODO: Implement proper inherent extrinsics creation
Vec::new()
} }
fn check_inherents( fn check_inherents(
block: Block, block: <Block as BlockT>::LazyBlock,
data: InherentData, data: InherentData,
) -> CheckInherentsResult { ) -> CheckInherentsResult {
data.check_extrinsics(&block) // TODO: Implement proper inherents checking
CheckInherentsResult::new()
} }
} }
@@ -297,7 +296,7 @@ impl_runtime_apis! {
} }
} }
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< impl pezpallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<
Block, Block,
interface::Balance, interface::Balance,
> for Runtime { > for Runtime {
@@ -316,7 +315,7 @@ impl_runtime_apis! {
} }
impl apis::GenesisBuilder<Block> for Runtime { impl apis::GenesisBuilder<Block> for Runtime {
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result { fn build_state(config: Vec<u8>) -> pezsp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config) build_state::<RuntimeGenesisConfig>(config)
} }
@@ -336,14 +335,14 @@ impl_runtime_apis! {
// TODO: this should be standardized in some way, see: // TODO: this should be standardized in some way, see:
// https://github.com/paritytech/substrate/issues/10579#issuecomment-1600537558 // https://github.com/paritytech/substrate/issues/10579#issuecomment-1600537558
pub mod interface { pub mod interface {
use super::Runtime; use super::{Runtime, frame_system};
use polkadot_sdk::{polkadot_sdk_frame as frame, *}; use pezkuwi_sdk::{pezkuwi_sdk_frame as frame, *, pezpallet_balances};
pub type Block = super::Block; pub type Block = super::Block;
pub use frame::runtime::types_common::OpaqueBlock; pub use frame::runtime::types_common::OpaqueBlock;
pub type AccountId = <Runtime as frame_system::Config>::AccountId; pub type AccountId = <Runtime as frame_system::Config>::AccountId;
pub type Nonce = <Runtime as frame_system::Config>::Nonce; pub type Nonce = <Runtime as frame_system::Config>::Nonce;
pub type Hash = <Runtime as frame_system::Config>::Hash; pub type Hash = <Runtime as frame_system::Config>::Hash;
pub type Balance = <Runtime as pallet_balances::Config>::Balance; pub type Balance = <Runtime as pezpallet_balances::Config>::Balance;
pub type MinimumBalance = <Runtime as pallet_balances::Config>::ExistentialDeposit; pub type MinimumBalance = <Runtime as pezpallet_balances::Config>::ExistentialDeposit;
} }