mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 03:07:56 +00:00
Added an event for cancel_proposal (#11620)
* Added an event for cancel_proposal * test
This commit is contained in:
@@ -537,6 +537,8 @@ pub mod pallet {
|
||||
Voted { voter: T::AccountId, ref_index: ReferendumIndex, vote: AccountVote<BalanceOf<T>> },
|
||||
/// An account has secconded a proposal
|
||||
Seconded { seconder: T::AccountId, prop_index: PropIndex },
|
||||
/// A proposal got canceled.
|
||||
ProposalCanceled { prop_index: PropIndex },
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
@@ -1277,6 +1279,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
Self::deposit_event(Event::<T>::ProposalCanceled { prop_index });
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,11 +96,11 @@ fn invalid_seconds_upper_bound_should_not_work() {
|
||||
#[test]
|
||||
fn cancel_proposal_should_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
System::set_block_number(0);
|
||||
assert_ok!(propose_set_balance_and_note(1, 2, 2));
|
||||
assert_ok!(propose_set_balance_and_note(1, 4, 4));
|
||||
assert_noop!(Democracy::cancel_proposal(Origin::signed(1), 0), BadOrigin);
|
||||
assert_ok!(Democracy::cancel_proposal(Origin::root(), 0));
|
||||
System::assert_last_event(crate::Event::ProposalCanceled { prop_index: 0 }.into());
|
||||
assert_eq!(Democracy::backing_for(0), None);
|
||||
assert_eq!(Democracy::backing_for(1), Some(4));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user