Skip to content

Commit 5ad5847

Browse files
committed
🔥 refactor(benchmarking.rs): Update benchmarking setup for pallet-template
🔥 refactor(lib.rs): Remove migrations module and v2 migration file The benchmarking setup for the pallet-template has been updated to use the `frame_benchmarking::v2` module instead of `frame_benchmarking::{benchmarks, whitelisted_caller}`. This change improves compatibility with the latest version of the frame_benchmarking crate. The migrations module and v2 migration file have been removed as they are no longer needed. The v2 migration logic has been integrated into the main pallet module, eliminating the need for a separate migrations module. This simplifies the codebase and improves maintainability.
1 parent f85407c commit 5ad5847

File tree

4 files changed

+3
-84
lines changed

4 files changed

+3
-84
lines changed

‎pallets/template/src/benchmarking.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//! Benchmarking setup for pallet-template
22
3+
#![cfg(feature = "runtime-benchmarks")]
34
use super::*;
45

56
#[allow(unused)]
67
use crate::Pallet as Template;
7-
use frame_benchmarking::{benchmarks, whitelisted_caller};
8+
use frame_benchmarking::v2::*;
89
use frame_system::RawOrigin;
910

1011
benchmarks! {

‎pallets/template/src/lib.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ mod tests;
1515
mod benchmarking;
1616

1717
/// All migrations.
18-
pub mod migrations;
19-
2018
#[frame_support::pallet]
2119
pub mod pallet {
2220

@@ -34,7 +32,7 @@ pub mod pallet {
3432

3533
#[pallet::pallet]
3634
#[pallet::storage_version(STORAGE_VERSION)]
37-
35+
3836
pub struct Pallet<T>(_);
3937

4038
// The pallet's runtime storage items.

‎pallets/template/src/migrations/mod.rs‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎pallets/template/src/migrations/v2.rs‎

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)