Update to `monthly-2021-11` (#259)

* file changes from upstream

* fix cargo for monthly-2021-11
main
Dan Shields 2021-11-07 21:41:04 +01:00 committed by GitHub
parent 1ea08839ae
commit d8063c4171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 452 additions and 690 deletions

814
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,8 @@
[profile.release]
panic = 'unwind'
[workspace]
members = [
'node',
'pallets/template',
'runtime',
]
[profile.release]
panic = 'unwind'

View File

@ -1,6 +1,6 @@
[package]
name = 'node-template'
version = '3.0.0-monthly-2021-10'
version = '4.0.0-dev'
description = 'A fresh FRAME-based Substrate node, ready for hacking.'
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
homepage = 'https://substrate.io/'
@ -18,12 +18,12 @@ targets = ['x86_64-unknown-linux-gnu']
[build-dependencies.substrate-build-script-utils]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '3.0.0'
[dependencies.node-template-runtime]
path = '../runtime'
version = '3.0.0-monthly-2021-10'
version = '4.0.0-dev'
[dependencies]
jsonrpc-core = '18.0.0'
@ -31,140 +31,140 @@ structopt = '0.3.8'
[dependencies.frame-benchmarking]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.frame-benchmarking-cli]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.pallet-transaction-payment-rpc]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sc-basic-authorship]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sc-cli]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sc-client-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sc-consensus]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sc-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sc-executor]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sc-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sc-keystore]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sc-rpc]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sc-rpc-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sc-service]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sc-telemetry]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sc-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sc-transaction-pool-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-block-builder]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-blockchain]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-consensus]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sp-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sp-core]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-runtime]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-timestamp]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.substrate-frame-rpc-system]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[features]

View File

@ -150,5 +150,6 @@ fn testnet_genesis(
// Assign network admin rights.
key: root_key,
},
transaction_payment: Default::default(),
}
}

View File

