mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
benchmarks! macro: factorize instance usage. (#6750)
* factorize benchmark! * fix types * fix types
This commit is contained in:
committed by
GitHub
parent
6e6568167a
commit
1eeb4b0e3f
@@ -134,19 +134,10 @@ pub trait Benchmarking<T> {
|
||||
}
|
||||
|
||||
/// The required setup for creating a benchmark.
|
||||
pub trait BenchmarkingSetup<T> {
|
||||
/// Return the components and their ranges which should be tested in this benchmark.
|
||||
fn components(&self) -> Vec<(BenchmarkParameter, u32, u32)>;
|
||||
|
||||
/// Set up the storage, and prepare a closure to run the benchmark.
|
||||
fn instance(&self, components: &[(BenchmarkParameter, u32)]) -> Result<Box<dyn FnOnce() -> Result<(), &'static str>>, &'static str>;
|
||||
|
||||
/// Set up the storage, and prepare a closure to test and verify the benchmark
|
||||
fn verify(&self, components: &[(BenchmarkParameter, u32)]) -> Result<Box<dyn FnOnce() -> Result<(), &'static str>>, &'static str>;
|
||||
}
|
||||
|
||||
/// The required setup for creating a benchmark.
|
||||
pub trait BenchmarkingSetupInstance<T, I> {
|
||||
///
|
||||
/// Instance generic parameter is optional and can be used in order to capture unused generics for
|
||||
/// instantiable pallets.
|
||||
pub trait BenchmarkingSetup<T, I = ()> {
|
||||
/// Return the components and their ranges which should be tested in this benchmark.
|
||||
fn components(&self) -> Vec<(BenchmarkParameter, u32, u32)>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user