Skip to content
Snippets Groups Projects
Commit 83711ca2 authored by Gavin Wood's avatar Gavin Wood Committed by Bastian Köcher
Browse files

Remove proposal when it is refused (#4399)

* Remove proposal when it is refused.

* Fix build, add test
parent 11382de2
No related merge requests found
......@@ -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(|| {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment