mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Benchmark Democracy Pallet (#5257)
* Add origin bounds to benchmark macro. * Add democracy benchmark. * Fix tests * Remove collective from frame/benchmarking, partially use EnsureOrigin. * Remove collective stuff. * Make previous benches compile again. * Remove comments. * Make prev bench to work again. * Add remove votes. * Add new proxy calls. * Add runtime-benchmarks guard to EnsureOrigin and implementations. * Refactor. * Add missing import. * Remove duplicated import * Fix features. * Add some missing features. * Update frame/collective/Cargo.toml Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/democracy/src/benchmarking.rs Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/democracy/src/benchmarking.rs Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Add referendums to state. * populate vecs before call * Update weight docs * More fixes and weight docs * More updates Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -32,6 +32,7 @@ rand = "0.7.2"
|
||||
|
||||
[features]
|
||||
bench = []
|
||||
runtime-benchmarks = []
|
||||
default = ["std"]
|
||||
std = [
|
||||
"sp-application-crypto/std",
|
||||
|
||||
@@ -157,6 +157,12 @@ pub trait EnsureOrigin<OuterOrigin> {
|
||||
}
|
||||
/// Perform the origin check.
|
||||
fn try_origin(o: OuterOrigin) -> result::Result<Self::Success, OuterOrigin>;
|
||||
|
||||
/// Returns an outer origin capable of passing `try_origin` check.
|
||||
///
|
||||
/// ** Should be used for benchmarking only!!! **
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn successful_origin() -> OuterOrigin;
|
||||
}
|
||||
|
||||
/// An error that indicates that a lookup failed.
|
||||
|
||||
Reference in New Issue
Block a user