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,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! This pallet demonstrates the use of the `pallet::view_functions` api for service
|
||||
//! This pezpallet demonstrates the use of the `pezpallet::view_functions` api for service
|
||||
//! work.
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
@@ -38,28 +38,28 @@ 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::*;
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {}
|
||||
|
||||
#[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]
|
||||
pub type SomeValue<T: Config> = StorageValue<_, u32>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type SomeMap<T: Config> = StorageMap<_, Twox64Concat, u32, u32, OptionQuery>;
|
||||
|
||||
#[pallet::view_functions]
|
||||
impl<T: Config> Pallet<T>
|
||||
#[pezpallet::view_functions]
|
||||
impl<T: Config> Pezpallet<T>
|
||||
where
|
||||
T::AccountId: From<SomeType1> + SomeAssociation1,
|
||||
{
|
||||
@@ -75,29 +75,29 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pallet2 {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T, I = ()> {}
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config<I: 'static = ()>: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type SomeValue<T: Config<I>, I: 'static = ()> = StorageValue<_, u32>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type SomeMap<T: Config<I>, I: 'static = ()> =
|
||||
StorageMap<_, Twox64Concat, u32, u32, OptionQuery>;
|
||||
|
||||
#[pallet::view_functions]
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I>
|
||||
#[pezpallet::view_functions]
|
||||
impl<T: Config<I>, I: 'static> Pezpallet<T, I>
|
||||
where
|
||||
T::AccountId: From<SomeType1> + SomeAssociation1,
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#![cfg(test)]
|
||||
|
||||
use crate::{
|
||||
pallet::{self, Pallet},
|
||||
pezpallet::{self, Pezpallet},
|
||||
pallet2,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
@@ -39,7 +39,7 @@ type Block = pezframe_system::mocking::MockBlock<Runtime>;
|
||||
pezframe_support::construct_runtime!(
|
||||
pub enum Runtime {
|
||||
System: pezframe_system,
|
||||
ViewFunctionsExample: pallet,
|
||||
ViewFunctionsExample: pezpallet,
|
||||
ViewFunctionsInstance: pallet2,
|
||||
ViewFunctionsInstance1: pallet2::<Instance1>,
|
||||
}
|
||||
@@ -52,7 +52,7 @@ impl pezframe_system::Config for Runtime {
|
||||
type Block = Block;
|
||||
}
|
||||
|
||||
impl pallet::Config for Runtime {}
|
||||
impl pezpallet::Config for Runtime {}
|
||||
impl pallet2::Config<pallet2::Instance1> for Runtime {}
|
||||
|
||||
impl pallet2::Config for Runtime {}
|
||||
@@ -68,10 +68,10 @@ pub fn new_test_ext() -> pezsp_io::TestExternalities {
|
||||
fn pezpallet_get_value_query() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let some_value = Some(99);
|
||||
pallet::SomeValue::<Runtime>::set(some_value);
|
||||
assert_eq!(some_value, Pallet::<Runtime>::get_value());
|
||||
pezpallet::SomeValue::<Runtime>::set(some_value);
|
||||
assert_eq!(some_value, Pezpallet::<Runtime>::get_value());
|
||||
|
||||
let query = pallet::GetValueViewFunction::<Runtime>::new();
|
||||
let query = pezpallet::GetValueViewFunction::<Runtime>::new();
|
||||
test_dispatch_view_function(&query, some_value);
|
||||
});
|
||||
}
|
||||
@@ -81,10 +81,10 @@ fn pezpallet_get_value_with_arg_query() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let some_key = 1u32;
|
||||
let some_value = Some(123);
|
||||
pallet::SomeMap::<Runtime>::set(some_key, some_value);
|
||||
assert_eq!(some_value, Pallet::<Runtime>::get_value_with_arg(some_key));
|
||||
pezpallet::SomeMap::<Runtime>::set(some_key, some_value);
|
||||
assert_eq!(some_value, Pezpallet::<Runtime>::get_value_with_arg(some_key));
|
||||
|
||||
let query = pallet::GetValueWithArgViewFunction::<Runtime>::new(some_key);
|
||||
let query = pezpallet::GetValueWithArgViewFunction::<Runtime>::new(some_key);
|
||||
test_dispatch_view_function(&query, some_value);
|
||||
});
|
||||
}
|
||||
@@ -115,7 +115,7 @@ fn metadata_ir_definitions() {
|
||||
let pallet1 = metadata_ir
|
||||
.pallets
|
||||
.iter()
|
||||
.find(|pallet| pallet.name == "ViewFunctionsExample")
|
||||
.find(|pezpallet| pezpallet.name == "ViewFunctionsExample")
|
||||
.unwrap();
|
||||
|
||||
fn view_fn_id(preifx_hash: [u8; 16], view_fn_signature: &str) -> [u8; 32] {
|
||||
|
||||
Reference in New Issue
Block a user