mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
Benchmarks for elections-phragmen pallet (#5845)
* Fist benchmark barely working * Debug checkpoint * add rest of benchmarks * Add to runtime * Fix build * Update frame/elections-phragmen/src/benchmarking.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/elections-phragmen/src/benchmarking.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * major imp * Make them run on release * Help finish phragmen benchmarks (#5886) * update caller, account, and member/runner-up creation * remove stuff * ocd * make it work with real run * relax the numbers a bit * New and improved version * Make elections-phragmen weighable and secure. (#5949) * Make elections-phragmen weighable. * Update frame/elections-phragmen/src/lib.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Update frame/elections-phragmen/src/lib.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Fix all tests * Fix everything * Add note Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Doc update * Fix some complexity params * Once more ready to benchmark * ready for bench * final tunes * Update frame/elections-phragmen/src/lib.rs * Fix fix * Update frame/elections-phragmen/src/lib.rs * Update frame/elections-phragmen/src/benchmarking.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Update frame/elections-phragmen/src/benchmarking.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Update to latest weights * Some fixes * Fix dual voter read from @thiolliere * Remove todos * review from @shawntabrizi * Fix bench tests. Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
This commit is contained in:
@@ -214,7 +214,20 @@ macro_rules! assert_err {
|
||||
#[cfg(feature = "std")]
|
||||
macro_rules! assert_err_ignore_postinfo {
|
||||
( $x:expr , $y:expr $(,)? ) => {
|
||||
assert_err!($x.map(|_| ()).map_err(|e| e.error), $y);
|
||||
$crate::assert_err!($x.map(|_| ()).map_err(|e| e.error), $y);
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
#[cfg(feature = "std")]
|
||||
macro_rules! assert_err_with_weight {
|
||||
($call:expr, $err:expr, $weight:expr $(,)? ) => {
|
||||
if let Err(dispatch_err_with_post) = $call {
|
||||
$crate::assert_err!($call.map(|_| ()).map_err(|e| e.error), $err);
|
||||
assert_eq!(dispatch_err_with_post.post_info.actual_weight, $weight.into());
|
||||
} else {
|
||||
panic!("expected Err(_), got Ok(_).")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user