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:
@@ -20,7 +20,7 @@ use alloc::boxed::Box;
|
||||
use codec::Encode;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use pezkuwi_runtime_teyrchains::{
|
||||
configuration, dmp, hrmp,
|
||||
@@ -28,18 +28,18 @@ use pezkuwi_runtime_teyrchains::{
|
||||
ParaLifecycle,
|
||||
};
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pallet::disable_pezframe_system_supertrait_check]
|
||||
#[pezpallet::config]
|
||||
#[pezpallet::disable_pezframe_system_supertrait_check]
|
||||
pub trait Config: configuration::Config + paras::Config + dmp::Config + hrmp::Config {}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// The specified teyrchain is not registered.
|
||||
ParaDoesntExist,
|
||||
@@ -64,18 +64,18 @@ pub mod pallet {
|
||||
TooManyCores,
|
||||
}
|
||||
|
||||
#[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> {
|
||||
/// Schedule a para to be initialized at the start of the next session.
|
||||
///
|
||||
/// This should only be used for TESTING and not on PRODUCTION chains. It automatically
|
||||
/// assigns Coretime to the chain and increases the number of cores. Thus, there is no
|
||||
/// running coretime chain required.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight((1_000, DispatchClass::Operational))]
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight((1_000, DispatchClass::Operational))]
|
||||
pub fn sudo_schedule_para_initialize(
|
||||
origin: OriginFor<T>,
|
||||
id: ParaId,
|
||||
@@ -96,8 +96,8 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Schedule a para to be cleaned up at the start of the next session.
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight((1_000, DispatchClass::Operational))]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight((1_000, DispatchClass::Operational))]
|
||||
pub fn sudo_schedule_para_cleanup(origin: OriginFor<T>, id: ParaId) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
pezkuwi_runtime_teyrchains::schedule_para_cleanup::<T>(id)
|
||||
@@ -106,8 +106,8 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Upgrade a parathread (on-demand teyrchain) to a lease holding teyrchain
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight((1_000, DispatchClass::Operational))]
|
||||
#[pezpallet::call_index(2)]
|
||||
#[pezpallet::weight((1_000, DispatchClass::Operational))]
|
||||
pub fn sudo_schedule_parathread_upgrade(
|
||||
origin: OriginFor<T>,
|
||||
id: ParaId,
|
||||
@@ -115,7 +115,7 @@ pub mod pallet {
|
||||
ensure_root(origin)?;
|
||||
// Para backend should think this is a parathread (on-demand teyrchain)...
|
||||
ensure!(
|
||||
paras::Pallet::<T>::lifecycle(id) == Some(ParaLifecycle::Parathread),
|
||||
paras::Pezpallet::<T>::lifecycle(id) == Some(ParaLifecycle::Parathread),
|
||||
Error::<T>::NotParathread,
|
||||
);
|
||||
pezkuwi_runtime_teyrchains::schedule_parathread_upgrade::<T>(id)
|
||||
@@ -124,8 +124,8 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Downgrade a lease holding teyrchain to an on-demand teyrchain
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight((1_000, DispatchClass::Operational))]
|
||||
#[pezpallet::call_index(3)]
|
||||
#[pezpallet::weight((1_000, DispatchClass::Operational))]
|
||||
pub fn sudo_schedule_teyrchain_downgrade(
|
||||
origin: OriginFor<T>,
|
||||
id: ParaId,
|
||||
@@ -133,7 +133,7 @@ pub mod pallet {
|
||||
ensure_root(origin)?;
|
||||
// Para backend should think this is a teyrchain...
|
||||
ensure!(
|
||||
paras::Pallet::<T>::lifecycle(id) == Some(ParaLifecycle::Teyrchain),
|
||||
paras::Pezpallet::<T>::lifecycle(id) == Some(ParaLifecycle::Teyrchain),
|
||||
Error::<T>::NotTeyrchain,
|
||||
);
|
||||
pezkuwi_runtime_teyrchains::schedule_teyrchain_downgrade::<T>(id)
|
||||
@@ -145,17 +145,17 @@ pub mod pallet {
|
||||
///
|
||||
/// The given teyrchain should exist and the payload should not exceed the preconfigured
|
||||
/// size `config.max_downward_message_size`.
|
||||
#[pallet::call_index(4)]
|
||||
#[pallet::weight((1_000, DispatchClass::Operational))]
|
||||
#[pezpallet::call_index(4)]
|
||||
#[pezpallet::weight((1_000, DispatchClass::Operational))]
|
||||
pub fn sudo_queue_downward_xcm(
|
||||
origin: OriginFor<T>,
|
||||
id: ParaId,
|
||||
xcm: Box<xcm::opaque::VersionedXcm>,
|
||||
) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
ensure!(paras::Pallet::<T>::is_valid_para(id), Error::<T>::ParaDoesntExist);
|
||||
ensure!(paras::Pezpallet::<T>::is_valid_para(id), Error::<T>::ParaDoesntExist);
|
||||
let config = configuration::ActiveConfig::<T>::get();
|
||||
dmp::Pallet::<T>::queue_downward_message(&config, id, xcm.encode()).map_err(|e| match e
|
||||
dmp::Pezpallet::<T>::queue_downward_message(&config, id, xcm.encode()).map_err(|e| match e
|
||||
{
|
||||
dmp::QueueDownwardMessageError::ExceedsMaxMessageSize =>
|
||||
Error::<T>::ExceedsMaxMessageSize.into(),
|
||||
@@ -167,8 +167,8 @@ pub mod pallet {
|
||||
///
|
||||
/// This is equivalent to sending an `Hrmp::hrmp_init_open_channel` extrinsic followed by
|
||||
/// `Hrmp::hrmp_accept_open_channel`.
|
||||
#[pallet::call_index(5)]
|
||||
#[pallet::weight((1_000, DispatchClass::Operational))]
|
||||
#[pezpallet::call_index(5)]
|
||||
#[pezpallet::weight((1_000, DispatchClass::Operational))]
|
||||
pub fn sudo_establish_hrmp_channel(
|
||||
origin: OriginFor<T>,
|
||||
sender: ParaId,
|
||||
@@ -178,13 +178,13 @@ pub mod pallet {
|
||||
) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
|
||||
hrmp::Pallet::<T>::init_open_channel(
|
||||
hrmp::Pezpallet::<T>::init_open_channel(
|
||||
sender,
|
||||
recipient,
|
||||
max_capacity,
|
||||
max_message_size,
|
||||
)?;
|
||||
hrmp::Pallet::<T>::accept_open_channel(recipient, sender)?;
|
||||
hrmp::Pezpallet::<T>::accept_open_channel(recipient, sender)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user