fix: Complete snowbridge pezpallet rebrand and critical bug fixes
- snowbridge-pezpallet-* → pezsnowbridge-pezpallet-* (201 refs) - pallet/ directories → pezpallet/ (4 locations) - Fixed pezpallet.rs self-include recursion bug - Fixed sc-chain-spec hardcoded crate name in derive macro - Reverted .pezpallet_by_name() to .pallet_by_name() (subxt API) - Added BizinikiwiConfig type alias for zombienet tests - Deleted obsolete session state files Verified: pezsnowbridge-pezpallet-*, pezpallet-staking, pezpallet-staking-async, pezframe-benchmarking-cli all pass cargo check
This commit is contained in:
@@ -35,8 +35,8 @@
|
||||
- 🤏 This template is a minimal (in terms of complexity and the number of components)
|
||||
template for building a blockchain node.
|
||||
|
||||
- 🔧 Its runtime is configured with a single custom pallet as a starting point, and a handful of ready-made pallets
|
||||
such as a [Balances pallet](https://docs.pezkuwichain.io/sdk/master/pallet_balances/index.html).
|
||||
- 🔧 Its runtime is configured with a single custom pezpallet as a starting point, and a handful of ready-made pallets
|
||||
such as a [Balances pezpallet](https://docs.pezkuwichain.io/sdk/master/pallet_balances/index.html).
|
||||
|
||||
- 👤 The template has no consensus configured - it is best for experimenting with a single node network.
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Pallets
|
||||
|
||||
ℹ️ A pallet is a unit of encapsulated logic, with a clearly defined responsibility. A pallet is analogous to a
|
||||
ℹ️ A pezpallet is a unit of encapsulated logic, with a clearly defined responsibility. A pezpallet is analogous to a
|
||||
module in the runtime.
|
||||
|
||||
💁 In this template, there is a simple custom pallet based on the FRAME framework.
|
||||
💁 In this template, there is a simple custom pezpallet based on the FRAME framework.
|
||||
|
||||
👉 Learn more about FRAME
|
||||
[here](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html).
|
||||
|
||||
🧑🏫 Please refer to
|
||||
[this guide](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html)
|
||||
to learn how to write a basic pallet.
|
||||
to learn how to write a basic pezpallet.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "pezpallet-minimal-template"
|
||||
description = "A minimal pallet built with FRAME, part of Pezkuwi Sdk."
|
||||
description = "A minimal pezpallet built with FRAME, part of Pezkuwi Sdk."
|
||||
version = "0.0.0"
|
||||
license = "Unlicense"
|
||||
authors.workspace = true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! A shell pallet built with [`frame`].
|
||||
//! A shell pezpallet built with [`frame`].
|
||||
//!
|
||||
//! To get started with this pallet, try implementing the guide in
|
||||
//! To get started with this pezpallet, try implementing the guide in
|
||||
//! <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html>
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
@@ -8,19 +8,19 @@
|
||||
use frame::prelude::*;
|
||||
use pezkuwi_sdk::pezkuwi_sdk_frame as frame;
|
||||
|
||||
// Re-export all pallet parts, this is needed to properly import the pallet into the runtime.
|
||||
pub use pallet::*;
|
||||
// Re-export all pezpallet parts, this is needed to properly import the pezpallet into the runtime.
|
||||
pub use pezpallet::*;
|
||||
|
||||
#[frame::pallet]
|
||||
pub mod pallet {
|
||||
#[frame::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezkuwi_sdk::pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Value<T> = StorageValue<Value = u32>;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ serde_json = { workspace = true, default-features = false, features = [
|
||||
"alloc",
|
||||
] }
|
||||
|
||||
# local pallet templates
|
||||
# local pezpallet templates
|
||||
pezpallet-minimal-template = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
responsible for validating blocks and executing the state changes they define.
|
||||
|
||||
💁 The runtime in this template is constructed using ready-made FRAME pallets that ship with
|
||||
[Pezkuwi SDK](https://github.com/pezkuwichain/pezkuwi-sdk), and a [template for a custom pallet](../pallets/README.md).
|
||||
[Pezkuwi SDK](https://github.com/pezkuwichain/pezkuwi-sdk), and a [template for a custom pezpallet](../pallets/README.md).
|
||||
|
||||
👉 Learn more about FRAME
|
||||
[here](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html).
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! A minimal runtime that includes the template [`pallet`](`pezpallet_minimal_template`).
|
||||
//! A minimal runtime that includes the template [`pezpallet`](`pezpallet_minimal_template`).
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
@@ -145,59 +145,59 @@ mod 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::pezpallet_index(0)]
|
||||
pub type System = pezframe_system::Pallet<Runtime>;
|
||||
pub type System = pezframe_system::Pezpallet<Runtime>;
|
||||
|
||||
/// Provides a way for consensus systems to set and check the onchain time.
|
||||
#[runtime::pezpallet_index(1)]
|
||||
pub type Timestamp = pezpallet_timestamp::Pallet<Runtime>;
|
||||
pub type Timestamp = pezpallet_timestamp::Pezpallet<Runtime>;
|
||||
|
||||
/// Provides the ability to keep track of balances.
|
||||
#[runtime::pezpallet_index(2)]
|
||||
pub type Balances = pezpallet_balances::Pallet<Runtime>;
|
||||
pub type Balances = pezpallet_balances::Pezpallet<Runtime>;
|
||||
|
||||
/// Provides a way to execute privileged functions.
|
||||
#[runtime::pezpallet_index(3)]
|
||||
pub type Sudo = pezpallet_sudo::Pallet<Runtime>;
|
||||
pub type Sudo = pezpallet_sudo::Pezpallet<Runtime>;
|
||||
|
||||
/// Provides the ability to charge for extrinsic execution.
|
||||
#[runtime::pezpallet_index(4)]
|
||||
pub type TransactionPayment = pezpallet_transaction_payment::Pallet<Runtime>;
|
||||
pub type TransactionPayment = pezpallet_transaction_payment::Pezpallet<Runtime>;
|
||||
|
||||
/// A minimal pallet template.
|
||||
/// A minimal pezpallet template.
|
||||
#[runtime::pezpallet_index(5)]
|
||||
pub type Template = pezpallet_minimal_template::Pallet<Runtime>;
|
||||
pub type Template = pezpallet_minimal_template::Pezpallet<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const Version: RuntimeVersion = VERSION;
|
||||
}
|
||||
|
||||
/// Implements the types required for the system pallet.
|
||||
/// Implements the types required for the system pezpallet.
|
||||
#[derive_impl(pezframe_system::config_preludes::SolochainDefaultConfig)]
|
||||
impl pezframe_system::Config for Runtime {
|
||||
type Block = Block;
|
||||
type Version = Version;
|
||||
// Use the account data from the balances pallet
|
||||
// Use the account data from the balances pezpallet
|
||||
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(pezpallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_balances::Config for Runtime {
|
||||
type AccountStore = System;
|
||||
}
|
||||
|
||||
// Implements the types required for the sudo pallet.
|
||||
// Implements the types required for the sudo pezpallet.
|
||||
#[derive_impl(pezpallet_sudo::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_sudo::Config for Runtime {}
|
||||
|
||||
// Implements the types required for the sudo pallet.
|
||||
// Implements the types required for the sudo pezpallet.
|
||||
#[derive_impl(pezpallet_timestamp::config_preludes::TestDefaultConfig)]
|
||||
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(pezpallet_transaction_payment::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_transaction_payment::Config for Runtime {
|
||||
type OnChargeTransaction = pezpallet_transaction_payment::FungibleAdapter<Balances, ()>;
|
||||
@@ -207,7 +207,7 @@ impl pezpallet_transaction_payment::Config for Runtime {
|
||||
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 pezpallet_minimal_template::Config for Runtime {}
|
||||
|
||||
type Block = frame::runtime::types_common::BlockOf<Runtime, TxExtension>;
|
||||
|
||||
@@ -181,12 +181,12 @@ address [a variety of needs](https://bizinikiwi.pezkuwichain.app/ecosystem/proje
|
||||
Review the [FRAME runtime implementation](./runtime/src/lib.rs) included in this
|
||||
template and note the following:
|
||||
|
||||
- This file configures several pallets to include in the runtime. Each pallet
|
||||
- This file configures several pallets to include in the runtime. Each pezpallet
|
||||
configuration is defined by a code block that begins with `impl
|
||||
$PALLET_NAME::Config for Runtime`.
|
||||
- The pallets are composed into a single runtime by way of the
|
||||
[#[runtime]](https://docs.pezkuwichain.io/sdk/master/frame_support/attr.runtime.html)
|
||||
macro, which is part of the [core FRAME pallet
|
||||
macro, which is part of the [core FRAME pezpallet
|
||||
library](https://docs.pezkuwichain.io/reference/frame-pallets/#system-pallets).
|
||||
|
||||
### Pallets
|
||||
@@ -194,10 +194,10 @@ template and note the following:
|
||||
The runtime in this project is constructed using many FRAME pallets that ship
|
||||
with [the Bizinikiwi
|
||||
repository](https://github.com/pezkuwichain/pezkuwi-sdk/tree/master/bizinikiwi/frame) and a
|
||||
template pallet that is [defined in the
|
||||
template pezpallet that is [defined in the
|
||||
`pallets`](./pallets/template/src/lib.rs) directory.
|
||||
|
||||
A FRAME pallet is comprised of a number of blockchain primitives, including:
|
||||
A FRAME pezpallet is comprised of a number of blockchain primitives, including:
|
||||
|
||||
- Storage: FRAME defines a rich set of powerful [storage
|
||||
abstractions](https://docs.pezkuwichain.io/build/runtime-storage/) that makes it
|
||||
@@ -210,7 +210,7 @@ A FRAME pallet is comprised of a number of blockchain primitives, including:
|
||||
of significant state changes.
|
||||
- Errors: When a dispatchable fails, it returns an error.
|
||||
|
||||
Each pallet has its own `Config` trait which serves as a configuration interface
|
||||
Each pezpallet has its own `Config` trait which serves as a configuration interface
|
||||
to generically define the types and parameters it depends on.
|
||||
|
||||
## Alternatives Installations
|
||||
|
||||
@@ -30,7 +30,7 @@ impl RemarkBuilder {
|
||||
}
|
||||
|
||||
impl pezframe_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder {
|
||||
fn pallet(&self) -> &str {
|
||||
fn pezpallet(&self) -> &str {
|
||||
"system"
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ impl TransferKeepAliveBuilder {
|
||||
}
|
||||
|
||||
impl pezframe_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
|
||||
fn pallet(&self) -> &str {
|
||||
fn pezpallet(&self) -> &str {
|
||||
"balances"
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ pub fn run() -> pezsc_cli::Result<()> {
|
||||
// This switch needs to be in the client, since the client decides
|
||||
// which sub-commands it wants to support.
|
||||
match cmd {
|
||||
BenchmarkCmd::Pallet(cmd) => {
|
||||
BenchmarkCmd::Pezpallet(cmd) => {
|
||||
if !cfg!(feature = "runtime-benchmarks") {
|
||||
return Err(
|
||||
"Runtime benchmarking wasn't enabled when building the node. \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "pezpallet-template"
|
||||
description = "FRAME pallet template for defining custom runtime logic."
|
||||
description = "FRAME pezpallet template for defining custom runtime logic."
|
||||
version = "0.0.0"
|
||||
license = "Unlicense"
|
||||
authors.workspace = true
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use super::*;
|
||||
|
||||
#[allow(unused)]
|
||||
use crate::Pallet as Template;
|
||||
use crate::Pezpallet as Template;
|
||||
use pezframe_benchmarking::v2::*;
|
||||
use pezframe_system::RawOrigin;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//! # Template Pallet
|
||||
//! # Template Pezpallet
|
||||
//!
|
||||
//! A pallet with minimal functionality to help developers understand the essential components of
|
||||
//! writing a FRAME pallet. It is typically used in beginner tutorials or in Bizinikiwi template
|
||||
//! nodes as a starting point for creating a new pallet and **not meant to be used in production**.
|
||||
//! A pezpallet with minimal functionality to help developers understand the essential components of
|
||||
//! writing a FRAME pezpallet. It is typically used in beginner tutorials or in Bizinikiwi template
|
||||
//! nodes as a starting point for creating a new pezpallet and **not meant to be used in production**.
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
//! This template pallet contains basic examples of:
|
||||
//! This template pezpallet contains basic examples of:
|
||||
//! - declaring a storage item that stores a single `u32` value
|
||||
//! - declaring and using events
|
||||
//! - declaring and using errors
|
||||
@@ -14,98 +14,98 @@
|
||||
//! upon success
|
||||
//! - another dispatchable function that causes a custom error to be thrown
|
||||
//!
|
||||
//! Each pallet section is annotated with an attribute using the `#[pallet::...]` procedural macro.
|
||||
//! This macro generates the necessary code for a pallet to be aggregated into a FRAME runtime.
|
||||
//! Each pezpallet section is annotated with an attribute using the `#[pezpallet::...]` procedural macro.
|
||||
//! This macro generates the necessary code for a pezpallet to be aggregated into a FRAME runtime.
|
||||
//!
|
||||
//! Learn more about FRAME macros [here](https://docs.pezkuwichain.io/reference/frame-macros/).
|
||||
//!
|
||||
//! ### Pallet Sections
|
||||
//! ### Pezpallet Sections
|
||||
//!
|
||||
//! The pallet sections in this template are:
|
||||
//! The pezpallet sections in this template are:
|
||||
//!
|
||||
//! - A **configuration trait** that defines the types and parameters which the pallet depends on
|
||||
//! (denoted by the `#[pallet::config]` attribute). See: [`Config`].
|
||||
//! - A **means to store pezpallet-specific data** (denoted by the `#[pallet::storage]` attribute).
|
||||
//! - A **configuration trait** that defines the types and parameters which the pezpallet depends on
|
||||
//! (denoted by the `#[pezpallet::config]` attribute). See: [`Config`].
|
||||
//! - A **means to store pezpallet-specific data** (denoted by the `#[pezpallet::storage]` attribute).
|
||||
//! See: [`storage_types`].
|
||||
//! - A **declaration of the events** this pallet emits (denoted by the `#[pallet::event]`
|
||||
//! - A **declaration of the events** this pezpallet emits (denoted by the `#[pezpallet::event]`
|
||||
//! attribute). See: [`Event`].
|
||||
//! - A **declaration of the errors** that this pallet can throw (denoted by the `#[pallet::error]`
|
||||
//! - A **declaration of the errors** that this pezpallet can throw (denoted by the `#[pezpallet::error]`
|
||||
//! attribute). See: [`Error`].
|
||||
//! - A **set of dispatchable functions** that define the pallet's functionality (denoted by the
|
||||
//! `#[pallet::call]` attribute). See: [`dispatchables`].
|
||||
//! - A **set of dispatchable functions** that define the pezpallet's functionality (denoted by the
|
||||
//! `#[pezpallet::call]` attribute). See: [`dispatchables`].
|
||||
//!
|
||||
//! Run `cargo doc --package pezpallet-template --open` to view this pallet's documentation.
|
||||
//! Run `cargo doc --package pezpallet-template --open` to view this pezpallet's documentation.
|
||||
|
||||
// We make sure this pallet uses `no_std` for compiling to Wasm.
|
||||
// We make sure this pezpallet uses `no_std` for compiling to Wasm.
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
// Re-export pallet items so that they can be accessed from the crate namespace.
|
||||
pub use pallet::*;
|
||||
// Re-export pezpallet items so that they can be accessed from the crate namespace.
|
||||
pub use pezpallet::*;
|
||||
|
||||
// FRAME pallets require their own "mock runtimes" to be able to run unit tests. This module
|
||||
// contains a mock runtime specific for testing this pallet's functionality.
|
||||
// contains a mock runtime specific for testing this pezpallet's functionality.
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
||||
// This module contains the unit tests for this pallet.
|
||||
// Learn about pallet unit testing here: https://docs.pezkuwichain.io/test/unit-testing/
|
||||
// This module contains the unit tests for this pezpallet.
|
||||
// Learn about pezpallet unit testing here: https://docs.pezkuwichain.io/test/unit-testing/
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
// Every callable function or "dispatchable" a pallet exposes must have weight values that correctly
|
||||
// Every callable function or "dispatchable" a pezpallet exposes must have weight values that correctly
|
||||
// estimate a dispatchable's execution time. The benchmarking module is used to calculate weights
|
||||
// for each dispatchable and generates this pallet's weight.rs file. Learn more about benchmarking here: https://docs.pezkuwichain.io/test/benchmark/
|
||||
// for each dispatchable and generates this pezpallet's weight.rs file. Learn more about benchmarking here: https://docs.pezkuwichain.io/test/benchmark/
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
mod benchmarking;
|
||||
pub mod weights;
|
||||
pub use weights::*;
|
||||
|
||||
// All pallet logic is defined in its own module and must be annotated by the `pallet` attribute.
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
// All pezpallet logic is defined in its own module and must be annotated by the `pezpallet` attribute.
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
// Import various useful types required by all FRAME pallets.
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
// The `Pallet` struct serves as a placeholder to implement traits, methods and dispatchables
|
||||
// (`Call`s) in this pallet.
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
// The `Pezpallet` struct serves as a placeholder to implement traits, methods and dispatchables
|
||||
// (`Call`s) in this pezpallet.
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
/// The pallet's configuration trait.
|
||||
/// The pezpallet's configuration trait.
|
||||
///
|
||||
/// All our types and constants a pallet depends on must be declared here.
|
||||
/// These types are defined generically and made concrete when the pallet is declared in the
|
||||
/// All our types and constants a pezpallet depends on must be declared here.
|
||||
/// These types are defined generically and made concrete when the pezpallet is declared in the
|
||||
/// `runtime/src/lib.rs` file of your chain.
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// The overarching runtime event type.
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
/// A type representing the weights required by the dispatchables of this pallet.
|
||||
/// A type representing the weights required by the dispatchables of this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
/// A storage item for this pallet.
|
||||
/// A storage item for this pezpallet.
|
||||
///
|
||||
/// In this template, we are declaring a storage item called `Something` that stores a single
|
||||
/// `u32` value. Learn more about runtime storage here: <https://docs.pezkuwichain.io/build/runtime-storage/>
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Something<T> = StorageValue<_, u32>;
|
||||
|
||||
/// Events that functions in this pallet can emit.
|
||||
/// Events that functions in this pezpallet can emit.
|
||||
///
|
||||
/// Events are a simple means of indicating to the outside world (such as dApps, chain explorers
|
||||
/// or other users) that some notable update in the runtime has occurred. In a FRAME pallet, the
|
||||
/// or other users) that some notable update in the runtime has occurred. In a FRAME pezpallet, the
|
||||
/// documentation for each event field and its parameters is added to a node's metadata so it
|
||||
/// can be used by external interfaces or tools.
|
||||
///
|
||||
/// The `generate_deposit` macro generates a function on `Pallet` called `deposit_event` which
|
||||
/// will convert the event type of your pallet into `RuntimeEvent` (declared in the pallet's
|
||||
/// [`Config`] trait) and deposit it using [`pezframe_system::Pallet::deposit_event`].
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
/// The `generate_deposit` macro generates a function on `Pezpallet` called `deposit_event` which
|
||||
/// will convert the event type of your pezpallet into `RuntimeEvent` (declared in the pezpallet's
|
||||
/// [`Config`] trait) and deposit it using [`pezframe_system::Pezpallet::deposit_event`].
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// A user has successfully set a new value.
|
||||
SomethingStored {
|
||||
@@ -116,7 +116,7 @@ pub mod pallet {
|
||||
},
|
||||
}
|
||||
|
||||
/// Errors that can be returned by this pallet.
|
||||
/// Errors that can be returned by this pezpallet.
|
||||
///
|
||||
/// Errors tell users that something went wrong so it's important that their naming is
|
||||
/// informative. Similar to events, error documentation is added to a node's metadata so it's
|
||||
@@ -124,7 +124,7 @@ pub mod pallet {
|
||||
///
|
||||
/// This type of runtime error can be up to 4 bytes in size should you want to return additional
|
||||
/// information.
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// The value retrieved was `None` as no value was previously set.
|
||||
NoneValue,
|
||||
@@ -132,9 +132,9 @@ pub mod pallet {
|
||||
StorageOverflow,
|
||||
}
|
||||
|
||||
/// The pallet's dispatchable functions ([`Call`]s).
|
||||
/// The pezpallet's dispatchable functions ([`Call`]s).
|
||||
///
|
||||
/// Dispatchable functions allows users to interact with the pallet and invoke state changes.
|
||||
/// Dispatchable functions allows users to interact with the pezpallet and invoke state changes.
|
||||
/// These functions materialize as "extrinsics", which are often compared to transactions.
|
||||
/// They must always return a `DispatchResult` and be annotated with a weight and call index.
|
||||
///
|
||||
@@ -144,15 +144,15 @@ pub mod pallet {
|
||||
/// will also change which will break backwards compatibility.
|
||||
///
|
||||
/// The [`weight`] macro is used to assign a weight to each call.
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// An example dispatchable that takes a single u32 value as a parameter, writes the value
|
||||
/// to storage and emits an event.
|
||||
///
|
||||
/// It checks that the _origin_ for this call is _Signed_ and returns a dispatch
|
||||
/// error if it isn't. Learn more about origins here: <https://docs.pezkuwichain.io/build/origins/>
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(T::WeightInfo::do_something())]
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(T::WeightInfo::do_something())]
|
||||
pub fn do_something(origin: OriginFor<T>, something: u32) -> DispatchResult {
|
||||
// Check that the extrinsic was signed and get the signer.
|
||||
let who = ensure_signed(origin)?;
|
||||
@@ -180,8 +180,8 @@ pub mod pallet {
|
||||
/// - If no value has been set ([`Error::NoneValue`])
|
||||
/// - If incrementing the value in storage causes an arithmetic overflow
|
||||
/// ([`Error::StorageOverflow`])
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(T::WeightInfo::cause_error())]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight(T::WeightInfo::cause_error())]
|
||||
pub fn cause_error(origin: OriginFor<T>) -> DispatchResult {
|
||||
let _who = ensure_signed(origin)?;
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ mod runtime {
|
||||
pub struct Test;
|
||||
|
||||
#[runtime::pezpallet_index(0)]
|
||||
pub type System = pezframe_system::Pallet<Test>;
|
||||
pub type System = pezframe_system::Pezpallet<Test>;
|
||||
|
||||
#[runtime::pezpallet_index(1)]
|
||||
pub type Template = pezpallet_template::Pallet<Test>;
|
||||
pub type Template = pezpallet_template::Pezpallet<Test>;
|
||||
}
|
||||
|
||||
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
||||
|
||||
@@ -8,7 +8,7 @@ fn it_works_for_default_value() {
|
||||
System::set_block_number(1);
|
||||
// Dispatch a signed extrinsic.
|
||||
assert_ok!(Template::do_something(RuntimeOrigin::signed(1), 42));
|
||||
// Read pallet storage and assert an expected result.
|
||||
// Read pezpallet storage and assert an expected result.
|
||||
assert_eq!(Something::<Test>::get(), Some(42));
|
||||
// Assert that the correct event was deposited
|
||||
System::assert_last_event(Event::SomethingStored { something: 42, who: 1 }.into());
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
// Executed Command:
|
||||
// ../../target/release/node-template
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --chain
|
||||
// dev
|
||||
// --pallet
|
||||
// --pezpallet
|
||||
// pezpallet_template
|
||||
// --extrinsic
|
||||
// *
|
||||
|
||||
@@ -62,7 +62,7 @@ pezpallet-transaction-payment-rpc-runtime-api = { workspace = true }
|
||||
pezframe-benchmarking = { optional = true, workspace = true }
|
||||
pezframe-system-benchmarking = { optional = true, workspace = true }
|
||||
|
||||
# The pallet in this template.
|
||||
# The pezpallet in this template.
|
||||
pezpallet-template = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
|
||||
@@ -228,9 +228,9 @@ impl_runtime_apis! {
|
||||
) {
|
||||
use pezframe_benchmarking::{baseline, BenchmarkList};
|
||||
use pezframe_support::traits::StorageInfoTrait;
|
||||
use pezframe_system_benchmarking::Pallet as SystemBench;
|
||||
use pezframe_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
|
||||
use baseline::Pallet as BaselineBench;
|
||||
use pezframe_system_benchmarking::Pezpallet as SystemBench;
|
||||
use pezframe_system_benchmarking::extensions::Pezpallet as SystemExtensionsBench;
|
||||
use baseline::Pezpallet as BaselineBench;
|
||||
use super::*;
|
||||
|
||||
let mut list = Vec::<BenchmarkList>::new();
|
||||
@@ -247,9 +247,9 @@ impl_runtime_apis! {
|
||||
) -> Result<Vec<pezframe_benchmarking::BenchmarkBatch>, alloc::string::String> {
|
||||
use pezframe_benchmarking::{baseline, BenchmarkBatch};
|
||||
use pezsp_storage::TrackedStorageKey;
|
||||
use pezframe_system_benchmarking::Pallet as SystemBench;
|
||||
use pezframe_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
|
||||
use baseline::Pallet as BaselineBench;
|
||||
use pezframe_system_benchmarking::Pezpallet as SystemBench;
|
||||
use pezframe_system_benchmarking::extensions::Pezpallet as SystemExtensionsBench;
|
||||
use baseline::Pezpallet as BaselineBench;
|
||||
use super::*;
|
||||
|
||||
impl pezframe_system_benchmarking::Config for Runtime {}
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
- ☁️ It is based on the
|
||||
[Pezcumulus](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/pezcumulus/index.html) framework.
|
||||
|
||||
- 🔧 Its runtime is configured with a single custom pallet as a starting point, and a handful of ready-made pallets
|
||||
such as a [Balances pallet](https://docs.pezkuwichain.io/sdk/master/pallet_balances/index.html).
|
||||
- 🔧 Its runtime is configured with a single custom pezpallet as a starting point, and a handful of ready-made pallets
|
||||
such as a [Balances pezpallet](https://docs.pezkuwichain.io/sdk/master/pallet_balances/index.html).
|
||||
|
||||
- 👉 Learn more about teyrchains [here](https://wiki.network.pezkuwichain.io/docs/learn-parachains)
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
- ☁️ It is based on the
|
||||
[Pezcumulus](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/pezcumulus/index.html) framework.
|
||||
|
||||
- 🔧 Its runtime is configured with a single custom pallet as a starting point, and a handful of ready-made pallets
|
||||
such as a [Balances pallet](https://docs.pezkuwichain.io/sdk/master/pallet_balances/index.html).
|
||||
- 🔧 Its runtime is configured with a single custom pezpallet as a starting point, and a handful of ready-made pallets
|
||||
such as a [Balances pezpallet](https://docs.pezkuwichain.io/sdk/master/pallet_balances/index.html).
|
||||
|
||||
- 👉 Learn more about teyrchains [here](https://wiki.network.pezkuwichain.io/docs/learn-parachains)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ pub enum Subcommand {
|
||||
ExportGenesisWasm(pezcumulus_client_cli::ExportGenesisWasmCommand),
|
||||
|
||||
/// Sub-commands concerned with benchmarking.
|
||||
/// The pallet benchmarking moved to the `pallet` sub-command.
|
||||
/// The pezpallet benchmarking moved to the `pezpallet` sub-command.
|
||||
#[command(subcommand)]
|
||||
Benchmark(pezframe_benchmarking_cli::BenchmarkCmd),
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ pub fn run() -> Result<()> {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
// Switch on the concrete benchmark sub-command-
|
||||
match cmd {
|
||||
BenchmarkCmd::Pallet(cmd) =>
|
||||
BenchmarkCmd::Pezpallet(cmd) =>
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
runner.sync_run(|config| cmd.run_with_spec::<pezsp_runtime::traits::HashingFor<Block>, ReclaimHostFunctions>(Some(config.chain_spec)))
|
||||
} else {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Pallets
|
||||
|
||||
ℹ️ A pallet is a unit of encapsulated logic, with a clearly defined responsibility. A pallet is analogous to a
|
||||
ℹ️ A pezpallet is a unit of encapsulated logic, with a clearly defined responsibility. A pezpallet is analogous to a
|
||||
module in the runtime.
|
||||
|
||||
💁 In this template, there is a simple custom pallet based on the FRAME framework.
|
||||
💁 In this template, there is a simple custom pezpallet based on the FRAME framework.
|
||||
|
||||
👉 Learn more about FRAME
|
||||
[here](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html).
|
||||
|
||||
🧑🏫 Please refer to
|
||||
[this guide](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html)
|
||||
to learn how to write a basic pallet.
|
||||
to learn how to write a basic pezpallet.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "pezpallet-teyrchain-template"
|
||||
description = "FRAME pallet template for defining custom runtime logic."
|
||||
description = "FRAME pezpallet template for defining custom runtime logic."
|
||||
version = "0.0.0"
|
||||
license = "Unlicense"
|
||||
authors.workspace = true
|
||||
|
||||
@@ -7,7 +7,7 @@ use frame::{deps::pezframe_benchmarking::v2::*, prelude::*};
|
||||
mod benchmarks {
|
||||
use super::*;
|
||||
#[cfg(test)]
|
||||
use crate::pallet::Pallet as Template;
|
||||
use crate::pezpallet::Pezpallet as Template;
|
||||
use pezframe_system::RawOrigin;
|
||||
|
||||
#[benchmark]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//! # Template Pallet
|
||||
//! # Template Pezpallet
|
||||
//!
|
||||
//! A pallet with minimal functionality to help developers understand the essential components of
|
||||
//! writing a FRAME pallet. It is typically used in beginner tutorials or in Pezkuwi SDK template
|
||||
//! as a starting point for creating a new pallet and **not meant to be used in production**.
|
||||
//! A pezpallet with minimal functionality to help developers understand the essential components of
|
||||
//! writing a FRAME pezpallet. It is typically used in beginner tutorials or in Pezkuwi SDK template
|
||||
//! as a starting point for creating a new pezpallet and **not meant to be used in production**.
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
//! This template pallet contains basic examples of:
|
||||
//! This template pezpallet contains basic examples of:
|
||||
//! - declaring a storage item that stores a single block-number
|
||||
//! - declaring and using events
|
||||
//! - declaring and using errors
|
||||
@@ -14,10 +14,10 @@
|
||||
//! upon success
|
||||
//! - another dispatchable function that causes a custom error to be thrown
|
||||
//!
|
||||
//! Each pallet section is annotated with an attribute using the `#[pallet::...]` procedural macro.
|
||||
//! This macro generates the necessary code for a pallet to be aggregated into a FRAME runtime.
|
||||
//! Each pezpallet section is annotated with an attribute using the `#[pezpallet::...]` procedural macro.
|
||||
//! This macro generates the necessary code for a pezpallet to be aggregated into a FRAME runtime.
|
||||
//!
|
||||
//! To get started with pallet development, consider using this tutorial:
|
||||
//! To get started with pezpallet development, consider using this tutorial:
|
||||
//!
|
||||
//! <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html>
|
||||
//!
|
||||
@@ -26,28 +26,28 @@
|
||||
//! <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html>
|
||||
//!
|
||||
//! And looking at the frame [`kitchen-sink`](https://docs.pezkuwichain.io/sdk/master/pezpallet_example_kitchensink/index.html)
|
||||
//! pallet, a showcase of all pallet macros.
|
||||
//! pezpallet, a showcase of all pezpallet macros.
|
||||
//!
|
||||
//! ### Pallet Sections
|
||||
//! ### Pezpallet Sections
|
||||
//!
|
||||
//! The pallet sections in this template are:
|
||||
//! The pezpallet sections in this template are:
|
||||
//!
|
||||
//! - A **configuration trait** that defines the types and parameters which the pallet depends on
|
||||
//! (denoted by the `#[pallet::config]` attribute). See: [`Config`].
|
||||
//! - A **means to store pezpallet-specific data** (denoted by the `#[pallet::storage]` attribute).
|
||||
//! - A **configuration trait** that defines the types and parameters which the pezpallet depends on
|
||||
//! (denoted by the `#[pezpallet::config]` attribute). See: [`Config`].
|
||||
//! - A **means to store pezpallet-specific data** (denoted by the `#[pezpallet::storage]` attribute).
|
||||
//! See: [`storage_types`].
|
||||
//! - A **declaration of the events** this pallet emits (denoted by the `#[pallet::event]`
|
||||
//! - A **declaration of the events** this pezpallet emits (denoted by the `#[pezpallet::event]`
|
||||
//! attribute). See: [`Event`].
|
||||
//! - A **declaration of the errors** that this pallet can throw (denoted by the `#[pallet::error]`
|
||||
//! - A **declaration of the errors** that this pezpallet can throw (denoted by the `#[pezpallet::error]`
|
||||
//! attribute). See: [`Error`].
|
||||
//! - A **set of dispatchable functions** that define the pallet's functionality (denoted by the
|
||||
//! `#[pallet::call]` attribute). See: [`dispatchables`].
|
||||
//! - A **set of dispatchable functions** that define the pezpallet's functionality (denoted by the
|
||||
//! `#[pezpallet::call]` attribute). See: [`dispatchables`].
|
||||
//!
|
||||
//! Run `cargo doc --package pezpallet-template --open` to view this pallet's documentation.
|
||||
//! Run `cargo doc --package pezpallet-template --open` to view this pezpallet's documentation.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
@@ -63,25 +63,25 @@ mod benchmarking;
|
||||
// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html>
|
||||
// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html>
|
||||
//
|
||||
// To see a full list of `pallet` macros and their use cases, see:
|
||||
// To see a full list of `pezpallet` macros and their use cases, see:
|
||||
// <https://docs.pezkuwichain.io/sdk/master/pezpallet_example_kitchensink/index.html>
|
||||
// <https://docs.pezkuwichain.io/sdk/master/pezframe_support/pezpallet_macros/index.html>
|
||||
#[frame::pallet]
|
||||
pub mod pallet {
|
||||
#[frame::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use frame::prelude::*;
|
||||
|
||||
/// Configure the pallet by specifying the parameters and types on which it depends.
|
||||
#[pallet::config]
|
||||
/// Configure the pezpallet by specifying the parameters and types on which it depends.
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
|
||||
/// A type representing the weights required by the dispatchables of this pallet.
|
||||
/// A type representing the weights required by the dispatchables of this pezpallet.
|
||||
type WeightInfo: crate::weights::WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
/// A struct to store a single block-number. Has all the right derives to store it in storage.
|
||||
/// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/reference_docs/frame_storage_derives/index.html>
|
||||
@@ -94,16 +94,16 @@ pub mod pallet {
|
||||
pub(crate) block_number: BlockNumberFor<T>,
|
||||
}
|
||||
|
||||
/// The pallet's storage items.
|
||||
/// The pezpallet's storage items.
|
||||
/// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html#storage>
|
||||
/// <https://docs.pezkuwichain.io/sdk/master/pezframe_support/pezpallet_macros/attr.storage.html>
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Something<T: Config> = StorageValue<_, CompositeStruct<T>>;
|
||||
|
||||
/// Pallets use events to inform users when important changes are made.
|
||||
/// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html#event-and-error>
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// We usually use passive tense for events.
|
||||
SomethingStored { block_number: BlockNumberFor<T>, who: T::AccountId },
|
||||
@@ -111,7 +111,7 @@ pub mod pallet {
|
||||
|
||||
/// Errors inform users that something went wrong.
|
||||
/// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html#event-and-error>
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// Error names should be descriptive.
|
||||
NoneValue,
|
||||
@@ -119,19 +119,19 @@ pub mod pallet {
|
||||
StorageOverflow,
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
#[pezpallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
|
||||
|
||||
/// Dispatchable functions allows users to interact with the pallet and invoke state changes.
|
||||
/// Dispatchable functions allows users to interact with the pezpallet and invoke state changes.
|
||||
/// These functions materialize as "extrinsics", which are often compared to transactions.
|
||||
/// Dispatchable functions must be annotated with a weight and must return a DispatchResult.
|
||||
/// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html#dispatchables>
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// An example dispatchable that takes a singles value as a parameter, writes the value to
|
||||
/// storage and emits an event. This function must be dispatched by a signed extrinsic.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(Weight::from_parts(10_000, 0) + T::DbWeight::get().writes(1))]
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(Weight::from_parts(10_000, 0) + T::DbWeight::get().writes(1))]
|
||||
pub fn do_something(origin: OriginFor<T>, bn: u32) -> DispatchResultWithPostInfo {
|
||||
// Check that the extrinsic was signed and get the signer.
|
||||
// This function will return an error if the extrinsic is not signed.
|
||||
@@ -153,8 +153,8 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// An example dispatchable that may throw a custom error.
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(Weight::from_parts(10_000, 0) + T::DbWeight::get().reads_writes(1,1))]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight(Weight::from_parts(10_000, 0) + T::DbWeight::get().reads_writes(1,1))]
|
||||
pub fn cause_error(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
|
||||
let _who = ensure_signed(origin)?;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use frame::{
|
||||
testing_prelude::*,
|
||||
};
|
||||
|
||||
// Configure a mock runtime to test the pallet.
|
||||
// Configure a mock runtime to test the pezpallet.
|
||||
#[frame_construct_runtime]
|
||||
mod test_runtime {
|
||||
#[runtime::runtime]
|
||||
|
||||
@@ -6,7 +6,7 @@ fn it_works_for_default_value() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Dispatch a signed extrinsic.
|
||||
assert_ok!(Template::do_something(RuntimeOrigin::signed(1), 42));
|
||||
// Read pallet storage and assert an expected result.
|
||||
// Read pezpallet storage and assert an expected result.
|
||||
assert_eq!(Something::<Test>::get().map(|v| v.block_number), Some(42));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
// Executed Command:
|
||||
// ../../target/release/node-template
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --chain
|
||||
// dev
|
||||
// --pallet
|
||||
// --pezpallet
|
||||
// pezpallet_template
|
||||
// --extrinsic
|
||||
// *
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
responsible for validating blocks and executing the state changes they define.
|
||||
|
||||
💁 The runtime in this template is constructed using ready-made FRAME pallets that ship with
|
||||
[Pezkuwi SDK](https://github.com/pezkuwichain/pezkuwi-sdk), and a [template for a custom pallet](../pallets/README.md).
|
||||
[Pezkuwi SDK](https://github.com/pezkuwichain/pezkuwi-sdk), and a [template for a custom pezpallet](../pallets/README.md).
|
||||
|
||||
👉 Learn more about FRAME
|
||||
[here](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html).
|
||||
|
||||
@@ -261,8 +261,8 @@ impl_runtime_apis! {
|
||||
) {
|
||||
use pezframe_benchmarking::BenchmarkList;
|
||||
use pezkuwi_sdk::pezframe_support::traits::StorageInfoTrait;
|
||||
use pezframe_system_benchmarking::Pallet as SystemBench;
|
||||
use pezcumulus_pezpallet_session_benchmarking::Pallet as SessionBench;
|
||||
use pezframe_system_benchmarking::Pezpallet as SystemBench;
|
||||
use pezcumulus_pezpallet_session_benchmarking::Pezpallet as SessionBench;
|
||||
use super::*;
|
||||
|
||||
let mut list = Vec::<BenchmarkList>::new();
|
||||
@@ -279,7 +279,7 @@ impl_runtime_apis! {
|
||||
use pezframe_benchmarking::{BenchmarkError, BenchmarkBatch};
|
||||
use super::*;
|
||||
|
||||
use pezframe_system_benchmarking::Pallet as SystemBench;
|
||||
use pezframe_system_benchmarking::Pezpallet as SystemBench;
|
||||
impl pezframe_system_benchmarking::Config for Runtime {
|
||||
fn setup_set_code_requirements(code: &Vec<u8>) -> Result<(), BenchmarkError> {
|
||||
TeyrchainSystem::initialize_for_set_code_benchmark(code.len() as u32);
|
||||
@@ -291,7 +291,7 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
use pezcumulus_pezpallet_session_benchmarking::Pallet as SessionBench;
|
||||
use pezcumulus_pezpallet_session_benchmarking::Pezpallet as SessionBench;
|
||||
impl pezcumulus_pezpallet_session_benchmarking::Config for Runtime {}
|
||||
|
||||
use pezkuwi_sdk::pezframe_support::traits::WhitelistedStorageKeys;
|
||||
@@ -301,7 +301,7 @@ impl_runtime_apis! {
|
||||
let params = (&config, &whitelist);
|
||||
add_benchmarks!(params, batches);
|
||||
|
||||
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
|
||||
if batches.is_empty() { return Err("Benchmark not found for this pezpallet.".into()) }
|
||||
Ok(batches)
|
||||
}
|
||||
}
|
||||
@@ -322,7 +322,7 @@ impl_runtime_apis! {
|
||||
|
||||
impl pezcumulus_primitives_core::GetTeyrchainInfo<Block> for Runtime {
|
||||
fn teyrchain_id() -> ParaId {
|
||||
teyrchain_info::Pallet::<Runtime>::teyrchain_id()
|
||||
teyrchain_info::Pezpallet::<Runtime>::teyrchain_id()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ impl pezcumulus_pezpallet_teyrchain_system::Config for Runtime {
|
||||
type WeightInfo = ();
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnSystemEvent = ();
|
||||
type SelfParaId = teyrchain_info::Pallet<Runtime>;
|
||||
type SelfParaId = teyrchain_info::Pezpallet<Runtime>;
|
||||
type OutboundXcmpMessageSource = XcmpQueue;
|
||||
type DmpQueue = pezframe_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
|
||||
type ReservedDmpWeight = ReservedDmpWeight;
|
||||
@@ -239,7 +239,7 @@ impl pezpallet_message_queue::Config for Runtime {
|
||||
RuntimeCall,
|
||||
>;
|
||||
type Size = u32;
|
||||
// The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin:
|
||||
// The XCMP queue pezpallet is only ever able to handle the `Sibling(ParaId)` origin:
|
||||
type QueueChangeHandler = NarrowOriginToSibling<XcmpQueue>;
|
||||
type QueuePausedQuery = NarrowOriginToSibling<XcmpQueue>;
|
||||
type HeapSize = pezsp_core::ConstU32<{ 103 * 1024 }>;
|
||||
@@ -341,7 +341,7 @@ impl pezpallet_collator_selection::Config for Runtime {
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
/// Configure the pallet template in pallets/template.
|
||||
/// Configure the pezpallet template in pallets/template.
|
||||
impl pezpallet_teyrchain_template::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WeightInfo = pezpallet_teyrchain_template::weights::BizinikiwiWeight<Runtime>;
|
||||
|
||||
@@ -84,7 +84,7 @@ pub type XcmOriginToTransactDispatchOrigin = (
|
||||
// Native signed account converter; this just converts an `AccountId32` origin into a normal
|
||||
// `RuntimeOrigin::Signed` origin of the same 32-byte value.
|
||||
SignedAccountId32AsNative<RelayNetwork, RuntimeOrigin>,
|
||||
// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
|
||||
// Xcm origins can be represented natively under the Xcm pezpallet's Xcm origin.
|
||||
XcmPassthrough<RuntimeOrigin>,
|
||||
);
|
||||
|
||||
@@ -175,7 +175,7 @@ impl pezpallet_xcm::Config for Runtime {
|
||||
type XcmRouter = XcmRouter;
|
||||
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
|
||||
type XcmExecuteFilter = Nothing;
|
||||
// ^ Disable dispatchable execute on the XCM pallet.
|
||||
// ^ Disable dispatchable execute on the XCM pezpallet.
|
||||
// Needs to be `Everything` for local testing.
|
||||
type XcmExecutor = XcmExecutor<XcmConfig>;
|
||||
type XcmTeleportFilter = Everything;
|
||||
|
||||
Reference in New Issue
Block a user