mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 07:25:44 +00:00
Refund referendum submission deposit (#12788)
* optinal submission deposit and migration * refund submission deposit call, test, bench * try runtime fixes * assert for bench * Only refund cancelled/approved referenda deposits * update storage version Co-authored-by: Gav <gavin@parity.io>
This commit is contained in:
@@ -264,6 +264,19 @@ benchmarks_instance_pallet! {
|
||||
assert_matches!(ReferendumInfoFor::<T, I>::get(index), Some(ReferendumInfo::Cancelled(_, _, None)));
|
||||
}
|
||||
|
||||
refund_submission_deposit {
|
||||
let (origin, index) = create_referendum::<T, I>();
|
||||
let caller = frame_system::ensure_signed(origin.clone()).unwrap();
|
||||
let balance = T::Currency::free_balance(&caller);
|
||||
assert_ok!(Referenda::<T, I>::cancel(T::CancelOrigin::successful_origin(), index));
|
||||
assert_matches!(ReferendumInfoFor::<T, I>::get(index), Some(ReferendumInfo::Cancelled(_, Some(_), _)));
|
||||
}: _<T::RuntimeOrigin>(origin, index)
|
||||
verify {
|
||||
assert_matches!(ReferendumInfoFor::<T, I>::get(index), Some(ReferendumInfo::Cancelled(_, None, _)));
|
||||
let new_balance = T::Currency::free_balance(&caller);
|
||||
assert!(new_balance > balance);
|
||||
}
|
||||
|
||||
cancel {
|
||||
let (_origin, index) = create_referendum::<T, I>();
|
||||
place_deposit::<T, I>(index);
|
||||
|
||||
Reference in New Issue
Block a user