@ -4,7 +4,7 @@ use crate::{
service,
};
use node_template_runtime::Block;
use sc_cli::{ChainSpec, Role, RuntimeVersion, SubstrateCli};
use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
use sc_service::PartialComponents;
impl SubstrateCli for Cli {
@ -111,11 +111,7 @@ pub fn run() -> sc_cli::Result<()> {
None => {
let runner = cli.create_runner(&cli.run)?;
runner.run_node_until_exit(|config| async move {
match config.role {
Role::Light => service::new_light(config),
_ => service::new_full(config),
}
.map_err(sc_cli::Error::Service)
service::new_full(config).map_err(sc_cli::Error::Service)
})
},
}

View File

@ -1,7 +1,7 @@
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
use node_template_runtime::{self, opaque::Block, RuntimeApi};
use sc_client_api::{ExecutorProvider, RemoteBackend};
use sc_client_api::ExecutorProvider;
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
pub use sc_executor::NativeElseWasmExecutor;
use sc_finality_grandpa::SharedVoterState;
@ -184,6 +184,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
Vec::default(),
));
let (network, system_rpc_tx, network_starter) =
@ -335,143 +336,3 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
network_starter.start_network();
Ok(task_manager)
}
/// Builds a new service for a light client.
pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError> {
let telemetry = config
.telemetry_endpoints
.clone()
.filter(|x| !x.is_empty())
.map(|endpoints| -> Result<_, sc_telemetry::Error> {
let worker = TelemetryWorker::new(16)?;
let telemetry = worker.handle().new_telemetry(endpoints);
Ok((worker, telemetry))
})
.transpose()?;
let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new(
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
);
let (client, backend, keystore_container, mut task_manager, on_demand) =
sc_service::new_light_parts::<Block, RuntimeApi, _>(
&config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
)?;
let mut telemetry = telemetry.map(|(worker, telemetry)| {
task_manager.spawn_handle().spawn("telemetry", worker.run());
telemetry
});
config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config());
let select_chain = sc_consensus::LongestChain::new(backend.clone());
let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light(
config.transaction_pool.clone(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
on_demand.clone(),
));
let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
client.clone(),
&(client.clone() as Arc<_>),
select_chain.clone(),
telemetry.as_ref().map(|x| x.handle()),
)?;
let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration();
let import_queue =
sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
block_import: grandpa_block_import.clone(),
justification_import: Some(Box::new(grandpa_block_import.clone())),
client: client.clone(),
create_inherent_data_providers: move |_, ()| async move {
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let slot =
sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration(
*timestamp,
slot_duration,
);
Ok((timestamp, slot))
},
spawner: &task_manager.spawn_essential_handle(),
can_author_with: sp_consensus::NeverCanAuthor,
registry: config.prometheus_registry(),
check_for_equivocation: Default::default(),
telemetry: telemetry.as_ref().map(|x| x.handle()),
})?;
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
));
let (network, system_rpc_tx, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
client: client.clone(),
transaction_pool: transaction_pool.clone(),
spawn_handle: task_manager.spawn_handle(),
import_queue,
on_demand: Some(on_demand.clone()),
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
})?;
if config.offchain_worker.enabled {
sc_service::build_offchain_workers(
&config,
task_manager.spawn_handle(),
client.clone(),
network.clone(),
);
}
let enable_grandpa = !config.disable_grandpa;
if enable_grandpa {
let name = config.network.node_name.clone();
let config = sc_finality_grandpa::Config {
gossip_duration: std::time::Duration::from_millis(333),
justification_period: 512,
name: Some(name),
observer_enabled: false,
keystore: None,
local_role: config.role.clone(),
telemetry: telemetry.as_ref().map(|x| x.handle()),
};
task_manager.spawn_handle().spawn_blocking(
"grandpa-observer",
sc_finality_grandpa::run_grandpa_observer(config, grandpa_link, network.clone())?,
);
}
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
remote_blockchain: Some(backend.remote_blockchain()),
transaction_pool,
task_manager: &mut task_manager,
on_demand: Some(on_demand),
rpc_extensions_builder: Box::new(|_, _| Ok(())),
config,
client,
keystore: keystore_container.sync_keystore(),
backend,
network,
system_rpc_tx,
telemetry: telemetry.as_mut(),
})?;
network_starter.start_network();
Ok(task_manager)
}

View File

@ -1,6 +1,6 @@
[package]
name = 'pallet-template'
version = '3.0.0-monthly-2021-10'
version = '4.0.0-dev'
description = 'FRAME pallet template for defining custom runtime logic.'
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
homepage = 'https://substrate.io/'
@ -22,19 +22,19 @@ version = '2.0.0'
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.scale-info]
@ -45,19 +45,19 @@ version = '1.0'
[dev-dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dev-dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dev-dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[features]

View File

@ -4,7 +4,7 @@ use super::*;
#[allow(unused)]
use crate::Pallet as Template;
use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller};
use frame_benchmarking::{benchmarks, whitelisted_caller};
use frame_system::RawOrigin;
benchmarks! {
@ -15,6 +15,6 @@ benchmarks! {
verify {
assert_eq!(Something::<T>::get(), Some(s));
}
}
impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test);
impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test);
}

View File

