mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 05:37:58 +00:00
Remove proposal when it is refused (#4399)
* Remove proposal when it is refused. * Fix build, add test
This commit is contained in:
committed by
Bastian Köcher
parent
11382de277
commit
83711ca221
@@ -242,6 +242,7 @@ decl_module! {
|
||||
}
|
||||
} else {
|
||||
// disapproved
|
||||
<ProposalOf<T, I>>::remove(&proposal);
|
||||
Self::deposit_event(RawEvent::Disapproved(proposal));
|
||||
}
|
||||
|
||||
@@ -648,6 +649,20 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn motions_reproposing_disapproved_works() {
|
||||
make_ext().execute_with(|| {
|
||||
System::set_block_number(1);
|
||||
let proposal = make_proposal(42);
|
||||
let hash: H256 = proposal.blake2_256().into();
|
||||
assert_ok!(Collective::propose(Origin::signed(1), 3, Box::new(proposal.clone())));
|
||||
assert_ok!(Collective::vote(Origin::signed(2), hash.clone(), 0, false));
|
||||
assert_eq!(Collective::proposals(), vec![]);
|
||||
assert_ok!(Collective::propose(Origin::signed(1), 2, Box::new(proposal.clone())));
|
||||
assert_eq!(Collective::proposals(), vec![hash]);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn motions_disapproval_works() {
|
||||
make_ext().execute_with(|| {
|
||||
|
||||
Reference in New Issue
Block a user