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:
2025-12-16 09:57:23 +03:00
parent eea003e14d
commit 3139ffa25e
3022 changed files with 42157 additions and 23579 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ pezsp-state-machine = { optional = true, workspace = true, default-features = tr
pezsp-version = { workspace = true }
static_assertions = { workspace = true, default-features = true }
trybuild = { features = ["diff"], workspace = true }
# The "std" feature for this pallet is never activated on purpose, in order to test construct_runtime error message
# The "std" feature for this pezpallet is never activated on purpose, in order to test construct_runtime error message
test-pezpallet = { workspace = true }
[features]
@@ -1 +1 @@
This is the best pallet
This is the best pezpallet
@@ -0,0 +1 @@
This is the best pezpallet
@@ -7,7 +7,7 @@ license = "Apache-2.0"
publish = false
homepage.workspace = true
repository.workspace = true
description = "Pezkuwi SDK FRAME support: support test pallet"
description = "Pezkuwi SDK FRAME support: support test pezpallet"
documentation = "https://docs.rs/pezframe-support-test-pezpallet"
[lints]
@@ -15,40 +15,40 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! A basic pallet that can be used to test `construct_runtime!`.
//! A basic pezpallet that can be used to test `construct_runtime!`.
// Ensure docs are propagated properly by the macros.
#![warn(missing_docs)]
pub use pallet::*;
pub use pezpallet::*;
#[pezframe_support::pallet]
pub mod pallet {
#[pezframe_support::pezpallet]
pub mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
/// I'm the documentation
#[pallet::storage]
#[pezpallet::storage]
pub type Value<T> = StorageValue<_, u32>;
#[pallet::genesis_config]
#[pezpallet::genesis_config]
#[derive(pezframe_support::DefaultNoBound)]
pub struct GenesisConfig<T: Config> {
#[serde(skip)]
_config: core::marker::PhantomData<T>,
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
fn build(&self) {}
}
#[pallet::error]
#[pezpallet::error]
pub enum Error<T> {
/// Something failed
Test,
+17 -17
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Minimal pallet without `pezframe_system::Config`-super trait.
//! Minimal pezpallet without `pezframe_system::Config`-super trait.
// Make sure we fail compilation on warnings
#![warn(missing_docs)]
@@ -24,20 +24,20 @@
pub use pezframe_support::dispatch::RawOrigin;
use pezframe_system::pezpallet_prelude::BlockNumberFor;
pub use self::pallet::*;
pub use self::pezpallet::*;
#[pezframe_support::pallet(dev_mode)]
pub mod pallet {
#[pezframe_support::pezpallet(dev_mode)]
pub mod pezpallet {
use super::*;
use crate::{self as pezframe_system, pezpallet_prelude::*};
use pezframe_support::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
/// The configuration trait.
#[pallet::config(pezframe_system_config)]
#[pallet::disable_pezframe_system_supertrait_check]
#[pezpallet::config(pezframe_system_config)]
#[pezpallet::disable_pezframe_system_supertrait_check]
pub trait Config: 'static + Eq + Clone {
/// The block number type.
type BlockNumber: Parameter + Member + Default + MaybeSerializeDeserialize + MaxEncodedLen;
@@ -57,31 +57,31 @@ pub mod pallet {
+ Member
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>
+ From<Event<Self>>;
/// The information about the pallet setup in the runtime.
/// The information about the pezpallet setup in the runtime.
type PalletInfo: pezframe_support::traits::PalletInfo;
/// The db weights.
type DbWeight: Get<pezframe_support::weights::RuntimeDbWeight>;
}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
/// A noop call.
pub fn noop(_origin: OriginFor<T>) -> DispatchResult {
Ok(())
}
}
impl<T: Config> Pallet<T> {
impl<T: Config> Pezpallet<T> {
/// A empty method.
pub fn deposit_event(_event: impl Into<T::RuntimeEvent>) {}
}
/// The origin type.
#[pallet::origin]
#[pezpallet::origin]
pub type Origin<T> = RawOrigin<<T as Config>::AccountId>;
/// The error type.
#[pallet::error]
#[pezpallet::error]
pub enum Error<T> {
/// Test error documentation
TestError,
@@ -93,7 +93,7 @@ pub mod pallet {
}
/// The event type.
#[pallet::event]
#[pezpallet::event]
pub enum Event<T: Config> {
/// The extrinsic is successful
ExtrinsicSuccess,
@@ -113,7 +113,7 @@ where
}
/// Same semantic as [`pezframe_system`].
// Note: we cannot use [`pezframe_system`] here since the pallet does not depend on
// Note: we cannot use [`pezframe_system`] here since the pezpallet does not depend on
// [`pezframe_system::Config`].
pub mod pezpallet_prelude {
pub use crate::ensure_root;
@@ -139,7 +139,7 @@ where
(
Output::decode(&mut TrailingZeroInput::new(subject)).unwrap_or_default(),
pezframe_system::Pallet::<T>::block_number(),
pezframe_system::Pezpallet::<T>::block_number(),
)
}
}
@@ -15,34 +15,34 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// ! A basic pallet to test it compiles along with a runtime using it when `pezframe_system` and
// ! A basic pezpallet to test it compiles along with a runtime using it when `pezframe_system` and
// `pezframe_support` are reexported by a `frame` crate.
use frame::deps::{pezframe_support, pezframe_system};
#[pezframe_support::pallet]
pub mod pallet {
#[pezframe_support::pezpallet]
pub mod pezpallet {
use super::*;
use pezframe_support::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
// The only valid syntax here is the following or
// ```
// pub trait Config: frame::deps::pezframe_system::Config {}
// ```
pub trait Config: pezframe_system::Config {}
#[pallet::genesis_config]
#[pezpallet::genesis_config]
#[derive(pezframe_support::DefaultNoBound)]
pub struct GenesisConfig<T: Config> {
#[serde(skip)]
_config: core::marker::PhantomData<T>,
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
fn build(&self) {}
}
@@ -53,12 +53,12 @@ pub mod pallet {
mod tests {
use super::{
pezframe_support::{construct_runtime, derive_impl},
pezframe_system, pallet,
pezframe_system, pezpallet,
};
type Block = pezframe_system::mocking::MockBlock<Runtime>;
impl crate::pallet::Config for Runtime {}
impl crate::pezpallet::Config for Runtime {}
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
@@ -69,7 +69,7 @@ mod tests {
pub struct Runtime
{
System: pezframe_system,
Pallet: pallet,
Pezpallet: pezpallet,
}
}
}
@@ -31,7 +31,7 @@ use pezsp_runtime::{
};
// test for instance
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
pub mod pallet1 {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
@@ -47,8 +47,8 @@ pub mod pallet1 {
pub const CALL_4_AUTH_WEIGHT: Weight = Weight::from_all(10);
pub const CALL_4_WEIGHT: Weight = Weight::from_all(11);
#[pallet::pallet]
pub struct Pallet<T, I = ()>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(_);
pub trait WeightInfo {
fn call1() -> Weight;
@@ -76,24 +76,24 @@ pub mod pallet1 {
}
}
#[pallet::config]
#[pezpallet::config]
pub trait Config<I: 'static = ()>: pezframe_system::Config {
type SomeGeneric: Parameter;
type WeightInfo: WeightInfo;
}
#[pallet::call(weight = T::WeightInfo)]
impl<T: Config<I>, I: 'static> Pallet<T, I> {
#[pallet::authorize(|_source| Ok((ValidTransaction::default(), Weight::zero())))]
#[pallet::weight_of_authorize(CALL_1_AUTH_WEIGHT)]
#[pallet::call_index(0)]
#[pezpallet::call(weight = T::WeightInfo)]
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
#[pezpallet::authorize(|_source| Ok((ValidTransaction::default(), Weight::zero())))]
#[pezpallet::weight_of_authorize(CALL_1_AUTH_WEIGHT)]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>) -> DispatchResult {
ensure_authorized(origin)?;
Ok(())
}
#[pallet::authorize(|_source, a, b, c, d, e, f, authorize_refund|
#[pezpallet::authorize(|_source, a, b, c, d, e, f, authorize_refund|
if *a {
let valid = ValidTransaction {
priority: *b,
@@ -107,7 +107,7 @@ pub mod pallet1 {
Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
}
)]
#[pallet::call_index(1)]
#[pezpallet::call_index(1)]
pub fn call2(
origin: OriginFor<T>,
a: bool,
@@ -125,8 +125,8 @@ pub mod pallet1 {
Ok(Some(CALL_2_REFUND).into())
}
#[pallet::authorize(Self::authorize_call3)]
#[pallet::call_index(2)]
#[pezpallet::authorize(Self::authorize_call3)]
#[pezpallet::call_index(2)]
pub fn call3(
origin: OriginFor<T>,
valid: bool,
@@ -143,10 +143,10 @@ pub mod pallet1 {
}
#[cfg(feature = "frame-feature-testing")]
#[pallet::call_index(3)]
#[pallet::authorize(|_source| Ok((ValidTransaction::default(), Weight::zero())))]
#[pallet::weight_of_authorize(CALL_4_AUTH_WEIGHT)]
#[pallet::weight(CALL_4_WEIGHT)]
#[pezpallet::call_index(3)]
#[pezpallet::authorize(|_source| Ok((ValidTransaction::default(), Weight::zero())))]
#[pezpallet::weight_of_authorize(CALL_4_AUTH_WEIGHT)]
#[pezpallet::weight(CALL_4_WEIGHT)]
pub fn call4(origin: OriginFor<T>) -> DispatchResult {
ensure_authorized(origin)?;
@@ -154,7 +154,7 @@ pub mod pallet1 {
}
}
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
fn authorize_call3(
_source: TransactionSource,
valid: &bool,
@@ -170,22 +170,22 @@ pub mod pallet1 {
}
// test for dev mode.
#[pezframe_support::pallet(dev_mode)]
#[pezframe_support::pezpallet(dev_mode)]
pub mod pallet2 {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
pub trait SomeTrait {}
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::authorize(|_source| Ok(Default::default()))]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::authorize(|_source| Ok(Default::default()))]
pub fn call1(origin: OriginFor<T>) -> DispatchResult {
ensure_authorized(origin)?;
Ok(())
@@ -193,8 +193,8 @@ pub mod pallet2 {
}
}
// test for no pallet info.
#[pezframe_support::pallet]
// test for no pezpallet info.
#[pezframe_support::pezpallet]
pub mod pallet3 {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
@@ -202,18 +202,18 @@ pub mod pallet3 {
pub const CALL_1_AUTH_WEIGHT: Weight = Weight::from_all(1);
pub const CALL_1_WEIGHT: Weight = Weight::from_all(1);
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: crate::pallet1::Config + pezframe_system::Config {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::authorize(|_source| Ok(Default::default()))]
#[pallet::weight_of_authorize(CALL_1_AUTH_WEIGHT)]
#[pallet::weight(CALL_1_WEIGHT)]
#[pallet::call_index(0)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::authorize(|_source| Ok(Default::default()))]
#[pezpallet::weight_of_authorize(CALL_1_AUTH_WEIGHT)]
#[pezpallet::weight(CALL_1_WEIGHT)]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>) -> DispatchResult {
ensure_authorized(origin)?;
Ok(())
@@ -221,21 +221,21 @@ pub mod pallet3 {
}
}
// test for pallet with no authorized call
#[pezframe_support::pallet(dev_mode)]
// test for pezpallet with no authorized call
#[pezframe_support::pezpallet(dev_mode)]
pub mod pallet4 {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>) -> DispatchResult {
ensure_authorized(origin)?;
Ok(())
@@ -27,7 +27,7 @@ fn benchmark_ui() {
// As trybuild is using `cargo check`, we don't need the real WASM binaries.
std::env::set_var("SKIP_WASM_BUILD", "1");
// Deny all warnings since we emit warnings as part of a Pallet's UI.
// Deny all warnings since we emit warnings as part of a Pezpallet's UI.
std::env::set_var("CARGO_ENCODED_RUSTFLAGS", "--deny=warnings");
let t = trybuild::TestCases::new();
@@ -17,28 +17,28 @@
use pezframe_benchmarking::v2::*;
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_system::pezpallet_prelude::*;
use pezframe_support::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(1)]
#[pallet::weight(Weight::default())]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(1)]
#[pezpallet::weight(Weight::default())]
pub fn call_1(_origin: OriginFor<T>) -> DispatchResult {
Ok(())
}
}
}
pub use pallet::*;
pub use pezpallet::*;
#[benchmarks]
mod benches {
@@ -35,8 +35,8 @@ mod benches {
}
#[benchmark(extra, pov_mode = Measured {
Pallet: Measured,
Pallet::Storage: MaxEncodedLen,
Pezpallet: Measured,
Pezpallet::Storage: MaxEncodedLen,
}, skip_meta)]
fn bench3() {
#[block]
@@ -44,8 +44,8 @@ mod benches {
}
#[benchmark(skip_meta, extra, pov_mode = Measured {
Pallet::Storage: MaxEncodedLen,
Pallet::StorageSubKey: Measured,
Pezpallet::Storage: MaxEncodedLen,
Pezpallet::StorageSubKey: Measured,
})]
fn bench4() {
#[block]
@@ -53,8 +53,8 @@ mod benches {
}
#[benchmark(pov_mode = MaxEncodedLen {
Pallet::Storage: Measured,
Pallet::StorageSubKey: Measured
Pezpallet::Storage: Measured,
Pezpallet::StorageSubKey: Measured
}, extra, skip_meta)]
fn bench5() {
#[block]
@@ -62,8 +62,8 @@ mod benches {
}
#[benchmark(pov_mode = MaxEncodedLen {
Pallet::Storage: Measured,
Pallet::Storage::Nested: Ignored
Pezpallet::Storage: Measured,
Pezpallet::Storage::Nested: Ignored
}, extra, skip_meta)]
fn bench6() {
#[block]
@@ -17,31 +17,31 @@
// Create 3 pallets for testing the outer error enum construction:
//
// - `pallet`: declares an error with `#[pallet::error]`
// - `pallet2`: declares an error with `#[pallet::error]`
// - `pezpallet`: declares an error with `#[pezpallet::error]`
// - `pallet2`: declares an error with `#[pezpallet::error]`
// - `pallet3`: does not declare an error.
#[pezframe_support::pallet(dev_mode)]
pub mod pallet {
#[pezframe_support::pezpallet(dev_mode)]
pub mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config<I: 'static = ()>: pezframe_system::Config {
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self, I>>
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
}
#[pallet::event]
#[pezpallet::event]
pub enum Event<T: Config<I>, I: 'static = ()> {
/// Something
Something(u32),
}
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::genesis_config]
#[pezpallet::genesis_config]
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
phantom: PhantomData<(T, I)>,
}
@@ -52,12 +52,12 @@ pub mod pallet {
}
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I> {
fn build(&self) {}
}
#[pallet::error]
#[pezpallet::error]
#[derive(PartialEq, Eq)]
pub enum Error<T, I = ()> {
/// doc comment put into metadata
@@ -66,27 +66,27 @@ pub mod pallet {
}
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
pub mod pallet2 {
use pezframe_support::pezpallet_prelude::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config<I: 'static = ()>: pezframe_system::Config {
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self, I>>
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
}
#[pallet::event]
#[pezpallet::event]
pub enum Event<T: Config<I>, I: 'static = ()> {
/// Something
Something(u32),
}
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::genesis_config]
#[pezpallet::genesis_config]
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
phantom: PhantomData<(T, I)>,
}
@@ -97,12 +97,12 @@ pub mod pallet2 {
}
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I> {
fn build(&self) {}
}
#[pallet::error]
#[pezpallet::error]
#[derive(PartialEq, Eq)]
pub enum Error<T, I = ()> {
/// doc comment put into metadata
@@ -111,27 +111,27 @@ pub mod pallet2 {
}
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
pub mod pallet3 {
use pezframe_support::pezpallet_prelude::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config<I: 'static = ()>: pezframe_system::Config {
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self, I>>
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
}
#[pallet::event]
#[pezpallet::event]
pub enum Event<T: Config<I>, I: 'static = ()> {
/// Something
Something(u32),
}
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::genesis_config]
#[pezpallet::genesis_config]
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
phantom: PhantomData<(T, I)>,
}
@@ -142,7 +142,7 @@ pub mod pallet3 {
}
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I> {
fn build(&self) {}
}
@@ -28,64 +28,64 @@ use pezsp_runtime::{
traits::{BlakeTwo256, Verify},
};
#[pezframe_support::pallet(dev_mode)]
#[pezframe_support::pezpallet(dev_mode)]
mod module_single_instance {
#[pallet::composite_enum]
#[pezpallet::composite_enum]
pub enum HoldReason {
ModuleSingleInstanceReason1,
ModuleSingleInstanceReason2,
}
#[pallet::composite_enum]
#[pezpallet::composite_enum]
pub enum FreezeReason {
ModuleSingleInstanceReason1,
ModuleSingleInstanceReason2,
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type RuntimeHoldReason: From<HoldReason>;
type RuntimeFreezeReason: From<FreezeReason>;
}
}
#[pezframe_support::pallet(dev_mode)]
#[pezframe_support::pezpallet(dev_mode)]
mod module_multi_instance {
#[pallet::composite_enum]
#[pezpallet::composite_enum]
pub enum HoldReason<I: 'static = ()> {
ModuleMultiInstanceReason1,
ModuleMultiInstanceReason2,
ModuleMultiInstanceReason3,
}
#[pallet::composite_enum]
#[pezpallet::composite_enum]
pub enum FreezeReason<I: 'static = ()> {
ModuleMultiInstanceReason1,
}
#[pallet::pallet]
pub struct Pallet<T, I = ()>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config<I: 'static = ()>: pezframe_system::Config {
type RuntimeHoldReason: From<HoldReason<I>>;
type RuntimeFreezeReason: From<FreezeReason<I>>;
}
}
#[pezframe_support::pallet(dev_mode)]
#[pezframe_support::pezpallet(dev_mode)]
mod module_composite_enum_consumer {
use super::*;
#[pallet::pallet]
pub struct Pallet<T, I = ()>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config<I: 'static = ()>: pezframe_system::Config {
// consume `HoldReason` `composite_enum`
type RuntimeHoldReason: VariantCount;
@@ -19,13 +19,13 @@ use pezframe_support::construct_runtime;
use pezsp_runtime::{generic, traits::BlakeTwo256};
use pezsp_core::sr25519;
#[pezframe_support::pallet]
mod pallet {
#[pallet::config]
#[pezframe_support::pezpallet]
mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
}
pub type Signature = sr25519::Signature;
@@ -34,13 +34,13 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet exclude_parts { Pallet } use_parts { Pallet },
System: system::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pezpallet: pezpallet exclude_parts { Pezpallet } use_parts { Pezpallet },
}
}
@@ -20,9 +20,9 @@ use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
Balance: balances::{Pallet},
Balance: balances::{Pallet},
System: system::{Pezpallet},
Balance: balances::{Pezpallet},
Balance: balances::{Pezpallet},
}
}
@@ -23,7 +23,7 @@ construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = Uxt,
{
System: pezframe_system::{Pallet, Call, Storage, Config<T>, Event<T>},
System: pezframe_system::{Pezpallet, Call, Storage, Config<T>, Event<T>},
}
}
@@ -20,7 +20,7 @@ use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
System: system::{Pezpallet},
Balance: balances::{Config, Call, Config<T>, Origin<T>},
}
}
@@ -0,0 +1,27 @@
// This file is part of Bizinikiwi.
// 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.
use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
system: ,
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: expected one of: `crate`, `self`, `super`, identifier
--> tests/construct_runtime_ui/empty_pallet_path.rs:23:11
|
23 | system: ,
| ^
@@ -19,17 +19,17 @@ use pezframe_support::construct_runtime;
use pezsp_runtime::{generic, traits::BlakeTwo256};
use pezsp_core::sr25519;
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::storage]
#[pezpallet::storage]
type Foo<T> = StorageValue<Value=u8>;
}
@@ -39,13 +39,13 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet exclude_parts { Call },
System: system::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pezpallet: pezpallet exclude_parts { Call },
}
}
@@ -21,7 +21,7 @@ construct_runtime! {
pub struct Runtime
{
#[cfg(test)]
System: pezframe_system::{Pallet, Call, Storage, Config<T>, Event<T>},
System: pezframe_system::{Pezpallet, Call, Storage, Config<T>, Event<T>},
}
}
@@ -20,7 +20,7 @@ use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
System: system::{Pezpallet},
Balance: balances::<Instance1>::{Call<T>, Origin<T>},
}
}
@@ -20,7 +20,7 @@ use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
System: system::{Pezpallet},
#[cfg(feature = 1)]
Balance: balances::{Config, Call},
}
@@ -20,7 +20,7 @@ use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
System: system::{Pezpallet},
Balance: balances::{Unexpected},
}
}
@@ -20,7 +20,7 @@ use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system expanded::{}::{Pallet},
System: system expanded::{}::{Pezpallet},
Balance: balances::<Instance1> expanded::{}::{Event},
}
}
@@ -20,7 +20,7 @@ use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system expanded::{}::{Pallet},
System: system expanded::{}::{Pezpallet},
Balance: balances::<Instance1> expanded::{}::{Origin},
}
}
@@ -19,13 +19,13 @@ use pezframe_support::{construct_runtime, derive_impl};
use pezsp_core::sr25519;
use pezsp_runtime::{generic, traits::BlakeTwo256};
#[pezframe_support::pallet]
mod pallet {
#[pallet::config]
#[pezframe_support::pezpallet]
mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
}
pub type Signature = sr25519::Signature;
@@ -34,7 +34,7 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
@@ -66,117 +66,117 @@ impl pezframe_system::Config for Runtime {
construct_runtime! {
pub struct Runtime
{
System: pezframe_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet1: pallet::{Pallet},
Pallet2: pallet::{Pallet},
Pallet3: pallet::{Pallet},
Pallet4: pallet::{Pallet},
Pallet5: pallet::{Pallet},
Pallet6: pallet::{Pallet},
Pallet7: pallet::{Pallet},
Pallet8: pallet::{Pallet},
Pallet9: pallet::{Pallet},
Pallet10: pallet::{Pallet},
Pallet11: pallet::{Pallet},
Pallet12: pallet::{Pallet},
Pallet13: pallet::{Pallet},
Pallet14: pallet::{Pallet},
Pallet15: pallet::{Pallet},
Pallet16: pallet::{Pallet},
Pallet17: pallet::{Pallet},
Pallet18: pallet::{Pallet},
Pallet19: pallet::{Pallet},
Pallet20: pallet::{Pallet},
Pallet21: pallet::{Pallet},
Pallet22: pallet::{Pallet},
Pallet23: pallet::{Pallet},
Pallet24: pallet::{Pallet},
Pallet25: pallet::{Pallet},
Pallet26: pallet::{Pallet},
Pallet27: pallet::{Pallet},
Pallet28: pallet::{Pallet},
Pallet29: pallet::{Pallet},
Pallet30: pallet::{Pallet},
Pallet31: pallet::{Pallet},
Pallet32: pallet::{Pallet},
Pallet33: pallet::{Pallet},
Pallet34: pallet::{Pallet},
Pallet35: pallet::{Pallet},
Pallet36: pallet::{Pallet},
Pallet37: pallet::{Pallet},
Pallet38: pallet::{Pallet},
Pallet39: pallet::{Pallet},
Pallet40: pallet::{Pallet},
Pallet41: pallet::{Pallet},
Pallet42: pallet::{Pallet},
Pallet43: pallet::{Pallet},
Pallet44: pallet::{Pallet},
Pallet45: pallet::{Pallet},
Pallet46: pallet::{Pallet},
Pallet47: pallet::{Pallet},
Pallet48: pallet::{Pallet},
Pallet49: pallet::{Pallet},
Pallet50: pallet::{Pallet},
Pallet51: pallet::{Pallet},
Pallet52: pallet::{Pallet},
Pallet53: pallet::{Pallet},
Pallet54: pallet::{Pallet},
Pallet55: pallet::{Pallet},
Pallet56: pallet::{Pallet},
Pallet57: pallet::{Pallet},
Pallet58: pallet::{Pallet},
Pallet59: pallet::{Pallet},
Pallet60: pallet::{Pallet},
Pallet61: pallet::{Pallet},
Pallet62: pallet::{Pallet},
Pallet63: pallet::{Pallet},
Pallet64: pallet::{Pallet},
Pallet65: pallet::{Pallet},
Pallet66: pallet::{Pallet},
Pallet67: pallet::{Pallet},
Pallet68: pallet::{Pallet},
Pallet69: pallet::{Pallet},
Pallet70: pallet::{Pallet},
Pallet71: pallet::{Pallet},
Pallet72: pallet::{Pallet},
Pallet73: pallet::{Pallet},
Pallet74: pallet::{Pallet},
Pallet75: pallet::{Pallet},
Pallet76: pallet::{Pallet},
Pallet77: pallet::{Pallet},
Pallet78: pallet::{Pallet},
Pallet79: pallet::{Pallet},
Pallet80: pallet::{Pallet},
Pallet81: pallet::{Pallet},
Pallet82: pallet::{Pallet},
Pallet83: pallet::{Pallet},
Pallet84: pallet::{Pallet},
Pallet85: pallet::{Pallet},
Pallet86: pallet::{Pallet},
Pallet87: pallet::{Pallet},
Pallet88: pallet::{Pallet},
Pallet89: pallet::{Pallet},
Pallet90: pallet::{Pallet},
Pallet91: pallet::{Pallet},
Pallet92: pallet::{Pallet},
Pallet93: pallet::{Pallet},
Pallet94: pallet::{Pallet},
Pallet95: pallet::{Pallet},
Pallet96: pallet::{Pallet},
Pallet97: pallet::{Pallet},
Pallet98: pallet::{Pallet},
Pallet99: pallet::{Pallet},
Pallet100: pallet::{Pallet},
Pallet101: pallet::{Pallet},
Pallet102: pallet::{Pallet},
Pallet103: pallet::{Pallet},
Pallet104: pallet::{Pallet},
Pallet105: pallet::{Pallet},
Pallet106: pallet::{Pallet},
Pallet107: pallet::{Pallet},
Pallet108: pallet::{Pallet},
Pallet109: pallet::{Pallet},
Pallet110: pallet::{Pallet},
System: pezframe_system::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pallet1: pezpallet::{Pezpallet},
Pallet2: pezpallet::{Pezpallet},
Pallet3: pezpallet::{Pezpallet},
Pallet4: pezpallet::{Pezpallet},
Pallet5: pezpallet::{Pezpallet},
Pallet6: pezpallet::{Pezpallet},
Pallet7: pezpallet::{Pezpallet},
Pallet8: pezpallet::{Pezpallet},
Pallet9: pezpallet::{Pezpallet},
Pallet10: pezpallet::{Pezpallet},
Pallet11: pezpallet::{Pezpallet},
Pallet12: pezpallet::{Pezpallet},
Pallet13: pezpallet::{Pezpallet},
Pallet14: pezpallet::{Pezpallet},
Pallet15: pezpallet::{Pezpallet},
Pallet16: pezpallet::{Pezpallet},
Pallet17: pezpallet::{Pezpallet},
Pallet18: pezpallet::{Pezpallet},
Pallet19: pezpallet::{Pezpallet},
Pallet20: pezpallet::{Pezpallet},
Pallet21: pezpallet::{Pezpallet},
Pallet22: pezpallet::{Pezpallet},
Pallet23: pezpallet::{Pezpallet},
Pallet24: pezpallet::{Pezpallet},
Pallet25: pezpallet::{Pezpallet},
Pallet26: pezpallet::{Pezpallet},
Pallet27: pezpallet::{Pezpallet},
Pallet28: pezpallet::{Pezpallet},
Pallet29: pezpallet::{Pezpallet},
Pallet30: pezpallet::{Pezpallet},
Pallet31: pezpallet::{Pezpallet},
Pallet32: pezpallet::{Pezpallet},
Pallet33: pezpallet::{Pezpallet},
Pallet34: pezpallet::{Pezpallet},
Pallet35: pezpallet::{Pezpallet},
Pallet36: pezpallet::{Pezpallet},
Pallet37: pezpallet::{Pezpallet},
Pallet38: pezpallet::{Pezpallet},
Pallet39: pezpallet::{Pezpallet},
Pallet40: pezpallet::{Pezpallet},
Pallet41: pezpallet::{Pezpallet},
Pallet42: pezpallet::{Pezpallet},
Pallet43: pezpallet::{Pezpallet},
Pallet44: pezpallet::{Pezpallet},
Pallet45: pezpallet::{Pezpallet},
Pallet46: pezpallet::{Pezpallet},
Pallet47: pezpallet::{Pezpallet},
Pallet48: pezpallet::{Pezpallet},
Pallet49: pezpallet::{Pezpallet},
Pallet50: pezpallet::{Pezpallet},
Pallet51: pezpallet::{Pezpallet},
Pallet52: pezpallet::{Pezpallet},
Pallet53: pezpallet::{Pezpallet},
Pallet54: pezpallet::{Pezpallet},
Pallet55: pezpallet::{Pezpallet},
Pallet56: pezpallet::{Pezpallet},
Pallet57: pezpallet::{Pezpallet},
Pallet58: pezpallet::{Pezpallet},
Pallet59: pezpallet::{Pezpallet},
Pallet60: pezpallet::{Pezpallet},
Pallet61: pezpallet::{Pezpallet},
Pallet62: pezpallet::{Pezpallet},
Pallet63: pezpallet::{Pezpallet},
Pallet64: pezpallet::{Pezpallet},
Pallet65: pezpallet::{Pezpallet},
Pallet66: pezpallet::{Pezpallet},
Pallet67: pezpallet::{Pezpallet},
Pallet68: pezpallet::{Pezpallet},
Pallet69: pezpallet::{Pezpallet},
Pallet70: pezpallet::{Pezpallet},
Pallet71: pezpallet::{Pezpallet},
Pallet72: pezpallet::{Pezpallet},
Pallet73: pezpallet::{Pezpallet},
Pallet74: pezpallet::{Pezpallet},
Pallet75: pezpallet::{Pezpallet},
Pallet76: pezpallet::{Pezpallet},
Pallet77: pezpallet::{Pezpallet},
Pallet78: pezpallet::{Pezpallet},
Pallet79: pezpallet::{Pezpallet},
Pallet80: pezpallet::{Pezpallet},
Pallet81: pezpallet::{Pezpallet},
Pallet82: pezpallet::{Pezpallet},
Pallet83: pezpallet::{Pezpallet},
Pallet84: pezpallet::{Pezpallet},
Pallet85: pezpallet::{Pezpallet},
Pallet86: pezpallet::{Pezpallet},
Pallet87: pezpallet::{Pezpallet},
Pallet88: pezpallet::{Pezpallet},
Pallet89: pezpallet::{Pezpallet},
Pallet90: pezpallet::{Pezpallet},
Pallet91: pezpallet::{Pezpallet},
Pallet92: pezpallet::{Pezpallet},
Pallet93: pezpallet::{Pezpallet},
Pallet94: pezpallet::{Pezpallet},
Pallet95: pezpallet::{Pezpallet},
Pallet96: pezpallet::{Pezpallet},
Pallet97: pezpallet::{Pezpallet},
Pallet98: pezpallet::{Pezpallet},
Pallet99: pezpallet::{Pezpallet},
Pallet100: pezpallet::{Pezpallet},
Pallet101: pezpallet::{Pezpallet},
Pallet102: pezpallet::{Pezpallet},
Pallet103: pezpallet::{Pezpallet},
Pallet104: pezpallet::{Pezpallet},
Pallet105: pezpallet::{Pezpallet},
Pallet106: pezpallet::{Pezpallet},
Pallet107: pezpallet::{Pezpallet},
Pallet108: pezpallet::{Pezpallet},
Pallet109: pezpallet::{Pezpallet},
Pallet110: pezpallet::{Pezpallet},
}
}
@@ -19,36 +19,36 @@
use pezframe_support::derive_impl;
pub use pallet::*;
pub use pezpallet::*;
#[pezframe_support::pallet(dev_mode)]
pub mod pallet {
#[pezframe_support::pezpallet(dev_mode)]
pub mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
// The struct on which we build all of our Pallet logic.
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
// The struct on which we build all of our Pezpallet logic.
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
// Your Pallet's configuration trait, representing custom external types and interfaces.
#[pallet::config]
// Your Pezpallet's configuration trait, representing custom external types and interfaces.
#[pezpallet::config]
pub trait Config<I: 'static = ()>: pezframe_system::Config {}
#[pallet::composite_enum]
#[pezpallet::composite_enum]
pub enum HoldReason<I: 'static = ()> {
SomeHoldReason
}
#[pallet::composite_enum]
#[pezpallet::composite_enum]
pub enum FreezeReason<I: 'static = ()> {
SomeFreezeReason
}
#[pallet::composite_enum]
#[pezpallet::composite_enum]
pub enum SlashReason<I: 'static = ()> {
SomeSlashReason
}
#[pallet::composite_enum]
#[pezpallet::composite_enum]
pub enum LockId<I: 'static = ()> {
SomeLockId
}
@@ -68,13 +68,13 @@ pezframe_support::construct_runtime!(
{
// Exclude part `Storage` in order not to check its metadata in tests.
System: pezframe_system,
Pallet1: pallet,
Pallet2: pallet::<Instance2>,
Pallet1: pezpallet,
Pallet2: pezpallet::<Instance2>,
}
);
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
impl pallet::Config<pallet::Instance2> for Runtime {}
impl pezpallet::Config<pezpallet::Instance2> for Runtime {}
fn main() {}
@@ -19,15 +19,15 @@ use pezframe_support::{construct_runtime, derive_impl};
use pezsp_core::sr25519;
use pezsp_runtime::{generic, traits::BlakeTwo256};
#[pezframe_support::pallet]
mod pallet {
#[pallet::config]
#[pezframe_support::pezpallet]
mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::error]
#[pezpallet::error]
pub enum Error<T> {
MyError(crate::Nested1),
}
@@ -83,7 +83,7 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
@@ -115,8 +115,8 @@ impl pezframe_system::Config for Runtime {
construct_runtime! {
pub struct Runtime
{
System: pezframe_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet::{Pallet},
System: pezframe_system::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pezpallet: pezpallet::{Pezpallet},
}
}
@@ -0,0 +1,12 @@
error[E0080]: evaluation of constant value failed
--> tests/construct_runtime_ui/pallet_error_too_large.rs:115:1
|
115 | / construct_runtime! {
116 | | pub struct Runtime
117 | | {
118 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
121 | | }
| |_^ evaluation panicked: The maximum encoded size of the error type in the `Pallet` pallet exceeds `MAX_MODULE_ERROR_ENCODED_SIZE`
|
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -19,13 +19,13 @@ use pezframe_support::{construct_runtime, derive_impl};
use pezsp_core::sr25519;
use pezsp_runtime::{generic, traits::BlakeTwo256};
#[pezframe_support::pallet]
mod pallet {
#[pallet::config]
#[pezframe_support::pezpallet]
mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
}
pub type Signature = sr25519::Signature;
@@ -34,7 +34,7 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
@@ -66,8 +66,8 @@ impl pezframe_system::Config for Runtime {
construct_runtime! {
pub struct Runtime
{
System: pezframe_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet::{Pallet, Call},
System: pezframe_system::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pezpallet: pezpallet::{Pezpallet, Call},
}
}
@@ -19,13 +19,13 @@ use pezframe_support::{construct_runtime, derive_impl};
use pezsp_core::sr25519;
use pezsp_runtime::{generic, traits::BlakeTwo256};
#[pezframe_support::pallet]
mod pallet {
#[pallet::config]
#[pezframe_support::pezpallet]
mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
}
pub type Signature = sr25519::Signature;
@@ -34,7 +34,7 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
@@ -66,8 +66,8 @@ impl pezframe_system::Config for Runtime {
construct_runtime! {
pub struct Runtime
{
System: pezframe_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Event},
System: pezframe_system expanded::{}::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pezpallet: pezpallet expanded::{}::{Pezpallet, Event},
}
}
@@ -19,13 +19,13 @@ use pezframe_support::{construct_runtime, derive_impl};
use pezsp_core::sr25519;
use pezsp_runtime::{generic, traits::BlakeTwo256};
#[pezframe_support::pallet]
mod pallet {
#[pallet::config]
#[pezframe_support::pezpallet]
mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
}
pub type Signature = sr25519::Signature;
@@ -34,7 +34,7 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
@@ -66,8 +66,8 @@ impl pezframe_system::Config for Runtime {
construct_runtime! {
pub struct Runtime
{
System: pezframe_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Config},
System: pezframe_system expanded::{}::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pezpallet: pezpallet expanded::{}::{Pezpallet, Config},
}
}
@@ -19,13 +19,13 @@ use pezframe_support::{construct_runtime, derive_impl};
use pezsp_core::sr25519;
use pezsp_runtime::{generic, traits::BlakeTwo256};
#[pezframe_support::pallet]
mod pallet {
#[pallet::config]
#[pezframe_support::pezpallet]
mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
}
pub type Signature = sr25519::Signature;
@@ -34,7 +34,7 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
@@ -66,8 +66,8 @@ impl pezframe_system::Config for Runtime {
construct_runtime! {
pub struct Runtime
{
System: pezframe_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Inherent},
System: pezframe_system expanded::{}::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pezpallet: pezpallet expanded::{}::{Pezpallet, Inherent},
}
}
@@ -19,13 +19,13 @@ use pezframe_support::{construct_runtime, derive_impl};
use pezsp_core::sr25519;
use pezsp_runtime::{generic, traits::BlakeTwo256};
#[pezframe_support::pallet]
mod pallet {
#[pallet::config]
#[pezframe_support::pezpallet]
mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
}
pub type Signature = sr25519::Signature;
@@ -34,7 +34,7 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
@@ -66,8 +66,8 @@ impl pezframe_system::Config for Runtime {
construct_runtime! {
pub struct Runtime
{
System: pezframe_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Origin},
System: pezframe_system expanded::{}::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pezpallet: pezpallet expanded::{}::{Pezpallet, Origin},
}
}
@@ -19,13 +19,13 @@ use pezframe_support::{construct_runtime, derive_impl};
use pezsp_core::sr25519;
use pezsp_runtime::{generic, traits::BlakeTwo256};
#[pezframe_support::pallet]
mod pallet {
#[pallet::config]
#[pezframe_support::pezpallet]
mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
}
pub type Signature = sr25519::Signature;
@@ -34,7 +34,7 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
@@ -66,8 +66,8 @@ impl pezframe_system::Config for Runtime {
construct_runtime! {
pub struct Runtime
{
System: pezframe_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet::{Pallet, ValidateUnsigned},
System: pezframe_system::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pezpallet: pezpallet::{Pezpallet, ValidateUnsigned},
}
}
@@ -20,7 +20,7 @@ use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
System: system::{Pezpallet},
#[cfg(feature(test))]
Balance: balances::{Config, Call},
}
@@ -20,7 +20,7 @@ use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
System: system::{Pezpallet},
#[attr]
Balance: balances::{Config, Call},
}
@@ -0,0 +1,29 @@
// This file is part of Bizinikiwi.
// 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.
use pezframe_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pezpallet},
#[attr]
Balance: balances::{Config, Call},
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: Unsupported attribute, only #[cfg] is supported on pallet declarations in `construct_runtime`
--> tests/construct_runtime_ui/unsupported_pallet_attr.rs:24:3
|
24 | #[attr]
| ^
@@ -19,17 +19,17 @@ use pezframe_support::construct_runtime;
use pezsp_runtime::{generic, traits::BlakeTwo256};
use pezsp_core::sr25519;
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::storage]
#[pezpallet::storage]
type Foo<T> = StorageValue<Value=u8>;
}
@@ -39,13 +39,13 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
impl pezpallet::Config for Runtime {}
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet use_parts { Call },
System: system::{Pezpallet, Call, Storage, Config<T>, Event<T>},
Pezpallet: pezpallet use_parts { Call },
}
}
@@ -29,7 +29,7 @@ fn derive_impl_ui() {
// As trybuild is using `cargo check`, we don't need the real WASM binaries.
std::env::set_var("SKIP_WASM_BUILD", "1");
// Deny all warnings since we emit warnings as part of a Pallet's UI.
// Deny all warnings since we emit warnings as part of a Pezpallet's UI.
std::env::set_var("CARGO_ENCODED_RUSTFLAGS", "--deny=warnings");
let t = trybuild::TestCases::new();
@@ -22,17 +22,17 @@ pub trait Config {
type RuntimeCall;
}
struct Pallet;
struct Pezpallet;
#[register_default_impl(Pallet)]
impl Config for Pallet {
#[register_default_impl(Pezpallet)]
impl Config for Pezpallet {
#[inject_runtime_type]
type RuntimeCall = ();
}
struct SomePallet;
#[derive_impl(Pallet)] // Injects type RuntimeCall = RuntimeCall;
#[derive_impl(Pezpallet)] // Injects type RuntimeCall = RuntimeCall;
impl Config for SomePallet {}
assert_type_eq_all!(<SomePallet as Config>::RuntimeCall, u32);
@@ -24,17 +24,17 @@ pub trait Config {
type RuntimeInfo = u32;
struct Pallet;
struct Pezpallet;
#[register_default_impl(Pallet)]
impl Config for Pallet {
#[register_default_impl(Pezpallet)]
impl Config for Pezpallet {
#[inject_runtime_type]
type RuntimeInfo = ();
}
struct SomePallet;
#[derive_impl(Pallet)] // Injects type RuntimeInfo = RuntimeInfo;
#[derive_impl(Pezpallet)] // Injects type RuntimeInfo = RuntimeInfo;
impl Config for SomePallet {}
assert_type_eq_all!(<SomePallet as Config>::RuntimeInfo, u32);
@@ -24,17 +24,17 @@ pub trait Config {
type RuntimeCall = u32;
struct Pallet;
struct Pezpallet;
#[register_default_impl(Pallet)]
impl Config for Pallet {
#[register_default_impl(Pezpallet)]
impl Config for Pezpallet {
#[inject_runtime_type]
type RuntimeCall = ();
}
struct SomePallet;
#[derive_impl(Pallet)] // Injects type RuntimeCall = RuntimeCall;
#[derive_impl(Pezpallet)] // Injects type RuntimeCall = RuntimeCall;
impl Config for SomePallet {}
assert_type_eq_all!(<SomePallet as Config>::RuntimeCall, u32);
@@ -27,7 +27,7 @@ fn derive_no_bound_ui() {
// As trybuild is using `cargo check`, we don't need the real WASM binaries.
std::env::set_var("SKIP_WASM_BUILD", "1");
// Deny all warnings since we emit warnings as part of a Pallet's UI.
// Deny all warnings since we emit warnings as part of a Pezpallet's UI.
std::env::set_var("CARGO_ENCODED_RUSTFLAGS", "--deny=warnings");
let t = trybuild::TestCases::new();
@@ -46,14 +46,14 @@ impl SomeAssociation1 for u64 {
type _1 = u64;
}
#[pezframe_support::pallet]
pub mod pallet {
#[pezframe_support::pezpallet]
pub mod pezpallet {
use super::*;
use pezframe_support::pezpallet_prelude::*;
pub(crate) const STORAGE_VERSION: StorageVersion = StorageVersion::new(10);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config
where
<Self as pezframe_system::Config>::AccountId: From<SomeType1> + SomeAssociation1,
@@ -64,11 +64,11 @@ pub mod pallet {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
}
#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
#[pezpallet::storage_version(STORAGE_VERSION)]
pub struct Pezpallet<T>(_);
#[pallet::error]
#[pezpallet::error]
#[derive(PartialEq, Eq)]
pub enum Error<T> {
/// error doc comment put in metadata
@@ -80,7 +80,7 @@ pub mod pallet {
CompactU8(#[codec(compact)] u8),
}
#[pallet::event]
#[pezpallet::event]
pub enum Event<T: Config>
where
T::AccountId: SomeAssociation1 + From<SomeType1>,
@@ -93,7 +93,7 @@ pub mod pallet {
B,
}
#[pallet::origin]
#[pezpallet::origin]
#[derive(
EqNoBound,
RuntimeDebugNoBound,
@@ -128,7 +128,7 @@ impl pezframe_system::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type MaxConsumers = ConstU32<16>;
}
impl pallet::Config for Runtime {
impl pezpallet::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Balance = u64;
}
@@ -145,8 +145,8 @@ pub type UncheckedExtrinsic = pezsp_runtime::generic::UncheckedExtrinsic<
pezframe_support::construct_runtime!(
pub struct Runtime {
// Exclude part `Storage` in order not to check its metadata in tests.
System: pezframe_system exclude_parts { Pallet, Storage },
Example: pallet,
System: pezframe_system exclude_parts { Pezpallet, Storage },
Example: pezpallet,
}
);
@@ -157,7 +157,7 @@ fn pezpallet_metadata() {
let pallets = Runtime::metadata_ir().pallets;
let example = pallets[0].clone();
{
// Example pallet events are partially and fully deprecated
// Example pezpallet events are partially and fully deprecated
let meta = example.event.unwrap();
assert_eq!(
EnumDeprecationInfoIR(BTreeMap::from([
@@ -29,40 +29,40 @@ use pezsp_runtime::{
traits::{BlakeTwo256, Verify},
};
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod no_instance {
use super::*;
use pezframe_support::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::call]
impl<T: Config> Pallet<T> {}
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {}
#[pallet::storage]
#[pezpallet::storage]
pub type Value<T> = StorageValue<_, u32, ValueQuery>;
#[pallet::storage]
#[pezpallet::storage]
pub type Map<T> = StorageMap<_, Blake2_128Concat, u32, u32, ValueQuery>;
#[pallet::storage]
#[pezpallet::storage]
pub type Map2<T> = StorageMap<_, Twox64Concat, u32, u32, ValueQuery>;
#[pallet::storage]
#[pezpallet::storage]
pub type DoubleMap<T> =
StorageDoubleMap<_, Blake2_128Concat, u32, Blake2_128Concat, u32, u32, ValueQuery>;
#[pallet::storage]
#[pezpallet::storage]
pub type DoubleMap2<T> =
StorageDoubleMap<_, Twox64Concat, u32, Twox64Concat, u32, u32, ValueQuery>;
#[pallet::storage]
#[pallet::getter(fn test_generic_value)]
#[pezpallet::storage]
#[pezpallet::getter(fn test_generic_value)]
pub type TestGenericValue<T: Config> = StorageValue<_, BlockNumberFor<T>, OptionQuery>;
#[pallet::storage]
#[pallet::getter(fn foo2)]
#[pezpallet::storage]
#[pezpallet::getter(fn foo2)]
pub type TestGenericDoubleMap<T: Config> = StorageDoubleMap<
_,
Blake2_128Concat,
@@ -73,7 +73,7 @@ mod no_instance {
ValueQuery,
>;
#[pallet::genesis_config]
#[pezpallet::genesis_config]
pub struct GenesisConfig<T: Config> {
pub value: u32,
pub test_generic_value: BlockNumberFor<T>,
@@ -90,7 +90,7 @@ mod no_instance {
}
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
fn build(&self) {
<Value<T>>::put(self.value);
@@ -102,43 +102,43 @@ mod no_instance {
}
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod instance {
use super::*;
use pezframe_support::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::config]
#[pezpallet::config]
pub trait Config<I: 'static = ()>: pezframe_system::Config {}
#[pallet::call]
impl<T: Config<I>, I: 'static> Pallet<T, I> {}
#[pezpallet::call]
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {}
#[pallet::storage]
#[pezpallet::storage]
pub type Value<T: Config<I>, I: 'static = ()> = StorageValue<_, u32, ValueQuery>;
#[pallet::storage]
#[pezpallet::storage]
pub type Map<T: Config<I>, I: 'static = ()> =
StorageMap<_, Blake2_128Concat, u32, u32, ValueQuery>;
#[pallet::storage]
#[pezpallet::storage]
pub type Map2<T: Config<I>, I: 'static = ()> =
StorageMap<_, Twox64Concat, u32, u32, ValueQuery>;
#[pallet::storage]
#[pezpallet::storage]
pub type DoubleMap<T: Config<I>, I: 'static = ()> =
StorageDoubleMap<_, Blake2_128Concat, u32, Blake2_128Concat, u32, u32, ValueQuery>;
#[pallet::storage]
#[pezpallet::storage]
pub type DoubleMap2<T: Config<I>, I: 'static = ()> =
StorageDoubleMap<_, Twox64Concat, u32, Twox64Concat, u32, u32, ValueQuery>;
#[pallet::storage]
#[pallet::getter(fn test_generic_value)]
#[pezpallet::storage]
#[pezpallet::getter(fn test_generic_value)]
pub type TestGenericValue<T: Config<I>, I: 'static = ()> =
StorageValue<_, BlockNumberFor<T>, OptionQuery>;
#[pallet::storage]
#[pallet::getter(fn foo2)]
#[pezpallet::storage]
#[pezpallet::getter(fn foo2)]
pub type TestGenericDoubleMap<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
Blake2_128Concat,
@@ -149,7 +149,7 @@ mod instance {
ValueQuery,
>;
#[pallet::genesis_config]
#[pezpallet::genesis_config]
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
pub value: u32,
pub test_generic_value: BlockNumberFor<T>,
@@ -168,7 +168,7 @@ mod instance {
}
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I> {
fn build(&self) {
<Value<T, I>>::put(self.value);
@@ -23,26 +23,26 @@ use pezsp_runtime::{
traits::{BlakeTwo256, Verify},
};
#[pezframe_support::pallet]
pub mod pallet {
#[pezframe_support::pezpallet]
pub mod pezpallet {
use super::*;
use pezframe_support::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::call]
impl<T: Config> Pallet<T> {}
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {}
#[pallet::storage]
#[pallet::unbounded]
#[pezpallet::storage]
#[pezpallet::unbounded]
pub type AppendableDM<T: Config> =
StorageDoubleMap<_, Identity, u32, Identity, BlockNumberFor<T>, Vec<u32>>;
#[pallet::genesis_config]
#[pezpallet::genesis_config]
pub struct GenesisConfig<T: Config> {
pub t: Vec<(u32, BlockNumberFor<T>, Vec<u32>)>,
}
@@ -53,7 +53,7 @@ pub mod pallet {
}
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
fn build(&self) {
for (k1, k2, v) in &self.t {
@@ -75,7 +75,7 @@ pezframe_support::construct_runtime!(
{
System: pezframe_system,
MyPallet: pallet,
MyPallet: pezpallet,
}
);
@@ -90,9 +90,9 @@ impl pezframe_system::Config for Test {
type OnSetCode = ();
}
impl pallet::Config for Test {}
impl pezpallet::Config for Test {}
#[test]
fn init_genesis_config() {
pallet::GenesisConfig::<Test>::default();
pezpallet::GenesisConfig::<Test>::default();
}
@@ -39,16 +39,16 @@ pub trait Currency {}
// Test for:
// * No default instance
// * Origin, Inherent, Event
#[pezframe_support::pallet(dev_mode)]
#[pezframe_support::pezpallet(dev_mode)]
mod module1 {
use super::*;
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T, I = ()>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config<I: 'static = ()>: pezframe_system::Config {
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self, I>>
@@ -58,9 +58,9 @@ mod module1 {
type GenericType: Parameter + Member + MaybeSerializeDeserialize + Default + MaxEncodedLen;
}
#[pallet::call]
impl<T: Config<I>, I: 'static> Pallet<T, I> {
#[pallet::weight(0)]
#[pezpallet::call]
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
#[pezpallet::weight(0)]
pub fn one(origin: OriginFor<T>) -> DispatchResult {
ensure_root(origin)?;
Self::deposit_event(Event::AnotherVariant(3));
@@ -68,15 +68,15 @@ mod module1 {
}
}
#[pallet::storage]
#[pallet::getter(fn value)]
#[pezpallet::storage]
#[pezpallet::getter(fn value)]
pub type Value<T: Config<I>, I: 'static = ()> = StorageValue<_, T::GenericType, ValueQuery>;
#[pallet::storage]
#[pallet::getter(fn map)]
#[pezpallet::storage]
#[pezpallet::getter(fn map)]
pub type Map<T: Config<I>, I: 'static = ()> = StorageMap<_, Identity, u32, u64, ValueQuery>;
#[pallet::genesis_config]
#[pezpallet::genesis_config]
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
pub value: <T as Config<I>>::GenericType,
pub test: BlockNumberFor<T>,
@@ -88,7 +88,7 @@ mod module1 {
}
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I>
where
BlockNumberFor<T>: std::fmt::Display,
@@ -99,20 +99,20 @@ mod module1 {
}
}
#[pallet::error]
#[pezpallet::error]
pub enum Error<T, I = ()> {
/// Test
Test,
}
#[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<I>, I: 'static = ()> {
_Phantom(PhantomData<T>),
AnotherVariant(u32),
}
#[pallet::origin]
#[pezpallet::origin]
#[derive(
Clone,
PartialEq,
@@ -132,8 +132,8 @@ mod module1 {
pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"12345678";
#[pallet::inherent]
impl<T: Config<I>, I: 'static> ProvideInherent for Pallet<T, I>
#[pezpallet::inherent]
impl<T: Config<I>, I: 'static> ProvideInherent for Pezpallet<T, I>
where
BlockNumberFor<T>: From<u32>,
{
@@ -158,15 +158,15 @@ mod module1 {
// Test for:
// * default instance
// * use of no_genesis_config_phantom_data
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod module2 {
use super::*;
use pezframe_support::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::config]
#[pezpallet::config]
pub trait Config<I: 'static = ()>: pezframe_system::Config {
type Amount: Parameter + MaybeSerializeDeserialize + Default + MaxEncodedLen;
#[allow(deprecated)]
@@ -175,22 +175,22 @@ mod module2 {
type RuntimeOrigin: From<Origin<Self, I>>;
}
impl<T: Config<I>, I: 'static> Currency for Pallet<T, I> {}
impl<T: Config<I>, I: 'static> Currency for Pezpallet<T, I> {}
#[pallet::call]
impl<T: Config<I>, I: 'static> Pallet<T, I> {}
#[pezpallet::call]
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {}
#[pallet::storage]
#[pezpallet::storage]
pub type Value<T: Config<I>, I: 'static = ()> = StorageValue<_, T::Amount, ValueQuery>;
#[pallet::storage]
#[pezpallet::storage]
pub type Map<T: Config<I>, I: 'static = ()> = StorageMap<_, Identity, u64, u64, ValueQuery>;
#[pallet::storage]
#[pezpallet::storage]
pub type DoubleMap<T: Config<I>, I: 'static = ()> =
StorageDoubleMap<_, Identity, u64, Identity, u64, u64, ValueQuery>;
#[pallet::genesis_config]
#[pezpallet::genesis_config]
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
pub value: T::Amount,
pub map: Vec<(u64, u64)>,
@@ -207,7 +207,7 @@ mod module2 {
}
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I>
where
BlockNumberFor<T>: std::fmt::Display,
@@ -223,12 +223,12 @@ mod module2 {
}
}
#[pallet::event]
#[pezpallet::event]
pub enum Event<T: Config<I>, I: 'static = ()> {
Variant(T::Amount),
}
#[pallet::origin]
#[pezpallet::origin]
#[derive(
Clone,
PartialEq,
@@ -248,8 +248,8 @@ mod module2 {
pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"12345678";
#[pallet::inherent]
impl<T: Config<I>, I: 'static> ProvideInherent for Pallet<T, I> {
#[pezpallet::inherent]
impl<T: Config<I>, I: 'static> ProvideInherent for Pezpallet<T, I> {
type Call = Call<T, I>;
type Error = MakeFatalError<()>;
const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER;
@@ -270,15 +270,15 @@ mod module2 {
// Test for:
// * Depends on multiple instances of a module with instances
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod module3 {
use super::*;
use pezframe_support::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::config]
#[pezpallet::config]
pub trait Config<I: 'static = ()>:
pezframe_system::Config + module2::Config<I> + module2::Config<module2::Instance1>
{
@@ -286,8 +286,8 @@ mod module3 {
type Currency2: Currency;
}
#[pallet::call]
impl<T: Config<I>, I: 'static> Pallet<T, I> {}
#[pezpallet::call]
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {}
}
pub type BlockNumber = u32;
@@ -23,7 +23,7 @@ use pezsp_runtime::{
traits::{BlakeTwo256, Verify},
};
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod module {
use super::*;
use pezframe_support::pezpallet_prelude::*;
@@ -79,42 +79,42 @@ mod module {
}
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config + TypeInfo {}
#[pallet::call]
impl<T: Config> Pallet<T> {}
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {}
/// requirements to enter and maintain status in roles
#[pallet::storage]
#[pallet::getter(fn parameters)]
#[pezpallet::storage]
#[pezpallet::getter(fn parameters)]
pub type Parameters<T: Config> =
StorageMap<_, Blake2_128Concat, Role, RoleParameters<T>, OptionQuery>;
/// the roles members can enter into
#[pallet::storage]
#[pallet::getter(fn available_roles)]
#[pallet::unbounded]
#[pezpallet::storage]
#[pezpallet::getter(fn available_roles)]
#[pezpallet::unbounded]
pub type AvailableRoles<T: Config> = StorageValue<_, Vec<Role>, ValueQuery>;
/// Actors list
#[pallet::storage]
#[pallet::getter(fn actor_account_ids)]
#[pallet::unbounded]
#[pezpallet::storage]
#[pezpallet::getter(fn actor_account_ids)]
#[pezpallet::unbounded]
pub type ActorAccountIds<T: Config> = StorageValue<_, Vec<T::AccountId>>;
/// actor accounts associated with a role
#[pallet::storage]
#[pallet::getter(fn account_ids_by_role)]
#[pallet::unbounded]
#[pezpallet::storage]
#[pezpallet::getter(fn account_ids_by_role)]
#[pezpallet::unbounded]
pub type AccountIdsByRole<T: Config> = StorageMap<_, Blake2_128Concat, Role, Vec<T::AccountId>>;
/// tokens locked until given block number
#[pallet::storage]
#[pallet::getter(fn bondage)]
#[pezpallet::storage]
#[pezpallet::getter(fn bondage)]
pub type Bondage<T: Config> = StorageMap<_, Blake2_128Concat, T::AccountId, BlockNumberFor<T>>;
/// First step before enter a role is registering intent with a new account/key.
@@ -123,17 +123,17 @@ mod module {
/// role. The account making the request will be bonded and must have
/// sufficient balance to cover the minimum stake for the role.
/// Bonding only occurs after successful entry into a role.
#[pallet::storage]
#[pallet::getter(fn role_entry_requests)]
#[pallet::unbounded]
#[pezpallet::storage]
#[pezpallet::getter(fn role_entry_requests)]
#[pezpallet::unbounded]
pub type RoleEntryRequests<T: Config> = StorageValue<_, Requests<T>>;
/// Entry request expires after this number of blocks
#[pallet::storage]
#[pallet::getter(fn request_life_time)]
#[pezpallet::storage]
#[pezpallet::getter(fn request_life_time)]
pub type RequestLifeTime<T: Config> = StorageValue<_, u64, ValueQuery, ConstU64<0>>;
#[pallet::genesis_config]
#[pezpallet::genesis_config]
#[derive(pezframe_support::DefaultNoBound)]
pub struct GenesisConfig<T: Config> {
pub enable_storage_role: bool,
@@ -142,7 +142,7 @@ mod module {
pub _config: core::marker::PhantomData<T>,
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
fn build(&self) {
if self.enable_storage_role {
@@ -26,29 +26,29 @@ use pezframe_support::{
use pezsp_runtime::{generic, traits::BlakeTwo256};
mod nested {
#[pezframe_support::pallet(dev_mode)]
#[pezframe_support::pezpallet(dev_mode)]
pub mod module {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self>>
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
pub fn fail(_origin: OriginFor<T>) -> DispatchResult {
Err(Error::<T>::Something.into())
}
}
#[pallet::origin]
#[pezpallet::origin]
#[derive(
Clone,
PartialEq,
@@ -62,74 +62,74 @@ mod nested {
)]
pub struct Origin;
#[pallet::event]
#[pezpallet::event]
pub enum Event<T> {
A,
}
#[pallet::error]
#[pezpallet::error]
pub enum Error<T> {
Something,
}
#[pallet::genesis_config]
#[pezpallet::genesis_config]
#[derive(pezframe_support::DefaultNoBound)]
pub struct GenesisConfig<T: Config> {
#[serde(skip)]
pub _config: core::marker::PhantomData<T>,
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
fn build(&self) {}
}
}
}
#[pezframe_support::pallet(dev_mode)]
#[pezframe_support::pezpallet(dev_mode)]
pub mod module {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
pub fn fail(_origin: OriginFor<T>) -> DispatchResult {
Err(Error::<T>::Something.into())
}
pub fn aux_1(_origin: OriginFor<T>, #[pallet::compact] _data: u32) -> DispatchResult {
pub fn aux_1(_origin: OriginFor<T>, #[pezpallet::compact] _data: u32) -> DispatchResult {
unreachable!()
}
pub fn aux_2(
_origin: OriginFor<T>,
_data: i32,
#[pallet::compact] _data2: u32,
#[pezpallet::compact] _data2: u32,
) -> DispatchResult {
unreachable!()
}
#[pallet::weight(0)]
#[pezpallet::weight(0)]
pub fn aux_3(_origin: OriginFor<T>, _data: i32, _data2: String) -> DispatchResult {
unreachable!()
}
#[pallet::weight(3)]
#[pezpallet::weight(3)]
pub fn aux_4(_origin: OriginFor<T>) -> DispatchResult {
unreachable!()
}
#[pallet::weight((5, DispatchClass::Operational))]
#[pezpallet::weight((5, DispatchClass::Operational))]
pub fn operational(_origin: OriginFor<T>) -> DispatchResult {
unreachable!()
}
}
#[pallet::origin]
#[pezpallet::origin]
#[derive(
Clone,
PartialEq,
@@ -143,24 +143,24 @@ pub mod module {
)]
pub struct Origin<T>(pub PhantomData<T>);
#[pallet::event]
#[pezpallet::event]
pub enum Event<T> {
A,
}
#[pallet::error]
#[pezpallet::error]
pub enum Error<T> {
Something,
}
#[pallet::genesis_config]
#[pezpallet::genesis_config]
#[derive(pezframe_support::DefaultNoBound)]
pub struct GenesisConfig<T: Config> {
#[serde(skip)]
pub _config: core::marker::PhantomData<T>,
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
fn build(&self) {}
}
File diff suppressed because it is too large Load Diff
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet [foo]]
#[pezframe_support::pezpallet [foo]]
mod foo {
}
@@ -15,25 +15,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
#[pallet::constant(Hello)]
#[pezpallet::constant(Hello)]
type MyGetParam2: Get<u32>;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {}
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {}
}
fn main() {}
@@ -15,12 +15,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default)]
#[pezpallet::config(with_default)]
pub trait Config: pezframe_system::Config {
type WeightInfo: WeightInfo;
}
@@ -28,14 +28,14 @@ mod pallet {
pub trait WeightInfo {
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::call(weight = T::WeightInfo)]
impl<T: Config> Pallet<T> {
#[pallet::weight_of_authorize(Weight::zero())]
#[pallet::weight(Weight::zero())]
#[pallet::call_index(0)]
#[pezpallet::call(weight = T::WeightInfo)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weight_of_authorize(Weight::zero())]
#[pezpallet::weight(Weight::zero())]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
let _ = origin;
let _ = a;
@@ -15,12 +15,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default)]
#[pezpallet::config(with_default)]
pub trait Config: pezframe_system::Config {
type WeightInfo: WeightInfo;
}
@@ -28,15 +28,15 @@ mod pallet {
pub trait WeightInfo {
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::call(weight = T::WeightInfo)]
impl<T: Config> Pallet<T> {
#[pallet::authorize(|_| true)]
#[pallet::weight_of_authorize(Weight::zero())]
#[pallet::weight(Weight::zero())]
#[pallet::call_index(0)]
#[pezpallet::call(weight = T::WeightInfo)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::authorize(|_| true)]
#[pezpallet::weight_of_authorize(Weight::zero())]
#[pezpallet::weight(Weight::zero())]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
let _ = origin;
let _ = a;
@@ -15,12 +15,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default)]
#[pezpallet::config(with_default)]
pub trait Config: pezframe_system::Config {
type WeightInfo: WeightInfo;
}
@@ -28,15 +28,15 @@ mod pallet {
pub trait WeightInfo {
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::call(weight = T::WeightInfo)]
impl<T: Config> Pallet<T> {
#[pallet::authorize(|_, _: u8| -> bool { true })]
#[pallet::weight_of_authorize(Weight::zero())]
#[pallet::weight(Weight::zero())]
#[pallet::call_index(0)]
#[pezpallet::call(weight = T::WeightInfo)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::authorize(|_, _: u8| -> bool { true })]
#[pezpallet::weight_of_authorize(Weight::zero())]
#[pezpallet::weight(Weight::zero())]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
let _ = origin;
let _ = a;
@@ -15,12 +15,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default)]
#[pezpallet::config(with_default)]
pub trait Config: pezframe_system::Config {
type WeightInfo: WeightInfo;
}
@@ -28,15 +28,15 @@ mod pallet {
pub trait WeightInfo {
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::call(weight = T::WeightInfo)]
impl<T: Config> Pallet<T> {
#[pallet::authorize()]
#[pallet::weight_of_authorize(Weight::zero())]
#[pallet::weight(Weight::zero())]
#[pallet::call_index(0)]
#[pezpallet::call(weight = T::WeightInfo)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::authorize()]
#[pezpallet::weight_of_authorize(Weight::zero())]
#[pezpallet::weight(Weight::zero())]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
let _ = origin;
let _ = a;
@@ -15,12 +15,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default)]
#[pezpallet::config(with_default)]
pub trait Config: pezframe_system::Config {
type WeightInfo: WeightInfo;
}
@@ -28,15 +28,15 @@ mod pallet {
pub trait WeightInfo {
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::call(weight = T::WeightInfo)]
impl<T: Config> Pallet<T> {
#[pallet::authorize(Ok(Default::default()))]
#[pallet::weight_of_authorize(Weight::zero())]
#[pallet::weight(Weight::zero())]
#[pallet::call_index(0)]
#[pezpallet::call(weight = T::WeightInfo)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::authorize(Ok(Default::default()))]
#[pezpallet::weight_of_authorize(Weight::zero())]
#[pezpallet::weight(Weight::zero())]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
let _ = origin;
let _ = a;
@@ -15,12 +15,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default)]
#[pezpallet::config(with_default)]
pub trait Config: pezframe_system::Config {
type WeightInfo: WeightInfo;
}
@@ -28,17 +28,17 @@ mod pallet {
pub trait WeightInfo {
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::call(weight = T::WeightInfo)]
impl<T: Config> Pallet<T> {
#[pallet::authorize(|_a: &u32| -> TransactionValidityWithRefund {
#[pezpallet::call(weight = T::WeightInfo)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::authorize(|_a: &u32| -> TransactionValidityWithRefund {
Ok(Default::default())
})]
#[pallet::weight_of_authorize(Weight::zero())]
#[pallet::weight(Weight::zero())]
#[pallet::call_index(0)]
#[pezpallet::weight_of_authorize(Weight::zero())]
#[pezpallet::weight(Weight::zero())]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
let _ = origin;
let _ = a;
@@ -15,12 +15,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default)]
#[pezpallet::config(with_default)]
pub trait Config: pezframe_system::Config {
type WeightInfo: WeightInfo;
}
@@ -28,15 +28,15 @@ mod pallet {
pub trait WeightInfo {
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::call(weight = T::WeightInfo)]
impl<T: Config> Pallet<T> {
#[pallet::authorize(|_, _| Ok(Default::default()))]
#[pallet::weight_of_authorize("foo")]
#[pallet::weight(Weight::zero())]
#[pallet::call_index(0)]
#[pezpallet::call(weight = T::WeightInfo)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::authorize(|_, _| Ok(Default::default()))]
#[pezpallet::weight_of_authorize("foo")]
#[pezpallet::weight(Weight::zero())]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
let _ = origin;
let _ = a;
@@ -15,12 +15,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default)]
#[pezpallet::config(with_default)]
pub trait Config: pezframe_system::Config {
type WeightInfo: WeightInfo;
}
@@ -28,14 +28,14 @@ mod pallet {
pub trait WeightInfo {
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::call(weight = T::WeightInfo)]
impl<T: Config> Pallet<T> {
#[pallet::authorize(|_, _| Ok(Default::default()))]
#[pallet::weight(Weight::zero())]
#[pallet::call_index(0)]
#[pezpallet::call(weight = T::WeightInfo)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::authorize(|_, _| Ok(Default::default()))]
#[pezpallet::weight(Weight::zero())]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
let _ = origin;
let _ = a;
@@ -15,12 +15,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default)]
#[pezpallet::config(with_default)]
pub trait Config: pezframe_system::Config {
type WeightInfo: WeightInfo;
}
@@ -28,14 +28,14 @@ mod pallet {
pub trait WeightInfo {
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::call(weight = T::WeightIn)]
impl<T: Config> Pallet<T> {
#[pallet::authorize(|_, _| Ok(Default::default()))]
#[pallet::weight(Weight::zero())]
#[pallet::call_index(0)]
#[pezpallet::call(weight = T::WeightIn)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::authorize(|_, _| Ok(Default::default()))]
#[pezpallet::weight(Weight::zero())]
#[pezpallet::call_index(0)]
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
let _ = origin;
let _ = a;
@@ -15,26 +15,26 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::{Hooks, DispatchResultWithPostInfo};
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type Bar: codec::Codec + scale_info::TypeInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
#[pallet::call_index(0)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weight(0)]
#[pezpallet::call_index(0)]
pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
Ok(().into())
}
@@ -15,26 +15,26 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::{Hooks, DispatchResultWithPostInfo};
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type Bar: scale_info::TypeInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
#[pallet::call_index(0)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weight(0)]
#[pezpallet::call_index(0)]
pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
Ok(().into())
}
@@ -15,28 +15,28 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use codec::{Decode, DecodeWithMemTracking, Encode};
use pezframe_support::pezpallet_prelude::{DispatchResultWithPostInfo, Hooks};
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[derive(Encode, Decode, DecodeWithMemTracking, scale_info::TypeInfo, PartialEq, Clone)]
struct Bar;
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
#[pallet::call_index(0)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weight(0)]
#[pezpallet::call_index(0)]
pub fn foo(origin: OriginFor<T>, _bar: Bar) -> DispatchResultWithPostInfo {
Ok(().into())
}
@@ -15,24 +15,24 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
#[pallet::call_index(10)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weight(0)]
#[pezpallet::call_index(10)]
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
#[pallet::weight(0)]
#[pallet::call_index(10)]
#[pezpallet::weight(0)]
#[pezpallet::call_index(10)]
pub fn bar(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
}
}
@@ -15,20 +15,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet(dev_mode)]
mod pallet {
#[pezframe_support::pezpallet(dev_mode)]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResult;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::feeless_if(|| -> bool { true })]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::feeless_if(|| -> bool { true })]
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
}
}
@@ -15,20 +15,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet(dev_mode)]
mod pallet {
#[pezframe_support::pezpallet(dev_mode)]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResult;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::feeless_if(|_: bool| -> bool { true })]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::feeless_if(|_: bool| -> bool { true })]
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
}
}
@@ -15,20 +15,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet(dev_mode)]
mod pallet {
#[pezframe_support::pezpallet(dev_mode)]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResult;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::feeless_if(|_: &OriginFor<T>, _s: &u32| -> bool { true })]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::feeless_if(|_: &OriginFor<T>, _s: &u32| -> bool { true })]
pub fn foo(_: OriginFor<T>, _something: u64) -> DispatchResult { Ok(()) }
}
}
@@ -15,20 +15,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet(dev_mode)]
mod pallet {
#[pezframe_support::pezpallet(dev_mode)]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResult;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::feeless_if(|_: &OriginFor<T>| -> u32 { 0 })]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::feeless_if(|_: &OriginFor<T>| -> u32 { 0 })]
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
}
}
@@ -15,20 +15,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet(dev_mode)]
mod pallet {
#[pezframe_support::pezpallet(dev_mode)]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResult;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::feeless_if(0)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::feeless_if(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
}
}
@@ -15,20 +15,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0something)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0something)]
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
}
}
@@ -15,20 +15,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weird_attr]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weird_attr]
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
}
}
@@ -15,22 +15,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::Hooks;
use pezframe_system::pezpallet_prelude::BlockNumberFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
const Foo: u8 = 3u8;
}
}
@@ -15,21 +15,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
#[pallet::call_index(256)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weight(0)]
#[pezpallet::call_index(256)]
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
}
}
@@ -15,22 +15,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::Hooks;
use pezframe_system::pezpallet_prelude::BlockNumberFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
pub fn foo(origin: u8) {}
}
}
@@ -15,22 +15,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::Hooks;
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
pub fn foo(origin: OriginFor<T>) -> ::DispatchResult { todo!() }
}
}
@@ -15,25 +15,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::{Hooks, DispatchResultWithPostInfo};
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type Bar: codec::Codec;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weight(0)]
fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
Ok(().into())
}
@@ -15,25 +15,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::{Hooks, DispatchResultWithPostInfo};
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type Bar: codec::Codec;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weight(0)]
pub(crate) fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
Ok(().into())
}
@@ -15,25 +15,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResult;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weight(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
#[pallet::weight(0)]
#[pezpallet::weight(0)]
pub fn bar(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
@@ -15,22 +15,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::{Hooks, DispatchResultWithPostInfo};
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
}
}
@@ -15,22 +15,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
#[pallet::call_index(1)]
#[pallet::call_index(2)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::weight(0)]
#[pezpallet::call_index(1)]
#[pezpallet::call_index(2)]
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
}
}
@@ -15,22 +15,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::Hooks;
use pezframe_system::pezpallet_prelude::BlockNumberFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
pub fn foo() {}
}
}
@@ -15,22 +15,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::Hooks;
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
pub fn foo(origin: OriginFor<T>) {}
}
}
@@ -15,19 +15,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet(dev_mode)]
mod pallet {
#[pezframe_support::pezpallet(dev_mode)]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::call]
impl <T: Config> Pallet<T> {
#[pezpallet::call]
impl <T: Config> Pezpallet<T> {
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
return Err(DispatchError::BadOrigin);
}
@@ -15,21 +15,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResult;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pallet::weight(10_000something)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
#[pezpallet::weight(10_000something)]
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
}
}
@@ -15,21 +15,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResult;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pallet::weight(123_u64)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
#[pezpallet::weight(123_u64)]
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
}
}
@@ -15,25 +15,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResult;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pallet::weight(123)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
#[pezpallet::weight(123)]
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
#[pallet::call_index(1)]
#[pallet::weight(123_custom_prefix)]
#[pezpallet::call_index(1)]
#[pezpallet::weight(123_custom_prefix)]
pub fn bar(_: OriginFor<T>) -> DispatchResult { Ok(()) }
}
}
@@ -21,42 +21,42 @@ pub trait WeightInfo {
fn foo() -> Weight;
}
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use super::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type WeightInfo: crate::WeightInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call(invalid)]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call(invalid)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
}
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod assign {
use super::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type WeightInfo: crate::WeightInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call = invalid]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call = invalid]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
@@ -24,42 +24,42 @@ pub trait WeightInfo {
fn foo() -> Weight;
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod parentheses {
use super::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type WeightInfo: crate::WeightInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call(weight(prefix))]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call(weight(prefix))]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
}
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod assign {
use super::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type WeightInfo: crate::WeightInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call(weight = prefix)]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call(weight = prefix)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
@@ -24,42 +24,42 @@ pub trait WeightInfo {
fn foo() -> Weight;
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod parentheses {
use super::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type WeightInfo: crate::WeightInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call(weight(123))]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call(weight(123))]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
}
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod assign {
use super::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type WeightInfo: crate::WeightInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call(weight = 123)]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call(weight = 123)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
@@ -23,42 +23,42 @@ use pezframe_system::pezpallet_prelude::*;
pub trait WeightInfo {
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod parentheses {
use super::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type WeightInfo: crate::WeightInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call(weight(<T as Config>::WeightInfo))]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call(weight(<T as Config>::WeightInfo))]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
}
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod assign {
use super::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
type WeightInfo: crate::WeightInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call(weight = <T as Config>::WeightInfo)]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call(weight = <T as Config>::WeightInfo)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
@@ -17,40 +17,40 @@
// Stray tokens after good input.
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod parentheses {
use super::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call(weight(<T as Config>::WeightInfo straycat))]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call(weight(<T as Config>::WeightInfo straycat))]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
}
}
#[pezframe_support::pallet]
#[pezframe_support::pezpallet]
mod assign {
use super::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call(weight = <T as Config>::WeightInfo straycat)]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pezpallet::call(weight = <T as Config>::WeightInfo straycat)]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
pub fn foo(_: OriginFor<T>) -> DispatchResult {
Ok(())
}
@@ -15,21 +15,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::DispatchResult;
use pezframe_system::pezpallet_prelude::OriginFor;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pallet::weight(*_unused)]
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
#[pezpallet::call_index(0)]
#[pezpallet::weight(*_unused)]
pub fn foo(_: OriginFor<T>, _unused: u64) -> DispatchResult { Ok(()) }
}
}
@@ -15,19 +15,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {
fn on_runtime_upgrade() -> Weight {
if Self::in_code_storage_version() != Self::on_chain_storage_version() {
@@ -37,8 +37,8 @@ mod pallet {
}
}
#[pallet::call]
impl<T: Config> Pallet<T> {}
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {}
}
fn main() {}
@@ -15,15 +15,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pallet::config]
#[pezframe_support::pezpallet]
mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::composite_enum]
#[pezpallet::composite_enum]
pub enum HoldReasons {}
}
@@ -15,25 +15,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default, without_automatic_metadata, without_automatic_metadata)]
#[pezpallet::config(with_default, without_automatic_metadata, without_automatic_metadata)]
pub trait Config: pezframe_system::Config {
#[pallet::constant]
#[pezpallet::constant]
type MyGetParam2: Get<u32>;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {}
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {}
}
fn main() {}
@@ -15,28 +15,28 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[pezframe_support::pallet]
mod pallet {
#[pezframe_support::pezpallet]
mod pezpallet {
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config(with_default)]
#[pezpallet::config(with_default)]
pub trait Config: pezframe_system::Config {
#[pallet::constant]
#[pezpallet::constant]
type MyGetParam2: Get<u32>;
#[pallet::include_metadata]
#[pezpallet::include_metadata]
type MyNonScaleTypeInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {}
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {}
}
fn main() {}

Some files were not shown because too many files have changed in this diff Show More