@ -39,7 +39,7 @@ pub mod pallet {
pub type Something<T> = StorageValue<_, u32>;
// Pallets use events to inform users when important changes are made.
// https://docs.substrate.io/v3/runtime/events
// https://docs.substrate.io/v3/runtime/events-and-errors
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {

View File

@ -1,6 +1,6 @@
[package]
name = 'node-template-runtime'
version = '3.0.0-monthly-2021-10'
version = '4.0.0-dev'
description = 'A fresh FRAME-based Substrate runtime, ready for hacking.'
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
homepage = 'https://substrate.io/'
@ -15,11 +15,11 @@ targets = ['x86_64-unknown-linux-gnu']
[dependencies.pallet-template]
default-features = false
path = '../pallets/template'
version = '3.0.0-monthly-2021-10'
version = '4.0.0-dev'
[build-dependencies.substrate-wasm-builder]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '5.0.0-dev'
[dependencies.codec]
@ -32,38 +32,38 @@ version = '2.0.0'
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.frame-executive]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.frame-system-benchmarking]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.frame-system-rpc-runtime-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.hex-literal]
@ -73,49 +73,49 @@ version = '0.3.1'
[dependencies.pallet-aura]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.pallet-balances]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.pallet-grandpa]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.pallet-randomness-collective-flip]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.pallet-sudo]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.pallet-timestamp]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.pallet-transaction-payment]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.pallet-transaction-payment-rpc-runtime-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.scale-info]
@ -126,67 +126,67 @@ version = '1.0'
[dependencies.sp-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-block-builder]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-consensus-aura]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '0.10.0-dev'
[dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-inherents]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-offchain]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-session]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-transaction-pool]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[dependencies.sp-version]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10'
tag = 'monthly-2021-11'
version = '4.0.0-dev'
[features]

View File

@ -87,7 +87,7 @@ pub mod opaque {
}
// To learn more about runtime versioning and what each of the following value means:
// https://docs.substrate.io/v3/runtime/origins#runtime-versioning
// https://docs.substrate.io/v3/runtime/upgrades#runtime-versioning
#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("node-template"),
@ -258,11 +258,13 @@ impl pallet_balances::Config for Runtime {
parameter_types! {
pub const TransactionByteFee: Balance = 1;
pub OperationalFeeMultiplier: u8 = 5;
}
impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, ()>;
type TransactionByteFee = TransactionByteFee;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = IdentityFee<Balance>;
type FeeMultiplierUpdate = ();
}
@ -284,16 +286,16 @@ construct_runtime!(
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
Aura: pallet_aura::{Pallet, Config<T>},
Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>},
System: frame_system,
RandomnessCollectiveFlip: pallet_randomness_collective_flip,
Timestamp: pallet_timestamp,
Aura: pallet_aura,
Grandpa: pallet_grandpa,
Balances: pallet_balances,
TransactionPayment: pallet_transaction_payment,
Sudo: pallet_sudo,
// Include the custom logic from the pallet-template in the runtime.
TemplateModule: pallet_template::{Pallet, Call, Storage, Event<T>},
TemplateModule: pallet_template,
}
);
@ -461,12 +463,14 @@ impl_runtime_apis! {
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};
use frame_benchmarking::{list_benchmark, baseline, Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use baseline::Pallet as BaselineBench;
let mut list = Vec::<BenchmarkList>::new();
list_benchmark!(list, extra, frame_benchmarking, BaselineBench::<Runtime>);
list_benchmark!(list, extra, frame_system, SystemBench::<Runtime>);
list_benchmark!(list, extra, pallet_balances, Balances);
list_benchmark!(list, extra, pallet_timestamp, Timestamp);
@ -480,10 +484,13 @@ impl_runtime_apis! {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
use frame_system_benchmarking::Pallet as SystemBench;
use baseline::Pallet as BaselineBench;
impl frame_system_benchmarking::Config for Runtime {}
impl baseline::Config for Runtime {}
let whitelist: Vec<TrackedStorageKey> = vec![
// Block Number
@ -501,12 +508,12 @@ impl_runtime_apis! {
let mut batches = Vec::<BenchmarkBatch>::new();
let params = (&config, &whitelist);
add_benchmark!(params, batches, frame_benchmarking, BaselineBench::<Runtime>);
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
add_benchmark!(params, batches, pallet_balances, Balances);
add_benchmark!(params, batches, pallet_timestamp, Timestamp);
add_benchmark!(params, batches, pallet_template, TemplateModule);
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
Ok(batches)
}
}