mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 22:11:06 +00:00
Benchmark's successful origin api update (#13146)
* try successful origin unimplemented by default * error as a default impl for try_successful_origin * remove successful_origin func of EnsureOrigin trait * default impl -> unimplemented!() * update EnsureOriginWithArg * fix EnsureOriginWithArg * prefix unused arg with underscore * use try_successful_origin instead successful_origin, map err to Weightless * fix tests * remove default impl * unwrap for indirect origin dep * replace unwrap by expect with a message --------- Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
use super::*;
|
||||
use frame_benchmarking::v1::{account, benchmarks, whitelisted_caller};
|
||||
use frame_benchmarking::v1::{account, benchmarks, whitelisted_caller, BenchmarkError};
|
||||
use frame_support::traits::{nonfungible::Inspect, Currency, EnsureOrigin, Get};
|
||||
use frame_system::RawOrigin;
|
||||
use sp_arithmetic::Perquintill;
|
||||
@@ -100,7 +100,8 @@ benchmarks! {
|
||||
}
|
||||
|
||||
fund_deficit {
|
||||
let origin = T::FundOrigin::successful_origin();
|
||||
let origin =
|
||||
T::FundOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
let bid = T::MinBid::get().max(One::one());
|
||||
T::Currency::make_free_balance_be(&caller, bid);
|
||||
|
||||
Reference in New Issue
Block a user