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:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "pezpallet-meta-tx"
|
||||
description = "FRAME pallet enabling meta transactions."
|
||||
description = "FRAME pezpallet enabling meta transactions."
|
||||
license = "Apache-2.0"
|
||||
version = "0.1.0"
|
||||
edition.workspace = true
|
||||
|
||||
@@ -73,7 +73,7 @@ pub mod types {
|
||||
}
|
||||
|
||||
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
|
||||
pezframe_system::Pallet::<T>::assert_last_event(generic_event.into());
|
||||
pezframe_system::Pezpallet::<T>::assert_last_event(generic_event.into());
|
||||
}
|
||||
|
||||
#[benchmarks(
|
||||
@@ -123,7 +123,7 @@ mod benchmarks {
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite! {
|
||||
Pallet,
|
||||
Pezpallet,
|
||||
crate::mock::new_test_ext(),
|
||||
crate::mock::Runtime,
|
||||
}
|
||||
|
||||
@@ -15,23 +15,23 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! # Meta Tx (Meta Transaction) Pallet
|
||||
//! # Meta Tx (Meta Transaction) Pezpallet
|
||||
//!
|
||||
//! This pallet enables the dispatch of transactions that are authorized by one party (the signer)
|
||||
//! This pezpallet enables the dispatch of transactions that are authorized by one party (the signer)
|
||||
//! and executed by an untrusted third party (the relayer), who covers the transaction fees.
|
||||
//!
|
||||
//! ## Pallet API
|
||||
//! ## Pezpallet API
|
||||
//!
|
||||
//! See the [`pallet`] module for more information about the interfaces this pallet exposes,
|
||||
//! See the [`pezpallet`] module for more information about the interfaces this pezpallet exposes,
|
||||
//! including its configuration trait, dispatchables, storage items, events and errors.
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
//! The pallet provides a client-level API, typically not meant for direct use by end users.
|
||||
//! The pezpallet provides a client-level API, typically not meant for direct use by end users.
|
||||
//! A meta transaction, constructed with the help of a wallet, contains a target call, necessary
|
||||
//! extensions, and the signer's signature. This transaction is then broadcast, and any interested
|
||||
//! relayer can pick it up and execute it. The relayer submits a regular transaction via the
|
||||
//! [`dispatch`](`Pallet::dispatch`) function, passing the meta transaction as an argument to
|
||||
//! [`dispatch`](`Pezpallet::dispatch`) function, passing the meta transaction as an argument to
|
||||
//! execute the target call on behalf of the signer while covering the fees.
|
||||
//!
|
||||
//! ### Example
|
||||
@@ -60,7 +60,7 @@ mod tests;
|
||||
pub mod weights;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
pub use benchmarking::types::WeightlessExtension;
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
pub use weights::WeightInfo;
|
||||
mod extension;
|
||||
pub use extension::MetaTxMarker;
|
||||
@@ -102,11 +102,11 @@ impl<Call, Extension> MetaTx<Call, Extension> {
|
||||
/// The [`MetaTx`] for the given config.
|
||||
pub type MetaTxFor<T> = MetaTx<<T as pezframe_system::Config>::RuntimeCall, <T as Config>::Extension>;
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config:
|
||||
pezframe_system::Config<
|
||||
RuntimeCall: Dispatchable<
|
||||
@@ -117,7 +117,7 @@ pub mod pallet {
|
||||
RuntimeOrigin: AsTransactionAuthorizedOrigin + From<SystemOrigin<Self::AccountId>>,
|
||||
>
|
||||
{
|
||||
/// Weight information for calls in this pallet.
|
||||
/// Weight information for calls in this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
/// The overarching event type.
|
||||
#[allow(deprecated)]
|
||||
@@ -140,7 +140,7 @@ pub mod pallet {
|
||||
type Extension: TransactionExtension<<Self as pezframe_system::Config>::RuntimeCall>;
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// Invalid proof (e.g. signature).
|
||||
BadProof,
|
||||
@@ -156,8 +156,8 @@ pub mod pallet {
|
||||
Invalid,
|
||||
}
|
||||
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(crate) fn deposit_event)]
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(crate) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// A meta transaction has been dispatched.
|
||||
///
|
||||
@@ -166,17 +166,17 @@ pub mod pallet {
|
||||
Dispatched { result: DispatchResultWithPostInfo },
|
||||
}
|
||||
|
||||
#[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> {
|
||||
/// Dispatch a given meta transaction.
|
||||
///
|
||||
/// - `_origin`: Can be any kind of origin.
|
||||
/// - `meta_tx`: Meta Transaction with a target call to be dispatched.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight({
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight({
|
||||
let dispatch_info = meta_tx.call.get_dispatch_info();
|
||||
let extension_weight = meta_tx.extension.weight(&meta_tx.call);
|
||||
let bare_call_weight = T::WeightInfo::bare_dispatch();
|
||||
|
||||
@@ -36,7 +36,7 @@ fn create_tx_bare_ext(account: AccountId) -> TxBareExtension {
|
||||
pezframe_system::CheckGenesis::<Runtime>::new(),
|
||||
pezframe_system::CheckMortality::<Runtime>::from(Era::immortal()),
|
||||
pezframe_system::CheckNonce::<Runtime>::from(
|
||||
pezframe_system::Pallet::<Runtime>::account(&account).nonce,
|
||||
pezframe_system::Pezpallet::<Runtime>::account(&account).nonce,
|
||||
),
|
||||
pezframe_system::CheckWeight::<Runtime>::new(),
|
||||
pezpallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(0),
|
||||
@@ -52,7 +52,7 @@ pub fn create_meta_tx_bare_ext(account: AccountId) -> MetaTxBareExtension {
|
||||
pezframe_system::CheckGenesis::<Runtime>::new(),
|
||||
pezframe_system::CheckMortality::<Runtime>::from(Era::immortal()),
|
||||
pezframe_system::CheckNonce::<Runtime>::from(
|
||||
pezframe_system::Pallet::<Runtime>::account(&account).nonce,
|
||||
pezframe_system::Pezpallet::<Runtime>::account(&account).nonce,
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -293,7 +293,7 @@ fn meta_tx_extension_work() {
|
||||
|
||||
// increment alice's nonce to invalidate the meta tx and verify that the
|
||||
// meta tx extension works.
|
||||
pezframe_system::Pallet::<Runtime>::inc_account_nonce(alice_account.clone());
|
||||
pezframe_system::Pezpallet::<Runtime>::inc_account_nonce(alice_account.clone());
|
||||
|
||||
// Check Extrinsic validity and apply it.
|
||||
let result = apply_extrinsic(uxt);
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
// Executed Command:
|
||||
// target/production/bizinikiwi-node
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --extrinsic=*
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --json-file=/builds/parity/mirrors/pezkuwi-sdk/.git/.artifacts/bench.json
|
||||
// --pallet=pezpallet_meta_tx
|
||||
// --pezpallet=pezpallet_meta_tx
|
||||
// --chain=dev
|
||||
// --header=./bizinikiwi/HEADER-APACHE2
|
||||
// --output=./bizinikiwi/pezframe/meta-tx/src/weights.rs
|
||||
|
||||
Reference in New Issue
Block a user