mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11:03 +00:00
Fix invalid state transitions in pallet-bounties (#11630)
* Pallet-bounty: disallow invalid state transitions * Fix tests: funding only at even block numbers * Fix benchmarks: bounties need to be funded * fix on_initialize Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -221,7 +221,7 @@ benchmarks! {
|
||||
unassign_curator {
|
||||
setup_pot_account::<T>();
|
||||
let bounty_setup = activate_child_bounty::<T>(0, T::MaximumReasonLength::get())?;
|
||||
Bounties::<T>::on_initialize(T::BlockNumber::zero());
|
||||
Treasury::<T>::on_initialize(T::BlockNumber::zero());
|
||||
frame_system::Pallet::<T>::set_block_number(T::BountyUpdatePeriod::get() + 1u32.into());
|
||||
let caller = whitelisted_caller();
|
||||
}: _(RawOrigin::Signed(caller), bounty_setup.bounty_id,
|
||||
@@ -295,7 +295,7 @@ benchmarks! {
|
||||
close_child_bounty_active {
|
||||
setup_pot_account::<T>();
|
||||
let bounty_setup = activate_child_bounty::<T>(0, T::MaximumReasonLength::get())?;
|
||||
Bounties::<T>::on_initialize(T::BlockNumber::zero());
|
||||
Treasury::<T>::on_initialize(T::BlockNumber::zero());
|
||||
}: close_child_bounty(RawOrigin::Root, bounty_setup.bounty_id, bounty_setup.child_bounty_id)
|
||||
verify {
|
||||
assert_last_event::<T>(Event::Canceled {
|
||||
|
||||
Reference in New Issue
Block a user