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:
@@ -15,17 +15,17 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Benchmarks for remarks pallet
|
||||
//! Benchmarks for remarks pezpallet
|
||||
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
use super::*;
|
||||
use alloc::vec;
|
||||
use pezframe_benchmarking::v2::*;
|
||||
use pezframe_system::{EventRecord, Pallet as System, RawOrigin};
|
||||
use pezframe_system::{EventRecord, Pezpallet as System, RawOrigin};
|
||||
|
||||
#[cfg(test)]
|
||||
use crate::Pallet as Remark;
|
||||
use crate::Pezpallet as Remark;
|
||||
|
||||
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
|
||||
let events = System::<T>::events();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Remark storage pallet. Indexes remarks and stores them off chain.
|
||||
//! Remark storage pezpallet. Indexes remarks and stores them off chain.
|
||||
|
||||
// Ensure we're `no_std` when compiling for Wasm.
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
@@ -32,26 +32,26 @@ extern crate alloc;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
|
||||
// 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::*;
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
#[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::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// The overarching event type.
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
/// Weight information for extrinsics in this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// Attempting to store empty data.
|
||||
Empty,
|
||||
@@ -59,19 +59,19 @@ pub mod pallet {
|
||||
BadContext,
|
||||
}
|
||||
|
||||
#[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> {
|
||||
/// Index and store data off chain.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(T::WeightInfo::store(remark.len() as u32))]
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(T::WeightInfo::store(remark.len() as u32))]
|
||||
pub fn store(origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo {
|
||||
ensure!(!remark.is_empty(), Error::<T>::Empty);
|
||||
let sender = ensure_signed(origin)?;
|
||||
let content_hash = pezsp_io::hashing::blake2_256(&remark);
|
||||
let extrinsic_index = <pezframe_system::Pallet<T>>::extrinsic_index()
|
||||
let extrinsic_index = <pezframe_system::Pezpallet<T>>::extrinsic_index()
|
||||
.ok_or_else(|| Error::<T>::BadContext)?;
|
||||
pezsp_io::transaction_index::index(extrinsic_index, remark.len() as u32, content_hash);
|
||||
Self::deposit_event(Event::Stored { sender, content_hash: content_hash.into() });
|
||||
@@ -79,8 +79,8 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[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> {
|
||||
/// Stored data off chain.
|
||||
Stored { sender: T::AccountId, content_hash: pezsp_core::H256 },
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Test environment for remarks pallet.
|
||||
//! Test environment for remarks pezpallet.
|
||||
|
||||
use crate as pezpallet_remark;
|
||||
use pezframe_support::derive_impl;
|
||||
@@ -23,7 +23,7 @@ use pezsp_runtime::BuildStorage;
|
||||
|
||||
pub 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
|
||||
{
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Tests for remarks pallet.
|
||||
//! Tests for remarks pezpallet.
|
||||
|
||||
use super::{Error, Event, Pallet as Remark};
|
||||
use super::{Error, Event, Pezpallet as Remark};
|
||||
use crate::mock::*;
|
||||
use pezframe_support::{assert_noop, assert_ok};
|
||||
use pezframe_system::RawOrigin;
|
||||
@@ -36,7 +36,7 @@ fn generates_event() {
|
||||
sender: caller,
|
||||
}
|
||||
.into();
|
||||
// this one we actually go into the system pallet and get the last event
|
||||
// this one we actually go into the system pezpallet and get the last event
|
||||
// because we know its there from block +1
|
||||
let pezframe_system::EventRecord { event, .. } = &events[events.len() - 1];
|
||||
assert_eq!(event, &system_event);
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
// Executed Command:
|
||||
// ./target/production/bizinikiwi-node
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --chain=dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=pezpallet_remark
|
||||
// --pezpallet=pezpallet_remark
|
||||
// --no-storage-info
|
||||
// --no-median-slopes
|
||||
// --no-min-squares
|
||||
|
||||
Reference in New Issue
Block a user