mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
Benchmark Im Online Pallet (#5318)
* Initial benchmarking setup * Add keystore * validate unsigned * Update frame/im-online/src/benchmarking.rs Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com> * Fix verify_unsigned benchmark * add variable for teting the external addresss length * Update frame/im-online/src/benchmarking.rs Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update utils/frame/benchmarking-cli/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -16,6 +16,7 @@ sc-cli = { version = "0.8.0-alpha.4", path = "../../../client/cli" }
|
||||
sc-client = { version = "0.8.0-alpha.4", path = "../../../client" }
|
||||
sc-client-db = { version = "0.8.0-alpha.4", path = "../../../client/db" }
|
||||
sc-executor = { version = "0.8.0-alpha.4", path = "../../../client/executor" }
|
||||
sp-externalities = { version = "0.8.0-alpha.4", path = "../../../primitives/externalities" }
|
||||
sp-runtime = { version = "2.0.0-alpha.4", path = "../../../primitives/runtime" }
|
||||
sp-state-machine = { version = "0.8.0-alpha.4", path = "../../../primitives/state-machine" }
|
||||
structopt = "0.3.8"
|
||||
|
||||
@@ -23,7 +23,12 @@ use sc_service::{Configuration, ChainSpec};
|
||||
use sc_executor::{NativeExecutor, NativeExecutionDispatch};
|
||||
use codec::{Encode, Decode};
|
||||
use frame_benchmarking::BenchmarkResults;
|
||||
use sp_core::tasks;
|
||||
use sp_core::{
|
||||
tasks,
|
||||
traits::KeystoreExt,
|
||||
testing::KeyStore,
|
||||
};
|
||||
use sp_externalities::Extensions;
|
||||
|
||||
/// The `benchmark` command used to benchmark FRAME Pallets.
|
||||
#[derive(Debug, structopt::StructOpt, Clone)]
|
||||
@@ -106,6 +111,9 @@ impl BenchmarkCmd {
|
||||
2, // The runtime instances cache size.
|
||||
);
|
||||
|
||||
let mut extensions = Extensions::default();
|
||||
extensions.register(KeystoreExt(KeyStore::new()));
|
||||
|
||||
let result = StateMachine::<_, _, NumberFor<BB>, _>::new(
|
||||
&state,
|
||||
None,
|
||||
@@ -120,7 +128,7 @@ impl BenchmarkCmd {
|
||||
self.steps.clone(),
|
||||
self.repeat,
|
||||
).encode(),
|
||||
Default::default(),
|
||||
extensions,
|
||||
&sp_state_machine::backend::BackendRuntimeCode::new(&state).runtime_code()?,
|
||||
tasks::executor(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user