Fix benchmarks and adds CI to test them (#12068)

* Fix benchmarks and adds CI to test them

Instead of waiting for benchmarks failing in Polkadot CI, we also can just test them in Substrate :P

* Do not overflow
This commit is contained in:
Bastian Köcher
2022-08-19 13:07:14 +02:00
committed by GitHub
parent 13fa566590
commit 9d75f3e3e7
7 changed files with 40 additions and 9 deletions
@@ -43,7 +43,9 @@ fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn funded_account<T: Config>(name: &'static str, index: u32) -> T::AccountId {
let caller: T::AccountId = account(name, index, SEED);
T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value());
// Give the account half of the maximum value of the `Balance` type.
// Otherwise some transfers will fail with an overflow error.
T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value() / 2u32.into());
caller
}