Introduce cancel_proposal to rid us of those pesky proposals (#7111)

* Introduce `cancel_proposal`

Also fix proposal weight.

* Support proposal cancellation from runtime.

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fix benchmarks

* fix benchmark

* whitelisted caller weights

* fix build

* Fixes

* Fixes

* Fixes

* Fixes

* Update frame/democracy/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* doc updates

* new weights

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Gavin Wood
2020-09-24 23:33:02 +02:00
committed by GitHub
parent 1b350a050c
commit 26465eadaa
10 changed files with 423 additions and 235 deletions
@@ -79,6 +79,32 @@ fn veto_external_works() {
});
}
#[test]
fn external_blacklisting_should_work() {
new_test_ext().execute_with(|| {
System::set_block_number(0);
assert_ok!(Democracy::external_propose(
Origin::signed(2),
set_balance_proposal_hash_and_note(2),
));
let hash = set_balance_proposal_hash(2);
assert_ok!(Democracy::blacklist(Origin::root(), hash, None));
fast_forward_to(2);
assert!(Democracy::referendum_status(0).is_err());
assert_noop!(
Democracy::external_propose(
Origin::signed(2),
set_balance_proposal_hash_and_note(2),
),
Error::<Test>::ProposalBlacklisted,
);
});
}
#[test]
fn external_referendum_works() {
new_test_ext().execute_with(|| {