Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

new proc-macro-based benchmarking syntax #12924

Merged
merged 148 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
159de40
add stub for new benchmark macro
sam0x17 Dec 13, 2022
fabc0cd
benchmark syntax
sam0x17 Dec 14, 2022
04d652c
add #[extrinsic call] separator
sam0x17 Dec 14, 2022
c6c8eae
parse #[benchmark] item as a function
sam0x17 Dec 14, 2022
940a1d9
proper emission of error when #[extrinsic_call] annotation is missing
sam0x17 Dec 15, 2022
ece2c1d
clean up
sam0x17 Dec 15, 2022
7d0a467
enclosing module via benchmarks! { } working
sam0x17 Dec 16, 2022
ad8260c
use an attribute macro on the module instead of benchmarks! { }
sam0x17 Dec 16, 2022
7ab18a9
cargo fmt
sam0x17 Dec 16, 2022
d4efeaf
working component implementation
sam0x17 Dec 16, 2022
968a756
WIP
sam0x17 Dec 16, 2022
9ae168b
working
sam0x17 Dec 17, 2022
d976fbf
add syntax for Linear<A, B>
sam0x17 Dec 18, 2022
9fd9dc9
parsing of param ranges (still need to build tuple though)
sam0x17 Dec 18, 2022
ca6c377
params parsing WIP
sam0x17 Dec 19, 2022
09b1f32
clean up (don't need extrinsic call name)
sam0x17 Dec 20, 2022
b767e9f
use proper Result syntax for BenchmarkDef parsing
sam0x17 Dec 20, 2022
d36210a
proper parsing of Linear<0, 1> style args
sam0x17 Dec 20, 2022
33ac0f7
successfully parse and make use of linear component ranges :boom:
sam0x17 Dec 20, 2022
b75410f
rename support variable => home because eventually will be moved
sam0x17 Dec 20, 2022
7686c7f
compile-time check that param range types implement ParamRange
sam0x17 Dec 20, 2022
061b3fe
switch to using balances as example, failing on instance pallet
sam0x17 Dec 21, 2022
883c738
successfully set up __origin and __call with balances :boom:
sam0x17 Dec 21, 2022
193f946
clean up
sam0x17 Dec 22, 2022
a9784eb
use a module
sam0x17 Dec 23, 2022
d3fe8ac
don't need a variable for transfer
sam0x17 Dec 23, 2022
deb4157
rename benchmark_transfer -> transfer because no longer conflicts
sam0x17 Dec 23, 2022
982429d
clean up
sam0x17 Dec 23, 2022
749c7b0
working with transfer_increasing_users as well :boom:
sam0x17 Dec 23, 2022
0ef810c
re-add BareBlock
sam0x17 Dec 23, 2022
4fe2cd8
add comments for undocumented structs+functions+traits
sam0x17 Dec 23, 2022
75297bb
refactor in preparation for removing module requirements
sam0x17 Dec 23, 2022
dc12eb2
switch to a block instead of a module
sam0x17 Dec 23, 2022
905f901
use the outer macro pattern to to enable #[benchmarks] aggregation
sam0x17 Dec 27, 2022
9ae7041
successfully generate SelectedBenchmark :boom:
sam0x17 Dec 27, 2022
f989f89
implement components for SelectedBenchmark
sam0x17 Dec 28, 2022
2189e0d
implement instance for SelectedBenchmark
sam0x17 Dec 28, 2022
c1b3667
properly track #[extra]
sam0x17 Dec 29, 2022
cf0a897
working impl for fn benchmarks()
sam0x17 Dec 29, 2022
199ae05
run_benchmarks WIP
sam0x17 Dec 31, 2022
a7df617
finish run_benchmark! impl :boom:
sam0x17 Jan 1, 2023
58aa62e
import balances transfer_best_case benchmark
sam0x17 Jan 2, 2023
44bf752
import transfer_keep_alive balances pallet benchmark
sam0x17 Jan 2, 2023
fadbc5b
import set_balance_creating balances pallet benchmark
sam0x17 Jan 2, 2023
8aad678
import set_balance_killing balances pallet benchmark
sam0x17 Jan 2, 2023
316210d
import force_transfer balances pallet benchmark
sam0x17 Jan 2, 2023
8218b3f
add #[extra] annotation and docs to transfer_increasing_users
sam0x17 Jan 2, 2023
eae9464
import transfer_all balances pallet benchmark
sam0x17 Jan 2, 2023
057dc07
import force_unreserve balances pallet benchmark
sam0x17 Jan 2, 2023
4f70c52
prepare to implement impl_benchmark_test_suite!
sam0x17 Jan 2, 2023
02bf583
ensure tests cover #[extra] before and after #[benchmark] tag
sam0x17 Jan 2, 2023
f4c3035
refactor
sam0x17 Jan 3, 2023
03c2a7f
clean up
sam0x17 Jan 3, 2023
3023e48
fix
sam0x17 Jan 3, 2023
90d839f
move to outer
sam0x17 Jan 3, 2023
700124e
switch to benchmarks/instance_benchmarks
sam0x17 Jan 4, 2023
2371768
test impl almost done, strange compiler error
sam0x17 Jan 5, 2023
d9c77e6
benchmark test suites working :boom:
sam0x17 Jan 5, 2023
d8fb36a
clean up
sam0x17 Jan 5, 2023
63358d8
add stub and basic parsing for where_clause
sam0x17 Jan 5, 2023
520d7eb
working except where clause and extrinsic calls containing method chains
sam0x17 Jan 5, 2023
1fb5898
assume option (2) for now wrt https://github.com/paritytech/substrate…
sam0x17 Jan 5, 2023
9d61cd3
clean up
sam0x17 Jan 6, 2023
34b770b
switch to attribute-style
sam0x17 Jan 6, 2023
a90a04f
properly handle where clauses
sam0x17 Jan 6, 2023
f8525e2
fix subtle missing where clause, now just MessageQueue issues
sam0x17 Jan 6, 2023
59ae627
fix block formatting in message-queue pallet
sam0x17 Jan 6, 2023
3b76271
switch to block vs non-block parsing of extrinsic call
sam0x17 Jan 6, 2023
43e461f
working now but some benchmark tests failing
sam0x17 Jan 6, 2023
50fd18a
message-queue tests working (run order issue fixed) :tada:
sam0x17 Jan 7, 2023
e279512
add comments and internal docs for fame_support_procedural::benchmark
sam0x17 Jan 7, 2023
7f2c3ed
fix license years
sam0x17 Jan 7, 2023
73511ed
docs for lib.rs
sam0x17 Jan 8, 2023
3b1387c
add docs to new support procedural macros
sam0x17 Jan 8, 2023
f318393
don't allow #[benchmark] outside of benchmarking module
sam0x17 Jan 8, 2023
b885d62
add docs
sam0x17 Jan 8, 2023
f7c7454
use benchmark(extra, skip_meta) style args
sam0x17 Jan 9, 2023
2877c2c
update docs accordingly
sam0x17 Jan 9, 2023
5df08c9
appease clippy
sam0x17 Jan 9, 2023
7802bfd
bump ci
sam0x17 Jan 9, 2023
09bd5ee
add notes about `extra` and `skip_meta`
sam0x17 Jan 9, 2023
c601966
fix doc tests
sam0x17 Jan 9, 2023
7c8af26
re-run CI
sam0x17 Jan 9, 2023
4b3707e
use `ignore` instead of `no_run` on doc examples
sam0x17 Jan 9, 2023
e6a671f
bump CI
sam0x17 Jan 11, 2023
6e808af
replace some if-lets with if-elses
sam0x17 Jan 11, 2023
c907eb1
more refactoring of if-let statements
sam0x17 Jan 11, 2023
08268b5
fix remaining if-lets in BenchmarkDef::from()
sam0x17 Jan 12, 2023
ffa06ea
fix if-lets in benchmarks()
sam0x17 Jan 12, 2023
8f3b7b5
fix remaining if-lets, use nested find_map for extrinsic call
sam0x17 Jan 12, 2023
7410006
switch to use #[extrinsic_call] or #[block] situationally
sam0x17 Jan 12, 2023
f226fc8
refactor ExtrinsicCallDef => BenchmarkCallDef
sam0x17 Jan 12, 2023
401eef5
update docs with info about #[block]
sam0x17 Jan 12, 2023
1016153
add macro stub for #[extrinsic_call]
sam0x17 Jan 12, 2023
47b679a
fix docs and add stub for #[block] as well
sam0x17 Jan 12, 2023
dd8fc6f
remove unused extern crate line
sam0x17 Jan 12, 2023
fac2217
fix clippy nits
sam0x17 Jan 12, 2023
bd229d0
Use V2 bench syntax in pallet-example-basic
ggwpez Jan 12, 2023
91227f8
carry over comment
sam0x17 Jan 12, 2023
0443248
use curly-brace style for impl_benchmark_test_suite!
sam0x17 Jan 12, 2023
25b9093
remove unneeded parenthesis
sam0x17 Jan 12, 2023
82fa413
proper handling of _() extrinsic call style
sam0x17 Jan 12, 2023
0a371f5
add docs for _() syntax
sam0x17 Jan 13, 2023
67c227d
fix crate access
sam0x17 Jan 13, 2023
b8b8d50
simplify keyword access
sam0x17 Jan 13, 2023
cff3a2a
simplify module content destructuring
sam0x17 Jan 13, 2023
5de75fe
fix crate access "frame_benchmarking" => "frame-benchmarking", compiles
sam0x17 Jan 13, 2023
b2a24bd
use _() extrinsic call syntax where possible in balances
sam0x17 Jan 13, 2023
c588411
simplify attr.path.segments.last()
sam0x17 Jan 13, 2023
d6e29b2
fix compile error being suppressed
sam0x17 Jan 13, 2023
48fe1da
simplify extrinsic call keyword parsing
sam0x17 Jan 13, 2023
ce71216
use ? operator instead of return None
sam0x17 Jan 13, 2023
675f2e8
rename generics => type_use_generics
sam0x17 Jan 13, 2023
2171d27
simplify extrinsic call extraction with transpose
sam0x17 Jan 13, 2023
37216c9
bump CI
sam0x17 Jan 13, 2023
14ef35f
nit
sam0x17 Jan 13, 2023
ee570d3
proper handling of too many + too few block/extrinsic call annotations
sam0x17 Jan 13, 2023
9660e5e
change to B >= A
sam0x17 Jan 13, 2023
1d559fb
remove unneeded ignore
sam0x17 Jan 13, 2023
d261bc5
remove another ignore
sam0x17 Jan 13, 2023
88c8ada
add ui tests
sam0x17 Jan 13, 2023
93613ee
use _() style extrinsic call on accumulate_dummy
sam0x17 Jan 13, 2023
2871686
add range check to ParamRange
sam0x17 Jan 13, 2023
16d3581
ui test for bad param ranges
sam0x17 Jan 13, 2023
68e2714
fix failing example
sam0x17 Jan 13, 2023
29308ac
add ignore back to other failing example
sam0x17 Jan 13, 2023
0601567
Merge branch 'master' into sam-benchmarking-overhaul
sam0x17 Jan 13, 2023
be0439b
tweak expr_call span
sam0x17 Jan 14, 2023
9d0e919
fix typo
sam0x17 Jan 14, 2023
232d4ca
eliminate a match
sam0x17 Jan 16, 2023
186ce01
change pub fn benchmarks to return Result<TokenStream>
sam0x17 Jan 16, 2023
b21ac54
fix origin error span
sam0x17 Jan 16, 2023
7fa5fe1
more informative error for invalid benchmark parameter name
sam0x17 Jan 16, 2023
014d527
fix spans on a few benchmark errors
sam0x17 Jan 16, 2023
b3f1ab0
remove unneeded clone
sam0x17 Jan 16, 2023
b9472f2
refactor inner loop of benchmark function parsing
sam0x17 Jan 16, 2023
0663c88
preserve mod attributes
sam0x17 Jan 16, 2023
7bcb5ce
refactor outer loop of benchmark def parsing code, greatly simplified
sam0x17 Jan 17, 2023
30fc19e
simplify to use a ? operator when parsing benchmark attr path
sam0x17 Jan 17, 2023
4a6520b
fix another ? operator
sam0x17 Jan 17, 2023
c720703
further simplify benchmark function attr parsing with more ? ops
sam0x17 Jan 17, 2023
8ecf30c
refactor extrinsic call handling to use if let rather than match
sam0x17 Jan 17, 2023
bd67fc0
replace is_ok => is_err
sam0x17 Jan 17, 2023
252bf6f
re-use name during expansion of benchmark def
sam0x17 Jan 17, 2023
d6de5a5
remove unneeded clone
sam0x17 Jan 17, 2023
091825b
fix span for origin missing error
sam0x17 Jan 20, 2023
43ee067
fix missing semi
sam0x17 Jan 20, 2023
d344df8
Merge remote-tracking branch 'origin/master' into sam-benchmarking-ov…
Jan 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

127 changes: 80 additions & 47 deletions frame/balances/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2020-2022 Parity Technologies (UK) Ltd.
// Copyright (C) 2020-2023 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -20,22 +20,25 @@
#![cfg(feature = "runtime-benchmarks")]

use super::*;
use crate::Pallet as Balances;

use frame_benchmarking::{account, benchmarks_instance_pallet, whitelisted_caller};
use frame_benchmarking::{account, impl_benchmark_test_suite, whitelisted_caller};
use frame_support::benchmarking::*;
use frame_system::RawOrigin;
use sp_runtime::traits::Bounded;

use crate::Pallet as Balances;

const SEED: u32 = 0;
// existential deposit multiplier
const ED_MULTIPLIER: u32 = 10;

benchmarks_instance_pallet! {
#[instance_benchmarks]
mod benchmarks {
use super::*;

// Benchmark `transfer` extrinsic with the worst possible conditions:
sam0x17 marked this conversation as resolved.
Show resolved Hide resolved
// * Transfer will kill the sender account.
// * Transfer will create the recipient account.
transfer {
#[benchmark]
sam0x17 marked this conversation as resolved.
Show resolved Hide resolved
fn transfer() {
let existential_deposit = T::ExistentialDeposit::get();
let caller = whitelisted_caller();

Expand All @@ -47,84 +50,103 @@ benchmarks_instance_pallet! {
// and reap this user.
let recipient: T::AccountId = account("recipient", 0, SEED);
let recipient_lookup = T::Lookup::unlookup(recipient.clone());
let transfer_amount = existential_deposit.saturating_mul((ED_MULTIPLIER - 1).into()) + 1u32.into();
}: transfer(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount)
verify {
let transfer_amount =
existential_deposit.saturating_mul((ED_MULTIPLIER - 1).into()) + 1u32.into();

#[extrinsic_call]
_(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount);

assert_eq!(Balances::<T, I>::free_balance(&caller), Zero::zero());
assert_eq!(Balances::<T, I>::free_balance(&recipient), transfer_amount);
}

// Benchmark `transfer` with the best possible condition:
// * Both accounts exist and will continue to exist.
#[extra]
transfer_best_case {
#[benchmark(extra)]
fn transfer_best_case() {
let caller = whitelisted_caller();
let recipient: T::AccountId = account("recipient", 0, SEED);
let recipient_lookup = T::Lookup::unlookup(recipient.clone());

// Give the sender account max funds for transfer (their account will never reasonably be killed).
let _ = <Balances<T, I> as Currency<_>>::make_free_balance_be(&caller, T::Balance::max_value());
// Give the sender account max funds for transfer (their account will never reasonably be
// killed).
let _ =
<Balances<T, I> as Currency<_>>::make_free_balance_be(&caller, T::Balance::max_value());

// Give the recipient account existential deposit (thus their account already exists).
let existential_deposit = T::ExistentialDeposit::get();
let _ = <Balances<T, I> as Currency<_>>::make_free_balance_be(&recipient, existential_deposit);
let _ =
<Balances<T, I> as Currency<_>>::make_free_balance_be(&recipient, existential_deposit);
let transfer_amount = existential_deposit.saturating_mul(ED_MULTIPLIER.into());
}: transfer(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount)
verify {

#[extrinsic_call]
transfer(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount);

assert!(!Balances::<T, I>::free_balance(&caller).is_zero());
assert!(!Balances::<T, I>::free_balance(&recipient).is_zero());
}

// Benchmark `transfer_keep_alive` with the worst possible condition:
// * The recipient account is created.
transfer_keep_alive {
#[benchmark]
fn transfer_keep_alive() {
let caller = whitelisted_caller();
let recipient: T::AccountId = account("recipient", 0, SEED);
let recipient_lookup = T::Lookup::unlookup(recipient.clone());

// Give the sender account max funds, thus a transfer will not kill account.
let _ = <Balances<T, I> as Currency<_>>::make_free_balance_be(&caller, T::Balance::max_value());
let _ =
<Balances<T, I> as Currency<_>>::make_free_balance_be(&caller, T::Balance::max_value());
let existential_deposit = T::ExistentialDeposit::get();
let transfer_amount = existential_deposit.saturating_mul(ED_MULTIPLIER.into());
}: _(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount)
sam0x17 marked this conversation as resolved.
Show resolved Hide resolved
verify {

#[extrinsic_call]
_(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount);

assert!(!Balances::<T, I>::free_balance(&caller).is_zero());
assert_eq!(Balances::<T, I>::free_balance(&recipient), transfer_amount);
}

// Benchmark `set_balance` coming from ROOT account. This always creates an account.
set_balance_creating {
#[benchmark]
fn set_balance_creating() {
let user: T::AccountId = account("user", 0, SEED);
let user_lookup = T::Lookup::unlookup(user.clone());

// Give the user some initial balance.
let existential_deposit = T::ExistentialDeposit::get();
let balance_amount = existential_deposit.saturating_mul(ED_MULTIPLIER.into());
let _ = <Balances<T, I> as Currency<_>>::make_free_balance_be(&user, balance_amount);
}: set_balance(RawOrigin::Root, user_lookup, balance_amount, balance_amount)
verify {

#[extrinsic_call]
set_balance(RawOrigin::Root, user_lookup, balance_amount, balance_amount);

assert_eq!(Balances::<T, I>::free_balance(&user), balance_amount);
assert_eq!(Balances::<T, I>::reserved_balance(&user), balance_amount);
}

// Benchmark `set_balance` coming from ROOT account. This always kills an account.
set_balance_killing {
#[benchmark]
fn set_balance_killing() {
let user: T::AccountId = account("user", 0, SEED);
let user_lookup = T::Lookup::unlookup(user.clone());

// Give the user some initial balance.
let existential_deposit = T::ExistentialDeposit::get();
let balance_amount = existential_deposit.saturating_mul(ED_MULTIPLIER.into());
let _ = <Balances<T, I> as Currency<_>>::make_free_balance_be(&user, balance_amount);
}: set_balance(RawOrigin::Root, user_lookup, Zero::zero(), Zero::zero())
verify {

#[extrinsic_call]
set_balance(RawOrigin::Root, user_lookup, Zero::zero(), Zero::zero());

assert!(Balances::<T, I>::free_balance(&user).is_zero());
}

// Benchmark `force_transfer` extrinsic with the worst possible conditions:
// * Transfer will kill the sender account.
// * Transfer will create the recipient account.
force_transfer {
#[benchmark]
fn force_transfer() {
let existential_deposit = T::ExistentialDeposit::get();
let source: T::AccountId = account("source", 0, SEED);
let source_lookup = T::Lookup::unlookup(source.clone());
Expand All @@ -133,23 +155,26 @@ benchmarks_instance_pallet! {
let balance = existential_deposit.saturating_mul(ED_MULTIPLIER.into());
let _ = <Balances<T, I> as Currency<_>>::make_free_balance_be(&source, balance);

// Transfer `e - 1` existential deposits + 1 unit, which guarantees to create one account, and reap this user.
// Transfer `e - 1` existential deposits + 1 unit, which guarantees to create one account,
// and reap this user.
let recipient: T::AccountId = account("recipient", 0, SEED);
let recipient_lookup = T::Lookup::unlookup(recipient.clone());
let transfer_amount = existential_deposit.saturating_mul((ED_MULTIPLIER - 1).into()) + 1u32.into();
}: force_transfer(RawOrigin::Root, source_lookup, recipient_lookup, transfer_amount)
verify {
let transfer_amount =
existential_deposit.saturating_mul((ED_MULTIPLIER - 1).into()) + 1u32.into();

#[extrinsic_call]
_(RawOrigin::Root, source_lookup, recipient_lookup, transfer_amount);

assert_eq!(Balances::<T, I>::free_balance(&source), Zero::zero());
assert_eq!(Balances::<T, I>::free_balance(&recipient), transfer_amount);
}

// This benchmark performs the same operation as `transfer` in the worst case scenario,
// but additionally introduces many new users into the storage, increasing the the merkle
// trie and PoV size.
#[extra]
transfer_increasing_users {
#[benchmark(extra)]
fn transfer_increasing_users(u: Linear<0, 1_000>) {
// 1_000 is not very much, but this upper bound can be controlled by the CLI.
let u in 0 .. 1_000;
let existential_deposit = T::ExistentialDeposit::get();
let caller = whitelisted_caller();

Expand All @@ -161,25 +186,29 @@ benchmarks_instance_pallet! {
// and reap this user.
let recipient: T::AccountId = account("recipient", 0, SEED);
let recipient_lookup = T::Lookup::unlookup(recipient.clone());
let transfer_amount = existential_deposit.saturating_mul((ED_MULTIPLIER - 1).into()) + 1u32.into();
let transfer_amount =
existential_deposit.saturating_mul((ED_MULTIPLIER - 1).into()) + 1u32.into();

// Create a bunch of users in storage.
for i in 0 .. u {
for i in 0..u {
// The `account` function uses `blake2_256` to generate unique accounts, so these
// should be quite random and evenly distributed in the trie.
let new_user: T::AccountId = account("new_user", i, SEED);
let _ = <Balances<T, I> as Currency<_>>::make_free_balance_be(&new_user, balance);
}
}: transfer(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount)
verify {

#[extrinsic_call]
transfer(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount);

assert_eq!(Balances::<T, I>::free_balance(&caller), Zero::zero());
assert_eq!(Balances::<T, I>::free_balance(&recipient), transfer_amount);
}

// Benchmark `transfer_all` with the worst possible condition:
// * The recipient account is created
// * The sender is killed
transfer_all {
#[benchmark]
fn transfer_all() {
let caller = whitelisted_caller();
let recipient: T::AccountId = account("recipient", 0, SEED);
let recipient_lookup = T::Lookup::unlookup(recipient.clone());
Expand All @@ -188,13 +217,16 @@ benchmarks_instance_pallet! {
let existential_deposit = T::ExistentialDeposit::get();
let balance = existential_deposit.saturating_mul(ED_MULTIPLIER.into());
let _ = <Balances<T, I> as Currency<_>>::make_free_balance_be(&caller, balance);
}: _(RawOrigin::Signed(caller.clone()), recipient_lookup, false)
verify {

#[extrinsic_call]
_(RawOrigin::Signed(caller.clone()), recipient_lookup, false);

assert!(Balances::<T, I>::free_balance(&caller).is_zero());
assert_eq!(Balances::<T, I>::free_balance(&recipient), balance);
}

force_unreserve {
#[benchmark]
fn force_unreserve() {
let user: T::AccountId = account("user", 0, SEED);
let user_lookup = T::Lookup::unlookup(user.clone());

Expand All @@ -208,15 +240,16 @@ benchmarks_instance_pallet! {
assert_eq!(Balances::<T, I>::reserved_balance(&user), balance);
assert!(Balances::<T, I>::free_balance(&user).is_zero());

}: _(RawOrigin::Root, user_lookup, balance)
verify {
#[extrinsic_call]
_(RawOrigin::Root, user_lookup, balance);

assert!(Balances::<T, I>::reserved_balance(&user).is_zero());
assert_eq!(Balances::<T, I>::free_balance(&user), balance);
}

impl_benchmark_test_suite!(
impl_benchmark_test_suite! {
Balances,
crate::tests_composite::ExtBuilder::default().build(),
sam0x17 marked this conversation as resolved.
Show resolved Hide resolved
crate::tests_composite::Test,
)
}
}
Loading