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:
@@ -56,11 +56,11 @@ blockchain is the fixed block production time for the network.
|
||||
|
||||
Within FRAME, each dispatchable function must have a `#[weight]` annotation with a function that can return the expected
|
||||
weight for the worst case scenario execution of that function given its inputs. This benchmarking framework will result
|
||||
in a file that automatically generates those formulas for you, which you can then use in your pallet.
|
||||
in a file that automatically generates those formulas for you, which you can then use in your pezpallet.
|
||||
|
||||
## Writing Benchmarks
|
||||
|
||||
Writing a runtime benchmark is much like writing a unit test for your pallet. It needs to be carefully crafted to
|
||||
Writing a runtime benchmark is much like writing a unit test for your pezpallet. It needs to be carefully crafted to
|
||||
execute a certain logical path in your code. In tests you want to check for various success and failure conditions, but
|
||||
with benchmarks you specifically look for the **most computationally heavy** path, a.k.a the "worst case scenario".
|
||||
|
||||
@@ -71,7 +71,7 @@ this.
|
||||
It may be that there are multiple paths your function can go down, and it is not clear which one is the heaviest. In
|
||||
this case, you should just create a benchmark for each scenario! You may find that there are paths in your code where
|
||||
complexity may become unbounded depending on user input. This may be a hint that you should enforce sane boundaries for
|
||||
how a user can use your pallet. For example: limiting the number of elements in a vector, limiting the number of
|
||||
how a user can use your pezpallet. For example: limiting the number of elements in a vector, limiting the number of
|
||||
iterations in a `for` loop, etc...
|
||||
|
||||
Examples of end-to-end benchmarks can be found in the [pallets provided by Bizinikiwi](../), and the specific details on
|
||||
@@ -79,7 +79,7 @@ how to use the `benchmarks!` macro can be found in [its documentation](./src/lib
|
||||
|
||||
## Testing Benchmarks
|
||||
|
||||
You can test your benchmarks using the same test runtime that you created for your pallet's unit tests. By creating your
|
||||
You can test your benchmarks using the same test runtime that you created for your pezpallet's unit tests. By creating your
|
||||
benchmarks in the `benchmarks!` macro, it automatically generates test functions for you:
|
||||
|
||||
```rust
|
||||
@@ -98,7 +98,7 @@ verify any final conditions, such as the final state of your runtime.
|
||||
These additional `verify` blocks will not affect the results of your final benchmarking process.
|
||||
|
||||
To run the tests, you need to enable the `runtime-benchmarks` feature flag. This may also mean you need to move into
|
||||
your node's binary folder. For example, with the Bizinikiwi repository, this is how you would test the Balances pallet's
|
||||
your node's binary folder. For example, with the Bizinikiwi repository, this is how you would test the Balances pezpallet's
|
||||
benchmarks:
|
||||
|
||||
```bash
|
||||
@@ -109,7 +109,7 @@ cargo test -p pezpallet-balances --features runtime-benchmarks
|
||||
> ```
|
||||
> error: --features is not allowed in the root of a virtual workspace`
|
||||
> ```
|
||||
> To solve this, navigate to the folder of the node (`cd bin/node/cli`) or pallet (`cd frame/pallet`) and run the
|
||||
> To solve this, navigate to the folder of the node (`cd bin/node/cli`) or pezpallet (`cd frame/pezpallet`) and run the
|
||||
> command there.
|
||||
|
||||
This will instance each linear component with different values. The number of values per component is set to six and can
|
||||
@@ -117,7 +117,7 @@ be changed with the `VALUES_PER_COMPONENT` environment variable.
|
||||
|
||||
## Adding Benchmarks
|
||||
|
||||
The benchmarks included with each pallet are not automatically added to your node. To actually execute these benchmarks,
|
||||
The benchmarks included with each pezpallet are not automatically added to your node. To actually execute these benchmarks,
|
||||
you need to implement the `frame_benchmarking::Benchmark` trait. You can see an example of how to do this in the
|
||||
[included Bizinikiwi node](../../bin/node/runtime/src/lib.rs).
|
||||
|
||||
@@ -126,12 +126,12 @@ Assuming there are already some benchmarks set up on your node, you just need to
|
||||
|
||||
```rust
|
||||
/// configuration for running benchmarks
|
||||
/// | name of your pallet's crate (as imported)
|
||||
/// | name of your pezpallet's crate (as imported)
|
||||
/// v v
|
||||
add_benchmark!(params, batches, pallet_balances, Balances);
|
||||
/// ^ ^
|
||||
/// where all benchmark results are saved |
|
||||
/// the `struct` created for your pallet by `construct_runtime!`
|
||||
/// the `struct` created for your pezpallet by `construct_runtime!`
|
||||
```
|
||||
|
||||
Once you have done this, you will need to compile your node binary with the `runtime-benchmarks` feature flag:
|
||||
@@ -152,23 +152,23 @@ Finally, once you have a node binary with benchmarks enabled, you need to execut
|
||||
You can get a list of the available benchmarks by running:
|
||||
|
||||
```bash
|
||||
./target/production/bizinikiwi benchmark pallet --chain dev --pallet "*" --extrinsic "*" --repeat 0
|
||||
./target/production/bizinikiwi benchmark pezpallet --chain dev --pezpallet "*" --extrinsic "*" --repeat 0
|
||||
```
|
||||
|
||||
Then you can run a benchmark like so:
|
||||
|
||||
```bash
|
||||
./target/production/bizinikiwi benchmark pallet \
|
||||
./target/production/bizinikiwi benchmark pezpallet \
|
||||
--chain dev \ # Configurable Chain Spec
|
||||
--wasm-execution=compiled \ # Always used `wasm-time`
|
||||
--pallet pallet_balances \ # Select the pallet
|
||||
--pezpallet pallet_balances \ # Select the pezpallet
|
||||
--extrinsic transfer \ # Select the extrinsic
|
||||
--steps 50 \ # Number of samples across component ranges
|
||||
--repeat 20 \ # Number of times we repeat a benchmark
|
||||
--output <path> \ # Output benchmark results into a folder or file
|
||||
```
|
||||
|
||||
This will output a file `pallet_name.rs` which implements the `WeightInfo` trait you should include in your pallet.
|
||||
This will output a file `pallet_name.rs` which implements the `WeightInfo` trait you should include in your pezpallet.
|
||||
Double colons `::` will be replaced with a `_` in the output name if you specify a directory. Each blockchain should
|
||||
generate their own benchmark file with their custom implementation of the `WeightInfo` trait. This means that you will
|
||||
be able to use these modular Bizinikiwi pallets while still keeping your network safe for your specific configuration and
|
||||
@@ -177,8 +177,8 @@ requirements.
|
||||
The benchmarking CLI uses a Handlebars template to format the final output file. You can optionally pass the flag
|
||||
`--template` pointing to a custom template that can be used instead. Within the template, you have access to all the
|
||||
data provided by the `TemplateData` struct in the [benchmarking CLI
|
||||
writer](../../utils/pezframe/benchmarking-cli/src/pallet/writer.rs). You can find the default template used
|
||||
[here](../../utils/pezframe/benchmarking-cli/src/pallet/template.hbs).
|
||||
writer](../../utils/pezframe/benchmarking-cli/src/pezpallet/writer.rs). You can find the default template used
|
||||
[here](../../utils/pezframe/benchmarking-cli/src/pezpallet/template.hbs).
|
||||
|
||||
There are some custom Handlebars helpers included with our output generation:
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use super::*;
|
||||
|
||||
use pezframe_benchmarking::v2::*;
|
||||
use pezframe_support::traits::UnfilteredDispatchable;
|
||||
use pezframe_system::{Pallet as System, RawOrigin};
|
||||
use pezframe_system::{Pezpallet as System, RawOrigin};
|
||||
use pezsp_runtime::traits::Hash;
|
||||
|
||||
#[benchmarks]
|
||||
@@ -392,7 +392,7 @@ mod benchmarks {
|
||||
}
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(Pallet, super::mock::new_test_ext(), super::mock::Test,);
|
||||
impl_benchmark_test_suite!(Pezpallet, super::mock::new_test_ext(), super::mock::Test,);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! End-to-end testing pallet for PoV benchmarking. Should only be deployed in a testing runtime.
|
||||
//! End-to-end testing pezpallet for PoV benchmarking. Should only be deployed in a testing runtime.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
@@ -25,51 +25,51 @@ mod weights;
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use alloc::vec::Vec;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
}
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type Value<T: Config> = StorageValue<Value = u32, QueryKind = OptionQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type Value2<T: Config> = StorageValue<Value = u32, QueryKind = OptionQuery>;
|
||||
|
||||
/// A value without a MEL bound.
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub(crate) type UnboundedValue<T: Config> =
|
||||
StorageValue<Value = Vec<u8>, QueryKind = OptionQuery>;
|
||||
|
||||
/// A value with a MEL bound of 32 byte.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type BoundedValue<T: Config> =
|
||||
StorageValue<Value = BoundedVec<u8, ConstU32<32>>, QueryKind = OptionQuery>;
|
||||
|
||||
/// 4MiB value.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type LargeValue<T: Config> =
|
||||
StorageValue<Value = BoundedVec<u8, ConstU32<{ 1 << 22 }>>, QueryKind = OptionQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type LargeValue2<T: Config> =
|
||||
StorageValue<Value = BoundedVec<u8, ConstU32<{ 1 << 22 }>>, QueryKind = OptionQuery>;
|
||||
|
||||
/// A map with a maximum of 1M entries.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type Map1M<T: Config> = StorageMap<
|
||||
Hasher = Blake2_256,
|
||||
Key = u32,
|
||||
@@ -79,7 +79,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// A map with a maximum of 16M entries.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type Map16M<T: Config> = StorageMap<
|
||||
Hasher = Blake2_256,
|
||||
Key = u32,
|
||||
@@ -88,7 +88,7 @@ pub mod pallet {
|
||||
MaxValues = ConstU32<16_000_000>,
|
||||
>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type DoubleMap1M<T: Config> = StorageDoubleMap<
|
||||
Hasher1 = Blake2_256,
|
||||
Hasher2 = Blake2_256,
|
||||
@@ -99,38 +99,38 @@ pub mod pallet {
|
||||
MaxValues = ConstU32<1_000_000>,
|
||||
>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub(crate) type UnboundedMap<T: Config> =
|
||||
StorageMap<Hasher = Blake2_256, Key = u32, Value = Vec<u32>, QueryKind = OptionQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub(crate) type UnboundedMap2<T: Config> =
|
||||
StorageMap<Hasher = Blake2_256, Key = u32, Value = Vec<u32>, QueryKind = OptionQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::unbounded]
|
||||
pub(crate) type UnboundedMapTwox<T: Config> =
|
||||
StorageMap<Hasher = Twox64Concat, Key = u32, Value = Vec<u32>, QueryKind = OptionQuery>;
|
||||
|
||||
#[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> {
|
||||
TestEvent,
|
||||
}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight({0})]
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight({0})]
|
||||
pub fn emit_event(_origin: OriginFor<T>) -> DispatchResult {
|
||||
Self::deposit_event(Event::TestEvent);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight({0})]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight({0})]
|
||||
pub fn noop(_origin: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
|
||||
// --pallet=pezframe_benchmarking_pallet_pov
|
||||
// --pezpallet=pezframe_benchmarking_pallet_pov
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/benchmarking/pov/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
// limitations under the License.
|
||||
|
||||
//! A set of benchmarks which can establish a global baseline for all other
|
||||
//! benchmarking. These benchmarks do not require a pallet to be deployed.
|
||||
//! benchmarking. These benchmarks do not require a pezpallet to be deployed.
|
||||
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
use crate::benchmarks;
|
||||
use alloc::{vec, vec::Vec};
|
||||
use pezframe_system::Pallet as System;
|
||||
use pezframe_system::Pezpallet as System;
|
||||
use pezsp_runtime::{
|
||||
traits::{AppVerify, Hash},
|
||||
RuntimeAppPublic,
|
||||
@@ -36,7 +36,7 @@ mod crypto {
|
||||
}
|
||||
pub type SignerId = crypto::Public;
|
||||
|
||||
pub struct Pallet<T: Config>(System<T>);
|
||||
pub struct Pezpallet<T: Config>(System<T>);
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
benchmarks! {
|
||||
@@ -102,7 +102,7 @@ benchmarks! {
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(
|
||||
Pallet,
|
||||
Pezpallet,
|
||||
mock::new_test_ext(),
|
||||
mock::Test,
|
||||
);
|
||||
|
||||
@@ -53,7 +53,7 @@ pub use analysis::{Analysis, AnalysisChoice, BenchmarkSelector};
|
||||
pub use utils::*;
|
||||
pub use v1::*;
|
||||
|
||||
/// Contains macros, structs, and traits associated with v2 of the pallet benchmarking syntax.
|
||||
/// Contains macros, structs, and traits associated with v2 of the pezpallet benchmarking syntax.
|
||||
///
|
||||
/// The [`v2::benchmarks`] and [`v2::instance_benchmarks`] macros can be used to designate a
|
||||
/// module as a benchmarking module that can contain benchmarks and benchmark tests. The
|
||||
@@ -71,7 +71,7 @@ pub use v1::*;
|
||||
/// ```ignore
|
||||
/// #![cfg(feature = "runtime-benchmarks")]
|
||||
///
|
||||
/// use super::{mock_helpers::*, Pallet as MyPallet};
|
||||
/// use super::{mock_helpers::*, Pezpallet as MyPallet};
|
||||
/// use pezframe_benchmarking::v2::*;
|
||||
///
|
||||
/// #[benchmarks]
|
||||
@@ -207,7 +207,7 @@ pub use v1::*;
|
||||
/// Some pallets require a where clause specifying constraints on their generics to make
|
||||
/// writing benchmarks feasible. To accommodate this situation, you can provide such a where
|
||||
/// clause as the (only) argument to the `#[benchmarks]` or `#[instance_benchmarks]` attribute
|
||||
/// macros. Below is an example of this taken from the `message-queue` pallet.
|
||||
/// macros. Below is an example of this taken from the `message-queue` pezpallet.
|
||||
///
|
||||
/// ```ignore
|
||||
/// #[benchmarks(
|
||||
@@ -226,7 +226,7 @@ pub use v1::*;
|
||||
/// Benchmark tests can be generated using the old syntax in `pezframe_benchmarking`,
|
||||
/// including the `pezframe_benchmarking::impl_benchmark_test_suite` macro.
|
||||
///
|
||||
/// An example is shown below (taken from the `message-queue` pallet's `benchmarking` module):
|
||||
/// An example is shown below (taken from the `message-queue` pezpallet's `benchmarking` module):
|
||||
/// ```ignore
|
||||
/// #[benchmarks]
|
||||
/// mod benchmarks {
|
||||
@@ -282,7 +282,7 @@ pub use v1::*;
|
||||
/// ```ignore
|
||||
/// #![cfg(feature = "runtime-benchmarks")]
|
||||
///
|
||||
/// use super::{mock_helpers::*, Pallet as MyPallet};
|
||||
/// use super::{mock_helpers::*, Pezpallet as MyPallet};
|
||||
/// use pezframe_benchmarking::v2::*;
|
||||
///
|
||||
/// #[benchmarks]
|
||||
@@ -331,7 +331,7 @@ pub use v1::*;
|
||||
/// function in v2, while `setup(y)?;` will be moved to the body of the function;
|
||||
/// 2. Move all the v1 setup code to the body of the v2 function;
|
||||
/// 3. Move the benchmarked code to the body of the v2 function under the appropriate macro
|
||||
/// attribute: `#[extrinsic_call]` for extrinsic pallet calls and `#[block]` for blocks of
|
||||
/// attribute: `#[extrinsic_call]` for extrinsic pezpallet calls and `#[block]` for blocks of
|
||||
/// code;
|
||||
/// 4. Move the v1 verify code block to the body of the v2 function, after the
|
||||
/// `#[extrinsic_call]` or `#[block]` attribute.
|
||||
|
||||
@@ -27,26 +27,26 @@ use pezsp_runtime::{
|
||||
};
|
||||
use std::cell::RefCell;
|
||||
|
||||
#[pezframe_support::pallet(dev_mode)]
|
||||
#[pezframe_support::pezpallet(dev_mode)]
|
||||
mod pezpallet_test {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type LowerBound: Get<u32>;
|
||||
type UpperBound: Get<u32>;
|
||||
type MaybeItem: Get<Option<u32>>;
|
||||
}
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type Value<T: Config> = StorageValue<_, u32, OptionQuery>;
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
pub fn set_value(origin: OriginFor<T>, n: u32) -> DispatchResult {
|
||||
let _sender = ensure_signed(origin)?;
|
||||
Value::<T>::put(n);
|
||||
@@ -131,7 +131,7 @@ mod benchmarks {
|
||||
use rusty_fork::rusty_fork_test;
|
||||
|
||||
// Additional used internally by the benchmark macro.
|
||||
use super::pezpallet_test::{Call, Config, Pallet};
|
||||
use super::pezpallet_test::{Call, Config, Pezpallet};
|
||||
|
||||
crate::benchmarks! {
|
||||
where_clause {
|
||||
@@ -340,18 +340,18 @@ mod benchmarks {
|
||||
#[test]
|
||||
fn benchmarks_generate_unit_tests() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_ok!(Pallet::<Test>::test_benchmark_set_value());
|
||||
assert_ok!(Pallet::<Test>::test_benchmark_other_name());
|
||||
assert_ok!(Pallet::<Test>::test_benchmark_sort_vector());
|
||||
assert_err!(Pallet::<Test>::test_benchmark_bad_origin(), "Bad origin");
|
||||
assert_err!(Pallet::<Test>::test_benchmark_bad_verify(), "You forgot to sort!");
|
||||
assert_ok!(Pallet::<Test>::test_benchmark_no_components());
|
||||
assert_ok!(Pallet::<Test>::test_benchmark_variable_components());
|
||||
assert_ok!(Pezpallet::<Test>::test_benchmark_set_value());
|
||||
assert_ok!(Pezpallet::<Test>::test_benchmark_other_name());
|
||||
assert_ok!(Pezpallet::<Test>::test_benchmark_sort_vector());
|
||||
assert_err!(Pezpallet::<Test>::test_benchmark_bad_origin(), "Bad origin");
|
||||
assert_err!(Pezpallet::<Test>::test_benchmark_bad_verify(), "You forgot to sort!");
|
||||
assert_ok!(Pezpallet::<Test>::test_benchmark_no_components());
|
||||
assert_ok!(Pezpallet::<Test>::test_benchmark_variable_components());
|
||||
assert!(matches!(
|
||||
Pallet::<Test>::test_benchmark_override_benchmark(),
|
||||
Pezpallet::<Test>::test_benchmark_override_benchmark(),
|
||||
Err(BenchmarkError::Override(_)),
|
||||
));
|
||||
assert_eq!(Pallet::<Test>::test_benchmark_skip_benchmark(), Err(BenchmarkError::Skip),);
|
||||
assert_eq!(Pezpallet::<Test>::test_benchmark_skip_benchmark(), Err(BenchmarkError::Skip),);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -361,18 +361,18 @@ mod benchmarks {
|
||||
new_test_ext().execute_with(|| {
|
||||
// It resets when the error happens in the setup:
|
||||
assert_err!(
|
||||
Pallet::<Test>::test_benchmark_modify_in_setup_then_error(),
|
||||
Pezpallet::<Test>::test_benchmark_modify_in_setup_then_error(),
|
||||
"Should error"
|
||||
);
|
||||
assert_eq!(Value::<Test>::get(), None);
|
||||
|
||||
// It resets when the error happens in the call:
|
||||
assert_err!(Pallet::<Test>::test_benchmark_modify_in_call_then_error(), "Should error");
|
||||
assert_err!(Pezpallet::<Test>::test_benchmark_modify_in_call_then_error(), "Should error");
|
||||
assert_eq!(Value::<Test>::get(), None);
|
||||
|
||||
// It resets when the error happens in the verify:
|
||||
assert_err!(
|
||||
Pallet::<Test>::test_benchmark_modify_in_verify_then_error(),
|
||||
Pezpallet::<Test>::test_benchmark_modify_in_verify_then_error(),
|
||||
"Should error"
|
||||
);
|
||||
assert_eq!(Value::<Test>::get(), None);
|
||||
@@ -414,7 +414,7 @@ mod benchmarks {
|
||||
}
|
||||
|
||||
new_test_ext().execute_with(|| {
|
||||
let got = Pallet::<Test>::test_benchmark_values_per_component()
|
||||
let got = Pezpallet::<Test>::test_benchmark_values_per_component()
|
||||
.map(|_| VALUES_PER_COMPONENT.with(|v| v.borrow().clone()));
|
||||
|
||||
assert_eq!(got, output);
|
||||
|
||||
@@ -26,19 +26,19 @@ use pezsp_runtime::{
|
||||
BuildStorage,
|
||||
};
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
#[pezframe_support::pezpallet]
|
||||
mod pezpallet_test {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
|
||||
|
||||
pub trait OtherConfig {
|
||||
type OtherEvent;
|
||||
}
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config<I: 'static = ()>: pezframe_system::Config + OtherConfig {
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self, I>>
|
||||
@@ -47,19 +47,19 @@ mod pezpallet_test {
|
||||
type UpperBound: Get<u32>;
|
||||
}
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type Value<T: Config<I>, I: 'static = ()> = StorageValue<_, u32, OptionQuery>;
|
||||
|
||||
#[pallet::event]
|
||||
#[pezpallet::event]
|
||||
pub enum Event<T: Config<I>, I: 'static = ()> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I>
|
||||
#[pezpallet::call]
|
||||
impl<T: Config<I>, I: 'static> Pezpallet<T, I>
|
||||
where
|
||||
<T as OtherConfig>::OtherEvent: Into<<T as Config<I>>::RuntimeEvent>,
|
||||
{
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight({0})]
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight({0})]
|
||||
pub fn set_value(origin: OriginFor<T>, n: u32) -> DispatchResult {
|
||||
let _sender = ensure_signed(origin)?;
|
||||
assert!(n >= T::LowerBound::get());
|
||||
@@ -67,8 +67,8 @@ mod pezpallet_test {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight({0})]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight({0})]
|
||||
pub fn dummy(origin: OriginFor<T>, _n: u32) -> DispatchResult {
|
||||
let _sender = ensure_none(origin)?;
|
||||
Ok(())
|
||||
@@ -147,7 +147,7 @@ mod benchmarks {
|
||||
use pezsp_core::Get;
|
||||
|
||||
// Additional used internally by the benchmark macro.
|
||||
use super::pezpallet_test::{Call, Config, Pallet};
|
||||
use super::pezpallet_test::{Call, Config, Pezpallet};
|
||||
|
||||
crate::benchmarks_instance_pallet! {
|
||||
where_clause {
|
||||
@@ -182,7 +182,7 @@ mod benchmarks {
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(
|
||||
Pallet,
|
||||
Pezpallet,
|
||||
crate::tests_instance::new_test_ext(),
|
||||
crate::tests_instance::Test
|
||||
)
|
||||
@@ -197,7 +197,7 @@ fn ensure_correct_instance_is_selected() {
|
||||
|
||||
let mut batches = Vec::<crate::BenchmarkBatch>::new();
|
||||
let config = crate::BenchmarkConfig {
|
||||
pallet: "pezpallet_test".bytes().collect::<Vec<_>>(),
|
||||
pezpallet: "pezpallet_test".bytes().collect::<Vec<_>>(),
|
||||
// We only want that this `instance` is used.
|
||||
// Otherwise the wrong components are used.
|
||||
instance: "TestPallet".bytes().collect::<Vec<_>>(),
|
||||
|
||||
@@ -77,10 +77,10 @@ impl std::fmt::Display for BenchmarkParameter {
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
#[derive(Encode, Decode, Clone, PartialEq, Debug, TypeInfo)]
|
||||
pub struct BenchmarkBatch {
|
||||
/// The pallet containing this benchmark.
|
||||
/// The pezpallet containing this benchmark.
|
||||
#[cfg_attr(feature = "std", serde(with = "serde_as_str"))]
|
||||
pub pallet: Vec<u8>,
|
||||
/// The instance of this pallet being benchmarked.
|
||||
pub pezpallet: Vec<u8>,
|
||||
/// The instance of this pezpallet being benchmarked.
|
||||
#[cfg_attr(feature = "std", serde(with = "serde_as_str"))]
|
||||
pub instance: Vec<u8>,
|
||||
/// The extrinsic (or benchmark name) of this benchmark.
|
||||
@@ -95,10 +95,10 @@ pub struct BenchmarkBatch {
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
#[derive(Encode, Decode, Clone, PartialEq, Debug)]
|
||||
pub struct BenchmarkBatchSplitResults {
|
||||
/// The pallet containing this benchmark.
|
||||
/// The pezpallet containing this benchmark.
|
||||
#[cfg_attr(feature = "std", serde(with = "serde_as_str"))]
|
||||
pub pallet: Vec<u8>,
|
||||
/// The instance of this pallet being benchmarked.
|
||||
pub pezpallet: Vec<u8>,
|
||||
/// The instance of this pezpallet being benchmarked.
|
||||
#[cfg_attr(feature = "std", serde(with = "serde_as_str"))]
|
||||
pub instance: Vec<u8>,
|
||||
/// The extrinsic (or benchmark name) of this benchmark.
|
||||
@@ -110,7 +110,7 @@ pub struct BenchmarkBatchSplitResults {
|
||||
pub db_results: Vec<BenchmarkResult>,
|
||||
}
|
||||
|
||||
/// Result from running benchmarks on a FRAME pallet.
|
||||
/// Result from running benchmarks on a FRAME pezpallet.
|
||||
/// Contains duration of the function call in nanoseconds along with the benchmark parameters
|
||||
/// used for that benchmark result.
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
@@ -210,9 +210,9 @@ impl From<TransactionValidityError> for BenchmarkError {
|
||||
/// Configuration used to setup and run runtime benchmarks.
|
||||
#[derive(Encode, Decode, Default, Clone, PartialEq, Debug, TypeInfo)]
|
||||
pub struct BenchmarkConfig {
|
||||
/// The encoded name of the pallet to benchmark.
|
||||
pub pallet: Vec<u8>,
|
||||
/// The encoded name of the pallet instance to benchmark.
|
||||
/// The encoded name of the pezpallet to benchmark.
|
||||
pub pezpallet: Vec<u8>,
|
||||
/// The encoded name of the pezpallet instance to benchmark.
|
||||
pub instance: Vec<u8>,
|
||||
/// The encoded name of the benchmark/extrinsic to run.
|
||||
pub benchmark: Vec<u8>,
|
||||
@@ -224,12 +224,12 @@ pub struct BenchmarkConfig {
|
||||
pub internal_repeats: u32,
|
||||
}
|
||||
|
||||
/// A list of benchmarks available for a particular pallet and instance.
|
||||
/// A list of benchmarks available for a particular pezpallet and instance.
|
||||
///
|
||||
/// All `Vec<u8>` must be valid utf8 strings.
|
||||
#[derive(Encode, Decode, Default, Clone, PartialEq, Debug, TypeInfo)]
|
||||
pub struct BenchmarkList {
|
||||
pub pallet: Vec<u8>,
|
||||
pub pezpallet: Vec<u8>,
|
||||
pub instance: Vec<u8>,
|
||||
pub benchmarks: Vec<BenchmarkMetadata>,
|
||||
}
|
||||
@@ -350,9 +350,9 @@ pub trait Benchmarking {
|
||||
}
|
||||
}
|
||||
|
||||
/// The pallet benchmarking trait.
|
||||
/// The pezpallet benchmarking trait.
|
||||
pub trait Benchmarking {
|
||||
/// Get the benchmarks available for this pallet. Generally there is one benchmark per
|
||||
/// Get the benchmarks available for this pezpallet. Generally there is one benchmark per
|
||||
/// extrinsic, so these are sometimes just called "extrinsics".
|
||||
///
|
||||
/// Parameters
|
||||
@@ -360,7 +360,7 @@ pub trait Benchmarking {
|
||||
/// weight calculation.
|
||||
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>;
|
||||
|
||||
/// Run the benchmarks for this pallet.
|
||||
/// Run the benchmarks for this pezpallet.
|
||||
fn run_benchmark(
|
||||
name: &[u8],
|
||||
selected_components: &[(BenchmarkParameter, u32)],
|
||||
|
||||
@@ -29,7 +29,7 @@ macro_rules! whitelist {
|
||||
};
|
||||
}
|
||||
|
||||
/// Construct pallet benchmarks for weighing dispatchables.
|
||||
/// Construct pezpallet benchmarks for weighing dispatchables.
|
||||
///
|
||||
/// Works around the idea of complexity parameters, named by a single letter (which is usually
|
||||
/// upper cased in complexity notation but is lower-cased for use in this macro).
|
||||
@@ -125,7 +125,7 @@ macro_rules! whitelist {
|
||||
///
|
||||
/// Test functions are automatically generated for each benchmark and are accessible to you when you
|
||||
/// run `cargo test`. All tests are named `test_benchmark_<benchmark_name>`, implemented on the
|
||||
/// Pallet struct, and run them in a test externalities environment. The test function runs your
|
||||
/// Pezpallet struct, and run them in a test externalities environment. The test function runs your
|
||||
/// benchmark just like a regular benchmark, but only testing at the lowest and highest values for
|
||||
/// each component. The function will return `Ok(())` if the benchmarks return no errors.
|
||||
///
|
||||
@@ -161,10 +161,10 @@ macro_rules! whitelist {
|
||||
/// #[test]
|
||||
/// fn test_benchmarks() {
|
||||
/// new_test_ext().execute_with(|| {
|
||||
/// assert_ok!(Pallet::<Test>::test_benchmark_dummy());
|
||||
/// assert_err!(Pallet::<Test>::test_benchmark_other_name(), "Bad origin");
|
||||
/// assert_ok!(Pallet::<Test>::test_benchmark_sort_vector());
|
||||
/// assert_err!(Pallet::<Test>::test_benchmark_broken_benchmark(), "You forgot to sort!");
|
||||
/// assert_ok!(Pezpallet::<Test>::test_benchmark_dummy());
|
||||
/// assert_err!(Pezpallet::<Test>::test_benchmark_other_name(), "Bad origin");
|
||||
/// assert_ok!(Pezpallet::<Test>::test_benchmark_sort_vector());
|
||||
/// assert_err!(Pezpallet::<Test>::test_benchmark_broken_benchmark(), "You forgot to sort!");
|
||||
/// });
|
||||
/// }
|
||||
/// ```
|
||||
@@ -188,7 +188,7 @@ macro_rules! benchmarks {
|
||||
|
||||
/// Same as [`benchmarks`] but for instantiable module.
|
||||
///
|
||||
/// NOTE: For pallet declared with [`pezframe_support::pallet`], use [`benchmarks_instance_pallet`].
|
||||
/// NOTE: For pezpallet declared with [`pezframe_support::pezpallet`], use [`benchmarks_instance_pallet`].
|
||||
#[macro_export]
|
||||
macro_rules! benchmarks_instance {
|
||||
(
|
||||
@@ -207,9 +207,9 @@ macro_rules! benchmarks_instance {
|
||||
}
|
||||
}
|
||||
|
||||
/// Same as [`benchmarks`] but for instantiable pallet declared [`pezframe_support::pallet`].
|
||||
/// Same as [`benchmarks`] but for instantiable pezpallet declared [`pezframe_support::pezpallet`].
|
||||
///
|
||||
/// NOTE: For pallet declared with `decl_module!`, use [`benchmarks_instance`].
|
||||
/// NOTE: For pezpallet declared with `decl_module!`, use [`benchmarks_instance`].
|
||||
#[macro_export]
|
||||
macro_rules! benchmarks_instance_pallet {
|
||||
(
|
||||
@@ -363,7 +363,7 @@ macro_rules! benchmarks_iter {
|
||||
$( $rest )*
|
||||
}
|
||||
};
|
||||
// detect and extract `#[pov_mode = Mode { Pallet::Storage: Mode ... }]` tag:
|
||||
// detect and extract `#[pov_mode = Mode { Pezpallet::Storage: Mode ... }]` tag:
|
||||
(
|
||||
{ $($bench_module:ident, $new_test_ext:expr, $test:path $(, $( $args:tt )* )?)? }
|
||||
{ $( $instance:ident: $instance_bound:tt )? }
|
||||
@@ -939,7 +939,7 @@ macro_rules! selected_benchmark {
|
||||
{ $( $instance:ident: $instance_bound:tt )? }
|
||||
$( { $( $bench_inst:ident )? } $bench:ident )*
|
||||
) => {
|
||||
// The list of available benchmarks for this pallet.
|
||||
// The list of available benchmarks for this pezpallet.
|
||||
#[allow(non_camel_case_types)]
|
||||
enum SelectedBenchmark {
|
||||
$( $bench, )*
|
||||
@@ -992,7 +992,7 @@ macro_rules! impl_benchmark {
|
||||
// We only need to implement benchmarks for the runtime-benchmarks feature or testing.
|
||||
#[cfg(any(feature = "runtime-benchmarks", test))]
|
||||
impl<T: Config $(<$instance>, $instance: $instance_bound )? >
|
||||
$crate::Benchmarking for Pallet<T $(, $instance)? >
|
||||
$crate::Benchmarking for Pezpallet<T $(, $instance)? >
|
||||
where T: pezframe_system::Config, $( $where_clause )*
|
||||
{
|
||||
fn benchmarks(extra: bool) -> $crate::__private::Vec<$crate::BenchmarkMetadata> {
|
||||
@@ -1076,8 +1076,8 @@ macro_rules! impl_benchmark {
|
||||
let mut results: $crate::__private::Vec<$crate::BenchmarkResult> = $crate::__private::Vec::new();
|
||||
let on_before_start = || {
|
||||
// Set the block number to at least 1 so events are deposited.
|
||||
if $crate::__private::Zero::is_zero(&pezframe_system::Pallet::<T>::block_number()) {
|
||||
pezframe_system::Pallet::<T>::set_block_number(1u32.into());
|
||||
if $crate::__private::Zero::is_zero(&pezframe_system::Pezpallet::<T>::block_number()) {
|
||||
pezframe_system::Pezpallet::<T>::set_block_number(1u32.into());
|
||||
}
|
||||
|
||||
// Commit the externalities to the database, flushing the DB cache.
|
||||
@@ -1165,7 +1165,7 @@ macro_rules! impl_benchmark {
|
||||
|
||||
#[cfg(test)]
|
||||
impl<T: Config $(<$instance>, $instance: $instance_bound )? >
|
||||
Pallet<T $(, $instance)? >
|
||||
Pezpallet<T $(, $instance)? >
|
||||
where T: pezframe_system::Config, $( $where_clause )*
|
||||
{
|
||||
/// Test a particular benchmark by name.
|
||||
@@ -1175,7 +1175,7 @@ macro_rules! impl_benchmark {
|
||||
/// that case.
|
||||
///
|
||||
/// This is generally intended to be used by child test modules such as those created
|
||||
/// by the `impl_benchmark_test_suite` macro. However, it is not an error if a pallet
|
||||
/// by the `impl_benchmark_test_suite` macro. However, it is not an error if a pezpallet
|
||||
/// author chooses not to implement benchmarks.
|
||||
#[allow(unused)]
|
||||
fn test_bench_by_name(name: &[u8]) -> Result<(), $crate::BenchmarkError> {
|
||||
@@ -1208,7 +1208,7 @@ macro_rules! impl_benchmark_test {
|
||||
$crate::__private::paste::item! {
|
||||
#[cfg(test)]
|
||||
impl<T: Config $(<$instance>, $instance: $instance_bound )? >
|
||||
Pallet<T $(, $instance)? >
|
||||
Pezpallet<T $(, $instance)? >
|
||||
where T: pezframe_system::Config, $( $where_clause )*
|
||||
{
|
||||
#[allow(unused)]
|
||||
@@ -1226,8 +1226,8 @@ macro_rules! impl_benchmark_test {
|
||||
|
||||
let on_before_start = || {
|
||||
// Set the block number to at least 1 so events are deposited.
|
||||
if $crate::__private::Zero::is_zero(&pezframe_system::Pallet::<T>::block_number()) {
|
||||
pezframe_system::Pallet::<T>::set_block_number(1u32.into());
|
||||
if $crate::__private::Zero::is_zero(&pezframe_system::Pezpallet::<T>::block_number()) {
|
||||
pezframe_system::Pezpallet::<T>::set_block_number(1u32.into());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1296,7 +1296,7 @@ macro_rules! impl_benchmark_test {
|
||||
/// When called in `pezpallet_example_basic` as
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// impl_benchmark_test_suite!(Pallet, crate::tests::new_test_ext(), crate::tests::Test);
|
||||
/// impl_benchmark_test_suite!(Pezpallet, crate::tests::new_test_ext(), crate::tests::Test);
|
||||
/// ```
|
||||
///
|
||||
/// It expands to the equivalent of:
|
||||
@@ -1325,7 +1325,7 @@ macro_rules! impl_benchmark_test {
|
||||
/// benchmarks! {
|
||||
/// // Benchmarks omitted for brevity
|
||||
///
|
||||
/// impl_benchmark_test_suite!(Pallet, crate::tests::new_test_ext(), crate::tests::Test);
|
||||
/// impl_benchmark_test_suite!(Pezpallet, crate::tests::new_test_ext(), crate::tests::Test);
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
@@ -1396,11 +1396,11 @@ macro_rules! impl_benchmark_test {
|
||||
/// }
|
||||
///
|
||||
/// mod tests {
|
||||
/// // because of macro syntax limitations, neither Pallet nor benches can be paths, but both have
|
||||
/// // because of macro syntax limitations, neither Pezpallet nor benches can be paths, but both have
|
||||
/// // to be idents in the scope of `impl_benchmark_test_suite`.
|
||||
/// use crate::{benches, Pallet};
|
||||
/// use crate::{benches, Pezpallet};
|
||||
///
|
||||
/// impl_benchmark_test_suite!(Pallet, new_test_ext(), Test, benchmarks_path = benches);
|
||||
/// impl_benchmark_test_suite!(Pezpallet, new_test_ext(), Test, benchmarks_path = benches);
|
||||
///
|
||||
/// // new_test_ext and the Test item are defined later in this module
|
||||
/// }
|
||||
@@ -1738,7 +1738,7 @@ pub fn show_benchmark_debug_info(
|
||||
error_message: &str,
|
||||
) -> alloc::string::String {
|
||||
alloc::format!(
|
||||
"\n* Pallet: {}\n\
|
||||
"\n* Pezpallet: {}\n\
|
||||
* Benchmark: {}\n\
|
||||
* Components: {:?}\n\
|
||||
* Verify: {:?}\n\
|
||||
@@ -1753,7 +1753,7 @@ pub fn show_benchmark_debug_info(
|
||||
)
|
||||
}
|
||||
|
||||
/// This macro adds pallet benchmarks to a `Vec<BenchmarkBatch>` object.
|
||||
/// This macro adds pezpallet benchmarks to a `Vec<BenchmarkBatch>` object.
|
||||
///
|
||||
/// First create an object that holds in the input parameters for the benchmark:
|
||||
///
|
||||
@@ -1799,7 +1799,7 @@ pub fn show_benchmark_debug_info(
|
||||
///
|
||||
/// At the end of `dispatch_benchmark`, you should return this batches object.
|
||||
///
|
||||
/// In the case where you have multiple instances of a pallet that you need to separately benchmark,
|
||||
/// In the case where you have multiple instances of a pezpallet that you need to separately benchmark,
|
||||
/// the name of your module struct will be used as a suffix to your outputted weight file. For
|
||||
/// example:
|
||||
///
|
||||
@@ -1822,14 +1822,14 @@ macro_rules! add_benchmark {
|
||||
let instance_string = stringify!($location).replace(" ", "").into_bytes();
|
||||
let (config, whitelist) = $params;
|
||||
let $crate::BenchmarkConfig {
|
||||
pallet,
|
||||
pezpallet,
|
||||
instance,
|
||||
benchmark,
|
||||
selected_components,
|
||||
verify,
|
||||
internal_repeats,
|
||||
} = config;
|
||||
if &pallet[..] == &pezpallet_string[..] && &instance[..] == &instance_string[..] {
|
||||
if &pezpallet[..] == &pezpallet_string[..] && &instance[..] == &instance_string[..] {
|
||||
let benchmark_result = <$location as $crate::Benchmarking>::run_benchmark(
|
||||
&benchmark[..],
|
||||
&selected_components[..],
|
||||
@@ -1883,7 +1883,7 @@ macro_rules! add_benchmark {
|
||||
|
||||
if let Some(final_results) = final_results {
|
||||
$batches.push($crate::BenchmarkBatch {
|
||||
pallet: pezpallet_string,
|
||||
pezpallet: pezpallet_string,
|
||||
instance: instance_string,
|
||||
benchmark: benchmark.clone(),
|
||||
results: final_results,
|
||||
@@ -1902,8 +1902,8 @@ macro_rules! add_benchmark {
|
||||
/// let mut list = Vec::<BenchmarkList>::new();
|
||||
/// ```
|
||||
///
|
||||
/// Then pass this `list` to the macro, along with the `extra` boolean, the pallet crate, and
|
||||
/// pallet struct:
|
||||
/// Then pass this `list` to the macro, along with the `extra` boolean, the pezpallet crate, and
|
||||
/// pezpallet struct:
|
||||
///
|
||||
/// ```ignore
|
||||
/// list_benchmark!(list, extra, pezpallet_balances, Balances);
|
||||
@@ -1919,7 +1919,7 @@ macro_rules! list_benchmark {
|
||||
let instance_string = stringify!($location).replace(" ", "").into_bytes();
|
||||
let benchmarks = <$location as $crate::Benchmarking>::benchmarks($extra);
|
||||
let pezpallet_benchmarks = $crate::BenchmarkList {
|
||||
pallet: pezpallet_string,
|
||||
pezpallet: pezpallet_string,
|
||||
instance: instance_string,
|
||||
benchmarks: benchmarks.to_vec(),
|
||||
};
|
||||
@@ -1927,7 +1927,7 @@ macro_rules! list_benchmark {
|
||||
};
|
||||
}
|
||||
|
||||
/// Defines pallet configs that `add_benchmarks` and `list_benchmarks` use.
|
||||
/// Defines pezpallet configs that `add_benchmarks` and `list_benchmarks` use.
|
||||
/// Should be preferred instead of having a repetitive list of configs
|
||||
/// in `add_benchmark` and `list_benchmark`.
|
||||
#[macro_export]
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
|
||||
// --pallet=pezframe_benchmarking
|
||||
// --pezpallet=pezframe_benchmarking
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/benchmarking/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
|
||||
Reference in New Issue
Block a user