FAZ 1 Complete: Workspace compile fixes, warning cleanup, version bumps

- Fixed is_using_frame_crate() macro to check for pezframe/pezkuwi_sdk
- Removed disable_pezframe_system_supertrait_check temporary bypasses
- Feature-gated storage-benchmark and teyrchain-benchmarks code
- Fixed dead_code warnings with underscore prefix (_Header)
- Removed unused imports and shadowing use statements
- Version bumps: procedural-tools 10.0.1, benchmarking-cli 32.0.1,
  docs 0.0.2, minimal-runtime 0.0.1, yet-another-teyrchain 0.6.1, umbrella 0.1.2
- Updated MAINNET_ROADMAP.md with FAZ 1 completion status
This commit is contained in:
2026-01-02 11:41:09 +03:00
parent ed44adfb1e
commit 241bace6ad
516 changed files with 3723 additions and 3665 deletions
@@ -188,7 +188,7 @@
//! pez_chain_spec_guide_runtime::runtime::RuntimeGenesisConfig
//! [`FooStruct`]:
//! pez_chain_spec_guide_runtime::pallets::FooStruct
//! [`impl_runtime_apis`]: frame::runtime::prelude::impl_runtime_apis
//! [`impl_runtime_apis`]: pezframe::runtime::prelude::impl_runtime_apis
//! [`build_state`]: pezframe_support::genesis_builder_helper::build_state
//! [`get_preset`]: pezframe_support::genesis_builder_helper::get_preset
//! [`pezpallet::genesis_build`]: pezframe_support::pezpallet_macros::genesis_build
@@ -14,14 +14,16 @@ documentation.workspace = true
codec = { workspace = true }
docify = { workspace = true }
pezframe-support = { workspace = true }
pezframe-system = { workspace = true }
scale-info = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
# this is a frame-based runtime, thus importing `frame` with runtime feature enabled.
frame = { features = ["experimental", "runtime"], workspace = true }
pezframe = { features = ["experimental", "runtime"], workspace = true }
# genesis builder that allows us to interact with runtime genesis config
pezsp-api = { workspace = true }
pezsp-application-crypto = { features = ["serde"], workspace = true }
pezsp-core = { workspace = true }
pezsp-genesis-builder = { workspace = true }
@@ -41,9 +43,11 @@ std = [
"codec/std",
"scale-info/std",
"frame/std",
"pezframe/std",
"pezframe-support/std",
"pezframe-system/std",
"pezsp-api/std",
"pezsp-application-crypto/std",
"pezsp-core/std",
"pezsp-genesis-builder/std",
@@ -56,7 +60,7 @@ std = [
]
runtime-benchmarks = [
"bizinikiwi-wasm-builder?/runtime-benchmarks",
"frame/runtime-benchmarks",
"pezframe/runtime-benchmarks",
"pezframe-support/runtime-benchmarks",
"pezsc-chain-spec/runtime-benchmarks",
"pezsp-genesis-builder/runtime-benchmarks",
@@ -18,10 +18,10 @@
//! Pallets for the chain-spec demo runtime.
use alloc::vec::Vec;
use frame::prelude::*;
use pezframe::prelude::*;
#[docify::export]
#[frame::pezpallet(dev_mode)]
#[pezframe::pezpallet(dev_mode)]
pub mod pezpallet_bar {
use super::*;
@@ -94,7 +94,7 @@ pub enum FooEnum {
}
#[docify::export]
#[frame::pezpallet(dev_mode)]
#[pezframe::pezpallet(dev_mode)]
pub mod pezpallet_foo {
use super::*;
@@ -26,15 +26,14 @@ use crate::{
presets::*,
};
use alloc::{vec, vec::Vec};
use frame::{
deps::pezframe_support::{
genesis_builder_helper::{build_state, get_preset},
runtime,
},
use pezframe::{
deps::pezframe_support::genesis_builder_helper::{build_state, get_preset},
prelude::*,
runtime::{apis, prelude::*},
runtime::prelude::*,
};
use pezsp_api::impl_runtime_apis;
use pezsp_genesis_builder::PresetId;
use pezsp_runtime::traits::Block as BlockT;
/// The runtime version.
#[runtime_version]
@@ -53,7 +52,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
type SignedExtra = ();
// Composes the runtime by adding all the used pallets and deriving necessary types.
#[runtime]
#[frame_construct_runtime]
mod runtime {
/// The main runtime type.
#[runtime::runtime]
@@ -69,15 +68,15 @@ mod runtime {
/// Mandatory system pezpallet that should always be included in a FRAME runtime.
#[runtime::pezpallet_index(0)]
pub type System = pezframe_system;
pub type System = pezframe_system::Pezpallet<Runtime>;
/// Sample pezpallet 1
#[runtime::pezpallet_index(1)]
pub type Bar = pezpallet_bar;
pub type Bar = pezpallet_bar::Pezpallet<Runtime>;
/// Sample pezpallet 2
#[runtime::pezpallet_index(2)]
pub type Foo = pezpallet_foo;
pub type Foo = pezpallet_foo::Pezpallet<Runtime>;
}
parameter_types! {
@@ -94,8 +93,8 @@ impl pezframe_system::Config for Runtime {
impl pezpallet_bar::Config for Runtime {}
impl pezpallet_foo::Config for Runtime {}
type Block = frame::runtime::types_common::BlockOf<Runtime, SignedExtra>;
type Header = HeaderFor<Runtime>;
type Block = pezframe::runtime::types_common::BlockOf<Runtime, SignedExtra>;
type _Header = HeaderFor<Runtime>;
#[docify::export(runtime_impl)]
impl_runtime_apis! {
@@ -119,9 +118,9 @@ impl_runtime_apis! {
}
}
impl apis::Core<Block> for Runtime {
impl pezsp_api::Core<Block> for Runtime {
fn version() -> RuntimeVersion { VERSION }
fn execute_block(_: <Block as frame::traits::Block>::LazyBlock) { }
fn initialize_block(_: &Header) -> ExtrinsicInclusionMode { ExtrinsicInclusionMode::default() }
fn execute_block(_: <Block as BlockT>::LazyBlock) { }
fn initialize_block(_: &<Block as BlockT>::Header) -> ExtrinsicInclusionMode { ExtrinsicInclusionMode::default() }
}
}
@@ -70,18 +70,18 @@
//!
//! ### Defensive Traits
//!
//! The [`Defensive`](frame::traits::Defensive) trait provides a number of functions, all of which
//! The [`Defensive`](pezframe::traits::Defensive) trait provides a number of functions, all of which
//! provide an alternative to 'vanilla' Rust functions, e.g.:
//!
//! - [`defensive_unwrap_or()`](frame::traits::Defensive::defensive_unwrap_or) instead of
//! - [`defensive_unwrap_or()`](pezframe::traits::Defensive::defensive_unwrap_or) instead of
//! `unwrap_or()`
//! - [`defensive_ok_or()`](frame::traits::DefensiveOption::defensive_ok_or) instead of `ok_or()`
//! - [`defensive_ok_or()`](pezframe::traits::DefensiveOption::defensive_ok_or) instead of `ok_or()`
//!
//! Defensive methods use [`debug_assertions`](https://doc.rust-lang.org/reference/conditional-compilation.html#debug_assertions), which panic in development, but in
//! production/release, they will merely log an error (i.e., `log::error`).
//!
//! The [`Defensive`](frame::traits::Defensive) trait and its various implementations can be found
//! [here](frame::traits::Defensive).
//! The [`Defensive`](pezframe::traits::Defensive) trait and its various implementations can be found
//! [here](pezframe::traits::Defensive).
//!
//! ## Integer Overflow
//!
@@ -188,8 +188,8 @@
//! to avoid introducing the notion of any potential-panic or wrapping behavior.
//!
//! There is also a series of defensive alternatives via
//! [`DefensiveSaturating`](frame::traits::DefensiveSaturating), which introduces the same behavior
//! of the [`Defensive`](frame::traits::Defensive) trait, only with saturating, mathematical
//! [`DefensiveSaturating`](pezframe::traits::DefensiveSaturating), which introduces the same behavior
//! of the [`Defensive`](pezframe::traits::Defensive) trait, only with saturating, mathematical
//! operations:
#![doc = docify::embed!(
"./src/reference_docs/defensive_programming.rs",
@@ -278,7 +278,7 @@
//! actually cause harm to the network, and thus stalling would be the better option.
//!
//! Take the example of the BABE pezpallet ([`pezpallet_babe`]), which doesn't allow for a validator
//! to participate if it is disabled (see: [`frame::traits::DisabledValidators`]):
//! to participate if it is disabled (see: [`pezframe::traits::DisabledValidators`]):
//!
//! ```ignore
//! if T::DisabledValidators::is_disabled(authority_index) {
@@ -359,7 +359,7 @@ mod fake_runtime_types {
#[cfg(test)]
mod tests {
use frame::traits::DefensiveSaturating;
use pezframe::traits::DefensiveSaturating;
#[docify::export]
#[test]
fn checked_add_example() {
@@ -37,7 +37,7 @@
//!
//! ## compact_encoded_length
//!
//! This is a [SCALE compact encoded][frame::deps::codec::Compact] integer which is equal to the
//! This is a [SCALE compact encoded][pezframe::deps::codec::Compact] integer which is equal to the
//! length, in bytes, of the rest of the extrinsic details.
//!
//! To obtain this value, we must encode and concatenate together the rest of the extrinsic details
@@ -90,7 +90,7 @@
//!
//! #### from_address
//!
//! This is the [SCALE encoded][frame::deps::codec] address of the sender of the extrinsic. The
//! This is the [SCALE encoded][pezframe::deps::codec] address of the sender of the extrinsic. The
//! address is the first generic parameter of [`pezsp_runtime::generic::UncheckedExtrinsic`], and so
//! can vary from chain to chain.
//!
@@ -102,7 +102,7 @@
//!
//! #### signature
//!
//! This is the [SCALE encoded][frame::deps::codec] signature. The signature type is configured via
//! This is the [SCALE encoded][pezframe::deps::codec] signature. The signature type is configured via
//! the third generic parameter of [`pezsp_runtime::generic::UncheckedExtrinsic`], which determines
//! the shape of the signature and signing algorithm that should be used.
//!
@@ -121,7 +121,7 @@
//!
//! ### transaction_extensions_extra
//!
//! This is the concatenation of the [SCALE encoded][frame::deps::codec] bytes representing first a
//! This is the concatenation of the [SCALE encoded][pezframe::deps::codec] bytes representing first a
//! single byte describing the extension version (this is bumped whenever a change occurs in the
//! transaction extension pipeline) followed by the bytes of each of the [_transaction
//! extensions_][pezsp_runtime::traits::TransactionExtension], and are configured by the fourth
@@ -142,11 +142,11 @@
//! configuration. At the time of writing, Pezkuwi configures them
//! [here](https://github.com/polkadot-fellows/runtimes/blob/1dc04eb954eadf8aadb5d83990b89662dbb5a074/relay/polkadot/src/lib.rs#L1432C25-L1432C25).
//! Some of the common transaction extensions are defined
//! [here][frame::deps::pezframe_system#transaction-extensions].
//! [here][pezframe::deps::pezframe_system#transaction-extensions].
//!
//! Information about exactly which transaction extensions are present on a chain and in what order
//! is also a part of the metadata for the chain. For V15 metadata, it can be [found
//! here][frame::deps::pezframe_support::__private::metadata::v15::ExtrinsicMetadata].
//! here][pezframe::deps::pezframe_support::__private::metadata::v15::ExtrinsicMetadata].
//!
//! ## call_data
//!
@@ -154,7 +154,7 @@
//! altered. This is defined by the second generic parameter of
//! [`pezsp_runtime::generic::UncheckedExtrinsic`].
//!
//! A call can be anything that implements [`Encode`][frame::deps::codec::Encode]. In FRAME-based
//! A call can be anything that implements [`Encode`][pezframe::deps::codec::Encode]. In FRAME-based
//! runtimes, a call is represented as an enum of enums, where the outer enum represents the FRAME
//! pezpallet being called, and the inner enum represents the call being made within that pezpallet,
//! and any arguments to it. Read more about the call enum
@@ -183,7 +183,7 @@
//! Information about the pallets that exist for a chain (including their indexes), the calls
//! available in each pezpallet (including their indexes), and the arguments required for each call
//! can be found in the metadata for the chain. For V15 metadata, this information [is
//! here][frame::deps::pezframe_support::__private::metadata::v15::PalletMetadata].
//! here][pezframe::deps::pezframe_support::__private::metadata::v15::PalletMetadata].
//!
//! # The Signed Payload Format
//!
+2 -2
View File
@@ -57,7 +57,7 @@
//! ]
//! ```
//!
//! More conveniently, the `frame` umbrella crate re-exports the log crate as [`frame::log`].
//! More conveniently, the `frame` umbrella crate re-exports the log crate as [`pezframe::log`].
//!
//! Then, the pezpallet can use this crate to emit log statements. In this statement, we use the
//! info level, and the target is `pezpallet-example`.
@@ -68,7 +68,7 @@
//!
//! impl Pezpallet {
//! fn logs() {
//! frame::log::info!(target: "pezpallet-example", "Hello, world!");
//! pezframe::log::info!(target: "pezpallet-example", "Hello, world!");
//! }
//! }
//! }
@@ -54,13 +54,13 @@
//! ## FRAME's API
//!
//! [`frame`] provides a simple API through which pallets can define offchain worker functions. This
//! is part of [`frame::traits::Hooks`], which is implemented as a part of
//! [`frame::pezpallet_macros::hooks`].
//! is part of [`pezframe::traits::Hooks`], which is implemented as a part of
//! [`pezframe::pezpallet_macros::hooks`].
//!
//! ```
//! #[frame::pezpallet]
//! #[pezframe::pezpallet]
//! pub mod pezpallet {
//! use frame::prelude::*;
//! use pezframe::prelude::*;
//!
//! #[pezpallet::config]
//! pub trait Config: pezframe_system::Config {}
@@ -95,7 +95,7 @@
//! API into the WASM blob are:
//!
//! * Accessing the state is easier within the `offchain_worker` function, as it is already a part
//! of the runtime, and [`frame::pezpallet_macros::storage`] provides all the tools needed to read
//! of the runtime, and [`pezframe::pezpallet_macros::storage`] provides all the tools needed to read
//! the state. Other client libraries might provide varying degrees of capability here.
//! * It will be updated in synchrony with the runtime. A Bizinikiwi's offchain application is part
//! of the same WASM blob, and is therefore guaranteed to be up to date.
+12 -12
View File
@@ -93,13 +93,13 @@
//! Then, within the pezpallet, we can simply use this "unknown" origin check type:
#![doc = docify::embed!("./src/reference_docs/frame_origin.rs", external_origin_usage)]
//!
//! Finally, at the runtime, any implementation of [`frame::traits::EnsureOrigin`] can be passed.
//! Finally, at the runtime, any implementation of [`pezframe::traits::EnsureOrigin`] can be passed.
#![doc = docify::embed!("./src/reference_docs/frame_origin.rs", external_origin_provide)]
//!
//! Indeed, some of these implementations of [`frame::traits::EnsureOrigin`] are similar to the ones
//! that we know about: [`frame::runtime::prelude::EnsureSigned`],
//! [`frame::runtime::prelude::EnsureSignedBy`], [`frame::runtime::prelude::EnsureRoot`],
//! [`frame::runtime::prelude::EnsureNone`], etc. But, there are also many more that are not known
//! Indeed, some of these implementations of [`pezframe::traits::EnsureOrigin`] are similar to the ones
//! that we know about: [`pezframe::runtime::prelude::EnsureSigned`],
//! [`pezframe::runtime::prelude::EnsureSignedBy`], [`pezframe::runtime::prelude::EnsureRoot`],
//! [`pezframe::runtime::prelude::EnsureNone`], etc. But, there are also many more that are not known
//! to us, and are defined in other pallets.
//!
//! For example, [`pezpallet_collective`] defines [`pezpallet_collective::EnsureMember`] and
@@ -107,7 +107,7 @@
//! alluded to earlier in this document.
//!
//! Make sure to check the full list of [implementors of
//! `EnsureOrigin`](frame::traits::EnsureOrigin#implementors) for more inspiration.
//! `EnsureOrigin`](pezframe::traits::EnsureOrigin#implementors) for more inspiration.
//!
//! ## Obtaining Abstract Origins
//!
@@ -129,9 +129,9 @@
//! [^1]: Inherents are essentially unsigned extrinsics that need an [`pezframe_system::ensure_none`]
//! origin check, and through the virtue of being an inherent, are agreed upon by all validators.
use frame::prelude::*;
use pezframe::prelude::*;
#[frame::pezpallet(dev_mode)]
#[pezframe::pezpallet(dev_mode)]
pub mod pezpallet_for_origin {
use super::*;
@@ -151,7 +151,7 @@ pub mod pezpallet_for_origin {
}
}
#[frame::pezpallet(dev_mode)]
#[pezframe::pezpallet(dev_mode)]
pub mod pezpallet_with_custom_origin {
use super::*;
@@ -206,7 +206,7 @@ pub mod pezpallet_with_custom_origin {
pub mod runtime_for_origin {
use super::pezpallet_with_custom_origin;
use frame::{runtime::prelude::*, testing_prelude::*};
use pezframe::{runtime::prelude::*, testing_prelude::*};
#[docify::export(runtime_exp)]
construct_runtime!(
@@ -226,7 +226,7 @@ pub mod runtime_for_origin {
}
}
#[frame::pezpallet(dev_mode)]
#[pezframe::pezpallet(dev_mode)]
pub mod pezpallet_with_external_origin {
use super::*;
#[docify::export(external_origin_def)]
@@ -250,7 +250,7 @@ pub mod pezpallet_with_external_origin {
pub mod runtime_for_external_origin {
use super::*;
use frame::{runtime::prelude::*, testing_prelude::*};
use pezframe::{runtime::prelude::*, testing_prelude::*};
construct_runtime!(
pub struct Runtime {
@@ -3,7 +3,7 @@
//! This reference document explains how FRAME pallets can be combined to interact together.
//!
//! It is suggested to re-read [`crate::pezkuwi_sdk::frame_runtime`], notably the information
//! around [`frame::pezpallet_macros::config`]. Recall that:
//! around [`pezframe::pezpallet_macros::config`]. Recall that:
//!
//! > Configuration trait of a pezpallet: It allows a pezpallet to receive types at a later
//! > point from the runtime that wishes to contain it. It allows the pezpallet to be parameterized
@@ -124,8 +124,8 @@
//! With the above information in context, we can conclude that **`pezframe_system` is a special
//! pezpallet that is tightly coupled with every other pezpallet**. This is because it provides the
//! fundamental system functionality that every pezpallet needs, such as some types like
//! [`frame::prelude::pezframe_system::Config::AccountId`],
//! [`frame::prelude::pezframe_system::Config::Hash`], and some functionality such as block number,
//! [`pezframe::prelude::pezframe_system::Config::AccountId`],
//! [`pezframe::prelude::pezframe_system::Config::Hash`], and some functionality such as block number,
//! etc.
//!
//! ## Recap
@@ -157,10 +157,10 @@
#![allow(unused)]
use frame::prelude::*;
use pezframe::prelude::*;
#[docify::export]
#[frame::pezpallet]
#[pezframe::pezpallet]
pub mod pezpallet_foo {
use super::*;
@@ -178,7 +178,7 @@ pub mod pezpallet_foo {
}
#[docify::export]
#[frame::pezpallet]
#[pezframe::pezpallet]
pub mod pezpallet_author {
use super::*;
@@ -195,7 +195,7 @@ pub mod pezpallet_author {
}
}
#[frame::pezpallet]
#[pezframe::pezpallet]
pub mod pezpallet_foo_tight {
use super::*;
@@ -224,7 +224,7 @@ pub trait AuthorProvider<AccountId> {
fn author() -> AccountId;
}
#[frame::pezpallet]
#[pezframe::pezpallet]
pub mod pezpallet_foo_loose {
use super::*;
@@ -272,7 +272,7 @@ impl<AccountId> AuthorProvider<AccountId> for () {
pub mod runtime {
use super::*;
use frame::{runtime::prelude::*, testing_prelude::*};
use pezframe::{runtime::prelude::*, testing_prelude::*};
use pezcumulus_pezpallet_aura_ext::pezpallet;
construct_runtime!(
@@ -3,7 +3,7 @@
//! This reference document explains how FRAME pezpallets can be combined to interact together.
//!
//! It is suggested to re-read [`crate::pezkuwi_sdk::frame_runtime`], notably the information
//! around [`frame::pezpallet_macros::config`]. Recall that:
//! around [`pezframe::pezpallet_macros::config`]. Recall that:
//!
//! > Configuration trait of a pezpallet: It allows a pezpallet to receive types at a later
//! > point from the runtime that wishes to contain it. It allows the pezpallet to be parameterized
@@ -123,8 +123,8 @@
//! With the above information in context, we can conclude that **`pezframe_system` is a special pezpallet
//! that is tightly coupled with every other pezpallet**. This is because it provides the fundamental
//! system functionality that every pezpallet needs, such as some types like
//! [`frame::prelude::pezframe_system::Config::AccountId`],
//! [`frame::prelude::pezframe_system::Config::Hash`], and some functionality such as block number,
//! [`pezframe::prelude::pezframe_system::Config::AccountId`],
//! [`pezframe::prelude::pezframe_system::Config::Hash`], and some functionality such as block number,
//! etc.
//!
//! ## Recap
@@ -155,10 +155,10 @@
#![allow(unused)]
use frame::prelude::*;
use pezframe::prelude::*;
#[docify::export]
#[frame::pezpallet]
#[pezframe::pezpallet]
pub mod pezpallet_foo {
use super::*;
@@ -176,7 +176,7 @@ pub mod pezpallet_foo {
}
#[docify::export]
#[frame::pezpallet]
#[pezframe::pezpallet]
pub mod pezpallet_author {
use super::*;
@@ -193,7 +193,7 @@ pub mod pezpallet_author {
}
}
#[frame::pezpallet]
#[pezframe::pezpallet]
pub mod pezpallet_foo_tight {
use super::*;
@@ -221,7 +221,7 @@ pub trait AuthorProvider<AccountId> {
fn author() -> AccountId;
}
#[frame::pezpallet]
#[pezframe::pezpallet]
pub mod pezpallet_foo_loose {
use super::*;
@@ -270,7 +270,7 @@ impl<AccountId> AuthorProvider<AccountId> for () {
pub mod runtime {
use super::*;
use pezcumulus_pezpallet_aura_ext::pezpallet;
use frame::{runtime::prelude::*, testing_prelude::*};
use pezframe::{runtime::prelude::*, testing_prelude::*};
construct_runtime!(
pub struct Runtime {
@@ -43,7 +43,7 @@
//! pointer to the `Call` type in each pezpallet, for example [`pezpallet_foo::Call`].
//!
//! [`RuntimeOrigin`]'s [`OriginCaller`] has two variants, one for system, and one for
//! `pezpallet_foo` which utilized [`frame::pezpallet_macros::origin`].
//! `pezpallet_foo` which utilized [`pezframe::pezpallet_macros::origin`].
//!
//! Finally, [`RuntimeGenesisConfig`] is composed of `pezframe_system` and a variant for
//! `pezpallet_bar`'s [`pezpallet_bar::GenesisConfig`].
@@ -80,7 +80,7 @@
//! The only way to express this using Rust's associated types is for the pezpallet to **define its
//! own associated type `RuntimeCall`, and further specify what it thinks `RuntimeCall` should be**.
//!
//! In this case, we will want to assert the existence of [`frame::traits::IsSubType`], which is
//! In this case, we will want to assert the existence of [`pezframe::traits::IsSubType`], which is
//! very similar to [`TryFrom`].
#![doc = docify::embed!("./src/reference_docs/frame_runtime_types.rs", custom_runtime_call)]
//!
@@ -100,7 +100,7 @@
//! type that is only known when the runtime is being constructed.
//!
//! Now, within this pezpallet, this new `RuntimeCall` can be used, and it can use its new trait
//! bounds, such as being [`frame::traits::IsSubType`]:
//! bounds, such as being [`pezframe::traits::IsSubType`]:
#![doc = docify::embed!("./src/reference_docs/frame_runtime_types.rs", custom_runtime_call_usages)]
//!
//! > Once Rust's "_Associated Type Bounds RFC_" is usable, this syntax can be used to
@@ -116,9 +116,9 @@
//! the runtime is constructed? The following snippet exactly does that:
#![doc = docify::embed!("./src/reference_docs/frame_runtime_types.rs", assert_equality)]
//!
//! We leave it to the reader to further explore what [`frame::traits::Hooks::integrity_test`] is,
//! We leave it to the reader to further explore what [`pezframe::traits::Hooks::integrity_test`] is,
//! and what [`core::any::TypeId`] is. Another way to assert this is using
//! [`frame::traits::IsType`].
//! [`pezframe::traits::IsType`].
//!
//! ## Type Aliases
//!
@@ -128,7 +128,7 @@
//! `System`
//! * [`runtime::AllPalletsWithSystem`] is an alias for a tuple of all of the above. This type is
//! important to FRAME internals such as `executive`, as it implements traits such as
//! [`frame::traits::Hooks`].
//! [`pezframe::traits::Hooks`].
//!
//! ## Further Details
//!
@@ -140,7 +140,7 @@
//! * See the corresponding lecture in the [PBA Lectures](https://www.youtube.com/watch?v=OCBC1pMYPoc&list=PL-w_i5kwVqbni1Ch2j_RwTIXiB-bwnYqq&index=11).
//!
//!
//! [`construct_runtime`]: frame::runtime::prelude::construct_runtime
//! [`construct_runtime`]: pezframe::runtime::prelude::construct_runtime
//! [`runtime::PalletFoo`]: crate::reference_docs::frame_runtime_types::runtime::PalletFoo
//! [`runtime::AllPalletsWithSystem`]: crate::reference_docs::frame_runtime_types::runtime::AllPalletsWithSystem
//! [`runtime`]: crate::reference_docs::frame_runtime_types::runtime
@@ -158,10 +158,10 @@
//! [`RuntimeCall`]: crate::reference_docs::frame_runtime_types::runtime::RuntimeCall
//! [`RuntimeHoldReason`]: crate::reference_docs::frame_runtime_types::runtime::RuntimeHoldReason
use frame::prelude::*;
use pezframe::prelude::*;
#[docify::export]
#[frame::pezpallet(dev_mode)]
#[pezframe::pezpallet(dev_mode)]
pub mod pezpallet_foo {
use super::*;
@@ -201,7 +201,7 @@ pub mod pezpallet_foo {
}
#[docify::export]
#[frame::pezpallet(dev_mode)]
#[pezframe::pezpallet(dev_mode)]
pub mod pezpallet_bar {
use super::*;
@@ -232,7 +232,7 @@ pub mod pezpallet_bar {
pub mod runtime {
use super::{pezpallet_bar, pezpallet_foo};
use frame::{runtime::prelude::*, testing_prelude::*};
use pezframe::{runtime::prelude::*, testing_prelude::*};
#[docify::export(runtime_exp)]
construct_runtime!(
@@ -252,10 +252,10 @@ pub mod runtime {
impl pezpallet_bar::Config for Runtime {}
}
#[frame::pezpallet(dev_mode)]
#[pezframe::pezpallet(dev_mode)]
pub mod pezpallet_with_specific_runtime_call {
use super::*;
use frame::traits::IsSubType;
use pezframe::traits::IsSubType;
#[docify::export(custom_runtime_call)]
/// A pezpallet that wants to further narrow down what `RuntimeCall` is.
@@ -299,7 +299,7 @@ pub mod pezpallet_with_specific_runtime_call {
pub mod runtime_with_specific_runtime_call {
use super::pezpallet_with_specific_runtime_call;
use frame::{runtime::prelude::*, testing_prelude::*};
use pezframe::{runtime::prelude::*, testing_prelude::*};
construct_runtime!(
pub struct Runtime {
@@ -35,7 +35,7 @@
//! # Migrations
//!
//! It is often desirable to define logic to execute immediately after runtime upgrades (see
//! [this diagram](frame::traits::Hooks)).
//! [this diagram](pezframe::traits::Hooks)).
//!
//! Self-contained pieces of logic that execute after a runtime upgrade are called "Migrations".
//!
@@ -8,9 +8,9 @@
//! Let's begin by starting to store a `NewType` in a storage item:
//!
//! ```compile_fail
//! #[frame::pezpallet]
//! #[pezframe::pezpallet]
//! pub mod pezpallet {
//! # use frame::prelude::*;
//! # use pezframe::prelude::*;
//! # #[pezpallet::config]
//! # pub trait Config: pezframe_system::Config {}
//! # #[pezpallet::pezpallet]
@@ -25,16 +25,16 @@
//! This raises a number of compiler errors, like:
//! ```text
//! the trait `MaxEncodedLen` is not implemented for `NewType`, which is required by
//! `frame::prelude::StorageValue<_GeneratedPrefixForStorageSomething<T>, NewType>:
//! `pezframe::prelude::StorageValue<_GeneratedPrefixForStorageSomething<T>, NewType>:
//! StorageInfoTrait`
//! ```
//!
//! This implies the following set of traits that need to be derived for a type to be stored in
//! `frame` storage:
//! ```rust
//! #[frame::pezpallet]
//! #[pezframe::pezpallet]
//! pub mod pezpallet {
//! # use frame::prelude::*;
//! # use pezframe::prelude::*;
//! # #[pezpallet::config]
//! # pub trait Config: pezframe_system::Config {}
//! # #[pezpallet::pezpallet]
@@ -48,11 +48,11 @@
//! ```
//!
//! Next, let's look at how this will differ if we are to store a type that is derived from `T` in
//! storage, such as [`frame::prelude::BlockNumberFor`]:
//! storage, such as [`pezframe::prelude::BlockNumberFor`]:
//! ```compile_fail
//! #[frame::pezpallet]
//! #[pezframe::pezpallet]
//! pub mod pezpallet {
//! # use frame::prelude::*;
//! # use pezframe::prelude::*;
//! # #[pezpallet::config]
//! # pub trait Config: pezframe_system::Config {}
//! # #[pezpallet::pezpallet]
@@ -84,9 +84,9 @@
//! attribute to `NewType`. This additional macro will instruct the `derive` to skip the bound on
//! `T`.
//! ```rust
//! #[frame::pezpallet]
//! #[pezframe::pezpallet]
//! pub mod pezpallet {
//! # use frame::prelude::*;
//! # use pezframe::prelude::*;
//! # #[pezpallet::config]
//! # pub trait Config: pezframe_system::Config {}
//! # #[pezpallet::pezpallet]
@@ -100,13 +100,13 @@
//! }
//! ```
//!
//! Next, let's say we wish to store `NewType` as [`frame::prelude::ValueQuery`], which means it
//! Next, let's say we wish to store `NewType` as [`pezframe::prelude::ValueQuery`], which means it
//! must also implement `Default`. This should be as simple as adding `derive(Default)` to it,
//! right?
//! ```compile_fail
//! #[frame::pezpallet]
//! #[pezframe::pezpallet]
//! pub mod pezpallet {
//! # use frame::prelude::*;
//! # use pezframe::prelude::*;
//! # #[pezpallet::config]
//! # pub trait Config: pezframe_system::Config {}
//! # #[pezpallet::pezpallet]
@@ -129,22 +129,22 @@
//! To fix this, frame provides a set of macros that are analogous to normal rust derive macros, but
//! work nicely on top of structs that are generic over `T: Config`. These macros are:
//!
//! - [`frame::prelude::DefaultNoBound`]
//! - [`frame::prelude::DebugNoBound`]
//! - [`frame::prelude::PartialEqNoBound`]
//! - [`frame::prelude::EqNoBound`]
//! - [`frame::prelude::CloneNoBound`]
//! - [`frame::prelude::PartialOrdNoBound`]
//! - [`frame::prelude::OrdNoBound`]
//! - [`pezframe::prelude::DefaultNoBound`]
//! - [`pezframe::prelude::DebugNoBound`]
//! - [`pezframe::prelude::PartialEqNoBound`]
//! - [`pezframe::prelude::EqNoBound`]
//! - [`pezframe::prelude::CloneNoBound`]
//! - [`pezframe::prelude::PartialOrdNoBound`]
//! - [`pezframe::prelude::OrdNoBound`]
//!
//! The above traits are almost certainly needed for your tests - to print your type, assert equality
//! or clone it.
//!
//! We can fix the following example by using [`frame::prelude::DefaultNoBound`].
//! We can fix the following example by using [`pezframe::prelude::DefaultNoBound`].
//! ```rust
//! #[frame::pezpallet]
//! #[pezframe::pezpallet]
//! pub mod pezpallet {
//! # use frame::prelude::*;
//! # use pezframe::prelude::*;
//! # #[pezpallet::config]
//! # pub trait Config: pezframe_system::Config {}
//! # #[pezpallet::pezpallet]
@@ -167,9 +167,9 @@
//! Finally, if a custom type that is provided through `Config` is to be stored in the storage, it
//! is subject to the same trait requirements. The following does not work:
//! ```compile_fail
//! #[frame::pezpallet]
//! #[pezframe::pezpallet]
//! pub mod pezpallet {
//! use frame::prelude::*;
//! use pezframe::prelude::*;
//! #[pezpallet::config]
//! pub trait Config: pezframe_system::Config {
//! type CustomType;
@@ -183,9 +183,9 @@
//!
//! But adding the right trait bounds will fix it.
//! ```rust
//! #[frame::pezpallet]
//! #[pezframe::pezpallet]
//! pub mod pezpallet {
//! use frame::prelude::*;
//! use pezframe::prelude::*;
//! #[pezpallet::config]
//! pub trait Config: pezframe_system::Config {
//! type CustomType: codec::FullCodec
@@ -81,7 +81,7 @@
#![doc = docify::embed!("src/reference_docs/pezframe_benchmarking_weight.rs", WeightInfo)]
//!
//! Then, individual functions of this trait are the final values that we assigned to the
//! [`frame::pezpallet_macros::weight`] attribute:
//! [`pezframe::pezpallet_macros::weight`] attribute:
#![doc = docify::embed!("./src/reference_docs/pezframe_benchmarking_weight.rs", simple_transfer_2)]
//!
//! ## Manual Refund
@@ -130,10 +130,10 @@
//! [PolkaVM]: https://github.com/koute/polkavm
//! [JAM]: https://graypaper.com
#[frame::pezpallet(dev_mode)]
#[pezframe::pezpallet(dev_mode)]
#[allow(unused_variables, unreachable_code, unused, clippy::diverging_sub_expression)]
pub mod pezpallet {
use frame::prelude::*;
use pezframe::prelude::*;
#[docify::export]
pub trait WeightInfo {
@@ -202,7 +202,7 @@ pub mod pezpallet {
let actual_weight =
todo!("this can likely come from another benchmark that is NOT the worst case");
let pays_fee = todo!("You can set this to `Pays::Yes` or `Pays::No` to change if this transaction should pay fees");
Ok(frame::deps::pezframe_support::dispatch::PostDispatchInfo {
Ok(pezframe::deps::pezframe_support::dispatch::PostDispatchInfo {
actual_weight: Some(actual_weight),
pays_fee,
})
@@ -7,12 +7,12 @@
//! The rest of this document assumes familiarity with the
//! [Rust book's Advanced Traits](https://doc.rust-lang.org/book/ch19-03-advanced-traits.html)
//! section.
//! Moreover, we use the [`frame::traits::Get`].
//! Moreover, we use the [`pezframe::traits::Get`].
//!
//! First, imagine we are writing a FRAME pezpallet. We represent this pezpallet with a `struct
//! Pezpallet`, and this pezpallet wants to implement the functionalities of that pezpallet, for
//! example a simple `transfer` function. For the sake of education, we are interested in having a
//! `MinTransfer` amount, expressed as a [`frame::traits::Get`], which will dictate what is the
//! `MinTransfer` amount, expressed as a [`pezframe::traits::Get`], which will dictate what is the
//! minimum amount that can be transferred.
//!
//! We can foremost write this as simple as the following snippet:
@@ -84,7 +84,7 @@
//! having individual `trait Configs` declare a shared `trait SystemConfig` as their
//! [supertrait](https://doc.rust-lang.org/rust-by-example/trait/supertraits.html).
#![doc = docify::embed!("./src/reference_docs/trait_based_programming.rs", with_system)]
//! In FRAME, this shared supertrait is [`frame::prelude::pezframe_system`].
//! In FRAME, this shared supertrait is [`pezframe::prelude::pezframe_system`].
//!
//! Notice how this made no difference in the syntax of the rest of the code. `T::AccountId` is
//! still a valid type, since `T` implements `Config` and `Config` implies `SystemConfig`, which
@@ -103,7 +103,7 @@
//! length of fully qualified syntax is a common pattern in FRAME.
//!
//! The above example is almost identical to the well-known (and somewhat notorious) `type
//! BalanceOf` that is often used in the context of [`frame::traits::fungible`].
//! BalanceOf` that is often used in the context of [`pezframe::traits::fungible`].
#![doc = docify::embed!("../../bizinikiwi/pezframe/fast-unstake/src/types.rs", BalanceOf)]
//!
//! ## Additional Resources
@@ -113,15 +113,15 @@
//! - <https://exchange.pezkuwichain.app/questions/2228/type-casting-to-trait-t-as-config>
#![allow(unused)]
use frame::traits::Get;
use pezframe::traits::Get;
#[docify::export]
mod basic {
struct Pezpallet;
type AccountId = frame::deps::pezsp_runtime::AccountId32;
type AccountId = pezframe::deps::pezsp_runtime::AccountId32;
type Balance = u128;
type MinTransfer = frame::traits::ConstU128<10>;
type MinTransfer = pezframe::traits::ConstU128<10>;
impl Pezpallet {
fn transfer(_from: AccountId, _to: AccountId, _amount: Balance) {
@@ -140,8 +140,8 @@ mod generic {
impl<AccountId, Balance, MinTransfer> Pezpallet<AccountId, Balance, MinTransfer>
where
Balance: frame::traits::AtLeast32BitUnsigned,
MinTransfer: frame::traits::Get<Balance>,
Balance: pezframe::traits::AtLeast32BitUnsigned,
MinTransfer: pezframe::traits::Get<Balance>,
AccountId: From<[u8; 32]>,
{
fn transfer(_from: AccountId, _to: AccountId, amount: Balance) {
@@ -157,8 +157,8 @@ mod trait_based {
trait Config {
type AccountId: From<[u8; 32]>;
type Balance: frame::traits::AtLeast32BitUnsigned;
type MinTransfer: frame::traits::Get<Self::Balance>;
type Balance: pezframe::traits::AtLeast32BitUnsigned;
type MinTransfer: pezframe::traits::Get<Self::Balance>;
}
struct Pezpallet<T: Config>(std::marker::PhantomData<T>);
@@ -179,8 +179,8 @@ mod with_system {
}
pub trait Config: SystemConfig {
type Balance: frame::traits::AtLeast32BitUnsigned;
type MinTransfer: frame::traits::Get<Self::Balance>;
type Balance: pezframe::traits::AtLeast32BitUnsigned;
type MinTransfer: pezframe::traits::Get<Self::Balance>;
}
pub struct Pezpallet<T: Config>(std::marker::PhantomData<T>);
@@ -205,7 +205,7 @@ mod fully_qualified_complicated {
use super::with_system::*;
trait CurrencyTrait {
type Balance: frame::traits::AtLeast32BitUnsigned;
type Balance: pezframe::traits::AtLeast32BitUnsigned;
fn more_stuff() {}
}