fix : remove _{ } syntax from benchmark macro (#7822)

* commented use of common

* hack to pass tests

* another hack

* remove all commented code

* fix the easy tests

* temp hack

* follow through comma hack until better solution

* patch macro

* missed one

* update benchmarks

* update docs

* fix docs

* removed too much

* fix changes

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Stanly Johnson
2021-01-06 07:21:02 +05:30
committed by GitHub
parent 3f629f743b
commit d2ac8bd941
28 changed files with 74 additions and 185 deletions
+9 -13
View File
@@ -80,12 +80,8 @@ fn add_announcements<T: Config>(
}
benchmarks! {
_ {
let p in 1 .. (T::MaxProxies::get() - 1).into() => add_proxies::<T>(p, None)?;
}
proxy {
let p in ...;
let p in 1 .. (T::MaxProxies::get() - 1).into() => add_proxies::<T>(p, None)?;
// In this case the caller is the "target" proxy
let caller: T::AccountId = account("target", p - 1, SEED);
T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value());
@@ -99,7 +95,7 @@ benchmarks! {
proxy_announced {
let a in 0 .. T::MaxPending::get() - 1;
let p in ...;
let p in 1 .. (T::MaxProxies::get() - 1).into() => add_proxies::<T>(p, None)?;
// In this case the caller is the "target" proxy
let caller: T::AccountId = account("anonymous", 0, SEED);
let delegate: T::AccountId = account("target", p - 1, SEED);
@@ -120,7 +116,7 @@ benchmarks! {
remove_announcement {
let a in 0 .. T::MaxPending::get() - 1;
let p in ...;
let p in 1 .. (T::MaxProxies::get() - 1).into() => add_proxies::<T>(p, None)?;
// In this case the caller is the "target" proxy
let caller: T::AccountId = account("target", p - 1, SEED);
T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value());
@@ -141,7 +137,7 @@ benchmarks! {
reject_announcement {
let a in 0 .. T::MaxPending::get() - 1;
let p in ...;
let p in 1 .. (T::MaxProxies::get() - 1).into() => add_proxies::<T>(p, None)?;
// In this case the caller is the "target" proxy
let caller: T::AccountId = account("target", p - 1, SEED);
T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value());
@@ -162,7 +158,7 @@ benchmarks! {
announce {
let a in 0 .. T::MaxPending::get() - 1;
let p in ...;
let p in 1 .. (T::MaxProxies::get() - 1).into() => add_proxies::<T>(p, None)?;
// In this case the caller is the "target" proxy
let caller: T::AccountId = account("target", p - 1, SEED);
T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value());
@@ -177,7 +173,7 @@ benchmarks! {
}
add_proxy {
let p in ...;
let p in 1 .. (T::MaxProxies::get() - 1).into() => add_proxies::<T>(p, None)?;
let caller: T::AccountId = whitelisted_caller();
}: _(
RawOrigin::Signed(caller.clone()),
@@ -191,7 +187,7 @@ benchmarks! {
}
remove_proxy {
let p in ...;
let p in 1 .. (T::MaxProxies::get() - 1).into() => add_proxies::<T>(p, None)?;
let caller: T::AccountId = whitelisted_caller();
}: _(
RawOrigin::Signed(caller.clone()),
@@ -205,7 +201,7 @@ benchmarks! {
}
remove_proxies {
let p in ...;
let p in 1 .. (T::MaxProxies::get() - 1).into() => add_proxies::<T>(p, None)?;
let caller: T::AccountId = whitelisted_caller();
}: _(RawOrigin::Signed(caller.clone()))
verify {
@@ -214,7 +210,7 @@ benchmarks! {
}
anonymous {
let p in ...;
let p in 1 .. (T::MaxProxies::get() - 1).into() => add_proxies::<T>(p, None)?;
let caller: T::AccountId = whitelisted_caller();
}: _(
RawOrigin::Signed(caller.clone()),