mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 01:11:08 +00:00
Custom Benchmark Errors and Override (#9517)
* initial idea * update benchmark test to frame v2 * fix some errors * fixes for elec phrag * fix tests * update extrinsic time and docs * fix import * undo extra changes * helper function * wrong way * Update frame/benchmarking/src/utils.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * doesnt need encode/decode * fix benchmark return Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -21,7 +21,9 @@
|
||||
|
||||
use super::*;
|
||||
|
||||
use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite, whitelist};
|
||||
use frame_benchmarking::{
|
||||
account, benchmarks, impl_benchmark_test_suite, whitelist, BenchmarkError, BenchmarkResult,
|
||||
};
|
||||
use frame_support::{dispatch::DispatchResultWithPostInfo, traits::OnInitialize};
|
||||
use frame_system::RawOrigin;
|
||||
|
||||
@@ -332,9 +334,16 @@ benchmarks! {
|
||||
}
|
||||
}
|
||||
|
||||
// We use the max block weight for this extrinsic for now. See below.
|
||||
remove_member_without_replacement {}: {
|
||||
Err(BenchmarkError::Override(
|
||||
BenchmarkResult::from_weight(T::BlockWeights::get().max_block)
|
||||
))?;
|
||||
}
|
||||
|
||||
// -- Root ones
|
||||
#[extra] // this calls into phragmen and consumes a full block for now.
|
||||
remove_member_without_replacement {
|
||||
remove_member_without_replacement_extra {
|
||||
// worse case is when we remove a member and we have no runner as a replacement. This
|
||||
// triggers phragmen again. The only parameter is how many candidates will compete for the
|
||||
// new slot.
|
||||
|
||||
Reference in New Issue
Block a user