mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +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:
@@ -173,7 +173,8 @@ benchmarks_instance_pallet! {
|
||||
let (caller, curator, fee, value, reason) = setup_bounty::<T, I>(0, 0);
|
||||
Bounties::<T, I>::propose_bounty(RawOrigin::Signed(caller).into(), value, reason)?;
|
||||
let bounty_id = BountyCount::<T, I>::get() - 1;
|
||||
let approve_origin = T::ApproveOrigin::successful_origin();
|
||||
let approve_origin =
|
||||
T::ApproveOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
|
||||
}: close_bounty<T::RuntimeOrigin>(approve_origin, bounty_id)
|
||||
|
||||
close_bounty_active {
|
||||
@@ -181,7 +182,8 @@ benchmarks_instance_pallet! {
|
||||
let (curator_lookup, bounty_id) = create_bounty::<T, I>()?;
|
||||
Treasury::<T, I>::on_initialize(T::BlockNumber::zero());
|
||||
let bounty_id = BountyCount::<T, I>::get() - 1;
|
||||
let approve_origin = T::ApproveOrigin::successful_origin();
|
||||
let approve_origin =
|
||||
T::ApproveOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
|
||||
}: close_bounty<T::RuntimeOrigin>(approve_origin, bounty_id)
|
||||
verify {
|
||||
assert_last_event::<T, I>(Event::BountyCanceled { index: bounty_id }.into())
|
||||
|
||||
Reference in New Issue
Block a user