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:
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "MIT-0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "FRAME example split pallet"
|
||||
description = "FRAME example split pezpallet"
|
||||
readme = "README.md"
|
||||
publish = false
|
||||
documentation = "https://docs.rs/pezpallet-example-split"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<!-- markdown-link-check-disable -->
|
||||
# Basic Example For Splitting A Pallet
|
||||
A simple example of a FRAME pallet demonstrating the ability to split sections across multiple
|
||||
# Basic Example For Splitting A Pezpallet
|
||||
A simple example of a FRAME pezpallet demonstrating the ability to split sections across multiple
|
||||
files.
|
||||
|
||||
Note that this is purely experimental at this point.
|
||||
|
||||
Run `cargo doc --package pezpallet-example-split --open` to view this pallet's documentation.
|
||||
Run `cargo doc --package pezpallet-example-split --open` to view this pezpallet's documentation.
|
||||
|
||||
License: MIT-0
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
use super::*;
|
||||
|
||||
#[allow(unused)]
|
||||
use crate::Pallet as Template;
|
||||
use crate::Pezpallet as Template;
|
||||
use pezframe_benchmarking::v2::*;
|
||||
use pezframe_system::RawOrigin;
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
use pezframe_support::pezpallet_macros::*;
|
||||
|
||||
/// A [`pezpallet_section`] that defines the events for a pallet.
|
||||
/// This can later be imported into the pallet using [`import_section`].
|
||||
/// A [`pezpallet_section`] that defines the events for a pezpallet.
|
||||
/// This can later be imported into the pezpallet using [`import_section`].
|
||||
#[pezpallet_section]
|
||||
mod events {
|
||||
#[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> {
|
||||
/// Event documentation should end with an array that provides descriptive names for event
|
||||
/// parameters. [something, who]
|
||||
|
||||
@@ -21,18 +21,18 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//! # Split Example Pallet
|
||||
//! # Split Example Pezpallet
|
||||
//!
|
||||
//! **This pallet serves as an example and is not meant to be used in production.**
|
||||
//! **This pezpallet serves as an example and is not meant to be used in production.**
|
||||
//!
|
||||
//! A FRAME pallet demonstrating the ability to split sections across multiple files.
|
||||
//! A FRAME pezpallet demonstrating the ability to split sections across multiple files.
|
||||
//!
|
||||
//! Note that this is purely experimental at this point.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
// Re-export pallet items so that they can be accessed from the crate namespace.
|
||||
pub use pallet::*;
|
||||
// Re-export pezpallet items so that they can be accessed from the crate namespace.
|
||||
pub use pezpallet::*;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
@@ -50,30 +50,30 @@ pub use weights::*;
|
||||
use pezframe_support::pezpallet_macros::*;
|
||||
|
||||
/// Imports a [`pezpallet_section`] defined at [`events::events`].
|
||||
/// This brings the events defined in that section into the pallet's namespace.
|
||||
/// This brings the events defined in that section into the pezpallet's namespace.
|
||||
#[import_section(events::events)]
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
/// Configure the pallet by specifying the parameters and types on which it depends.
|
||||
#[pallet::config]
|
||||
/// Configure the pezpallet by specifying the parameters and types on which it depends.
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// Type representing the weight of this pallet
|
||||
/// Type representing the weight of this pezpallet
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
// The pallet's runtime storage items.
|
||||
#[pallet::storage]
|
||||
// The pezpallet's runtime storage items.
|
||||
#[pezpallet::storage]
|
||||
pub type Something<T> = StorageValue<_, u32>;
|
||||
|
||||
// Errors inform users that something went wrong.
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// Error names should be descriptive.
|
||||
NoneValue,
|
||||
@@ -81,15 +81,15 @@ pub mod pallet {
|
||||
StorageOverflow,
|
||||
}
|
||||
|
||||
// Dispatchable functions allows users to interact with the pallet and invoke state changes.
|
||||
// Dispatchable functions allows users to interact with the pezpallet and invoke state changes.
|
||||
// These functions materialize as "extrinsics", which are often compared to transactions.
|
||||
// Dispatchable functions must be annotated with a weight and must return a DispatchResult.
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// An example dispatchable that takes a singles value as a parameter, writes the value to
|
||||
/// storage and emits an event. This function must be dispatched by a signed extrinsic.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(T::WeightInfo::do_something())]
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(T::WeightInfo::do_something())]
|
||||
pub fn do_something(origin: OriginFor<T>, something: u32) -> DispatchResult {
|
||||
// Check that the extrinsic was signed and get the signer.
|
||||
// This function will return an error if the extrinsic is not signed.
|
||||
@@ -105,8 +105,8 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// An example dispatchable that may throw a custom error.
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(T::WeightInfo::cause_error())]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight(T::WeightInfo::cause_error())]
|
||||
pub fn cause_error(origin: OriginFor<T>) -> DispatchResult {
|
||||
let _who = ensure_signed(origin)?;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ use pezframe_support::{derive_impl, pezsp_runtime::BuildStorage};
|
||||
|
||||
type Block = pezframe_system::mocking::MockBlock<Test>;
|
||||
|
||||
// Configure a mock runtime to test the pallet.
|
||||
// Configure a mock runtime to test the pezpallet.
|
||||
pezframe_support::construct_runtime!(
|
||||
pub enum Test
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ fn it_works_for_default_value() {
|
||||
System::set_block_number(1);
|
||||
// Dispatch a signed extrinsic.
|
||||
assert_ok!(TemplatePallet::do_something(RuntimeOrigin::signed(1), 42));
|
||||
// Read pallet storage and assert an expected result.
|
||||
// Read pezpallet storage and assert an expected result.
|
||||
assert_eq!(Something::<Test>::get(), Some(42));
|
||||
// Assert that the correct event was deposited
|
||||
System::assert_last_event(Event::SomethingStored { something: 42, who: 1 }.into());
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
// Executed Command:
|
||||
// ../../target/release/node-template
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --chain
|
||||
// dev
|
||||
// --pallet
|
||||
// --pezpallet
|
||||
// pezpallet_template
|
||||
// --extrinsic
|
||||
// *
|
||||
|
||||
Reference in New Issue
Block a user