Skip to content

Commit

Permalink
pallets: reorganize benchmark compilation flags (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Young authored Dec 16, 2021
1 parent 522a04f commit 38f24cf
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 13 deletions.
11 changes: 6 additions & 5 deletions pallets/allocations/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

//! Amendments pallet benchmarks
#![cfg(feature = "runtime-benchmarks")]
#![allow(unused)]

//! Amendments pallet benchmarks
use super::*;

use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite};
use crate::Pallet as Allocations;
use frame_benchmarking::impl_benchmark_test_suite;
use frame_benchmarking::{account, benchmarks};
use frame_system::RawOrigin;
use sp_std::prelude::*;

use crate::Pallet as Allocations;

const MAX_BYTES: u32 = 1_024;
const SEED: u32 = 0;

Expand Down
4 changes: 1 addition & 3 deletions pallets/allocations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;

#[cfg(test)]
mod tests;

Expand Down
1 change: 1 addition & 0 deletions pallets/amendments/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
//! Amendments pallet benchmarks
#![cfg(feature = "runtime-benchmarks")]
#![allow(unused)]

use super::*;

Expand Down
1 change: 1 addition & 0 deletions pallets/emergency-shutdown/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
//! Reserve pallet benchmarks
#![cfg(feature = "runtime-benchmarks")]
#![allow(unused)]

use super::*;

Expand Down
4 changes: 2 additions & 2 deletions pallets/grants/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
*/

#![cfg(feature = "runtime-benchmarks")]
#![allow(unused)]

use super::*;

use crate::Pallet as Grants;
use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite};
use frame_support::traits::{EnsureOrigin, UnfilteredDispatchable};
use frame_system::RawOrigin;
use sp_runtime::traits::Bounded;
use sp_std::prelude::*;

use crate::Pallet as Grants;

const MAX_SCHEDULES: u32 = 100;
const SEED: u32 = 0;

Expand Down
2 changes: 2 additions & 0 deletions pallets/reserve/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
//! Reserve pallet benchmarks
#![cfg(feature = "runtime-benchmarks")]
#![allow(unused)]

use super::*;

Expand All @@ -28,6 +29,7 @@ use frame_system::RawOrigin;
use sp_runtime::traits::Saturating;
use sp_std::prelude::*;

#[cfg(test)]
use crate::Pallet as Reserve;

const SEED: u32 = 0;
Expand Down
4 changes: 3 additions & 1 deletion pallets/root-of-trust/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
//! Root Of Trust pallet benchmarks
#![cfg(feature = "runtime-benchmarks")]
#![allow(unused)]

use super::*;

use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite};
use frame_benchmarking::impl_benchmark_test_suite;
use frame_benchmarking::{account, benchmarks};
use frame_system::RawOrigin;
use sp_runtime::traits::Bounded;
use sp_std::prelude::*;
Expand Down
1 change: 1 addition & 0 deletions pallets/staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#![cfg(feature = "runtime-benchmarks")]
#![allow(unused)]

use super::*;

Expand Down
5 changes: 3 additions & 2 deletions pallets/tcr/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
//! Tcr pallet benchmarks
#![cfg(feature = "runtime-benchmarks")]
#![allow(unused)]

use super::*;

use frame_benchmarking::{account, benchmarks_instance_pallet, impl_benchmark_test_suite};
use frame_benchmarking::impl_benchmark_test_suite;
use frame_benchmarking::{account, benchmarks_instance_pallet};
use frame_support::pallet_prelude::DispatchResultWithPostInfo;
use frame_system::RawOrigin;
use sp_std::prelude::*;
Expand Down

0 comments on commit 38f24cf

Please sign in to comment.