Skip to content

Commit

Permalink
Add verify to benchmark and document the new call
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidK committed Oct 24, 2024
1 parent 727e8fb commit 233576c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion substrate/frame/bounties/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,17 @@ benchmarks_instance_pallet! {
approve_bounty_with_curator {
setup_pot_account::<T, I>();
let (caller, curator, fee, value, reason) = setup_bounty::<T, I>(0, T::MaximumReasonLength::get());
let curator_lookup = T::Lookup::unlookup(curator);
let curator_lookup = T::Lookup::unlookup(curator.clone());
Bounties::<T, I>::propose_bounty(RawOrigin::Signed(caller).into(), value, reason)?;
let bounty_id = BountyCount::<T, I>::get() - 1;
let approve_origin = T::SpendOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
Treasury::<T, I>::on_initialize(BlockNumberFor::<T>::zero());
}: _<T::RuntimeOrigin>(approve_origin, bounty_id, curator_lookup, fee)
verify {
assert_last_event::<T, I>(
Event::CuratorProposed { bounty_id, curator }.into()
);
}

// Worst case when curator is inactive and any sender unassigns the curator.
unassign_curator {
Expand Down
2 changes: 2 additions & 0 deletions substrate/frame/bounties/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
//! - `approve_bounty` - Accept a specific treasury amount to be earmarked for a predefined body of
//! work.
//! - `propose_curator` - Assign an account to a bounty as candidate curator.
//! - `approve_bounty_with_curator` - Accept a specific treasury amount for a predefined body of
//! work with assigned candidate curator account.
//! - `accept_curator` - Accept a bounty assignment from the Council, setting a curator deposit.
//! - `extend_bounty_expiry` - Extend the expiry block number of the bounty and stay active.
//! - `award_bounty` - Close and pay out the specified amount for the completed work.
Expand Down

0 comments on commit 233576c

Please sign in to comment.