mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 15:11:02 +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 {
|
} else {
|
||||||
// disapproved
|
// disapproved
|
||||||
|
<ProposalOf<T, I>>::remove(&proposal);
|
||||||
Self::deposit_event(RawEvent::Disapproved(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]
|
#[test]
|
||||||
fn motions_disapproval_works() {
|
fn motions_disapproval_works() {
|
||||||
make_ext().execute_with(|| {
|
make_ext().execute_with(|| {
|
||||||
|
|||||||
Reference in New Issue
Block a user