I am trying to migrate my pallet over to the parachain template, and while adding it to the runtime I noticed a slight difference between how benchmarks are defined.
On the old runtime, all (or most) pallets had their benchmarks included as follows:
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn dispatch_benchmark(
// <snip>
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
add_benchmark!(params, batches, pallet_balances, Balances);
add_benchmark!(params, batches, pallet_timestamp, Timestamp);
// Custom benchmark I want to migrate
add_benchmark!(params, batches, pallet_chocolate, ChocolateModule);
// <snip>
While the new one only has one call to a add_benchmarks
macro.
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn dispatch_benchmark(
// <snip>
add_benchmarks!(params, batches);
// <snip>
I checked the docs and it suggests using the add_benchmark!
but that was in the context of the node template. What's the difference between these two forms? Does add_benchmarks!
have the same effect as the individual add_benchmark!
calls combined??
Do note that I'm migrating from the node template runtime to the parachain template.
Many thanks!