mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 17:28:00 +00:00
Introduce scheduler and use it for the democracy dispatch queue (#5412)
* Initial draft of the logic * Build and tests * Make work with new initialize infratructure. * Update frame/scheduler/src/lib.rs Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com> * Update frame/scheduler/src/lib.rs Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com> * Update frame/scheduler/src/lib.rs Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com> * Update frame/scheduler/src/lib.rs Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com> * Fix test * Update frame/scheduler/src/lib.rs Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com> * Rejig interface to make it more useful for democracy. * Try to get democraxy module to make use of scheduler. * Make democracy use scheduler. * Use actual max weight for enactent * Remove TODO * Fix runtime build * Minor cleanup * Fix scheduler. * Fix benchmarks * Fix * Fix * Fix * More bench fixes * Fix * Fix. * Add more bench constants. * Fix cancel_queued bench. * Fix test comment. * Update frame/scheduler/src/lib.rs Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com> Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
This commit is contained in:
@@ -50,13 +50,11 @@ fn cancel_queued_should_work() {
|
||||
|
||||
fast_forward_to(4);
|
||||
|
||||
assert_eq!(Democracy::dispatch_queue(), vec![
|
||||
(6, set_balance_proposal_hash_and_note(2), 0)
|
||||
]);
|
||||
assert!(pallet_scheduler::Agenda::<Test>::get(6)[0].is_some());
|
||||
|
||||
assert_noop!(Democracy::cancel_queued(Origin::ROOT, 1), Error::<Test>::ProposalMissing);
|
||||
assert_ok!(Democracy::cancel_queued(Origin::ROOT, 0));
|
||||
assert_eq!(Democracy::dispatch_queue(), vec![]);
|
||||
assert!(pallet_scheduler::Agenda::<Test>::get(6)[0].is_none());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,6 @@ fn reaping_imminent_preimage_should_fail() {
|
||||
assert_ok!(Democracy::vote(Origin::signed(1), r, aye(1)));
|
||||
next_block();
|
||||
next_block();
|
||||
// now imminent.
|
||||
assert_noop!(Democracy::reap_preimage(Origin::signed(6), h), Error::<Test>::Imminent);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -85,9 +85,7 @@ fn single_proposal_should_work() {
|
||||
fast_forward_to(4);
|
||||
|
||||
assert!(Democracy::referendum_status(0).is_err());
|
||||
assert_eq!(Democracy::dispatch_queue(), vec![
|
||||
(6, set_balance_proposal_hash_and_note(2), 0)
|
||||
]);
|
||||
assert!(pallet_scheduler::Agenda::<Test>::get(6)[0].is_some());
|
||||
|
||||
// referendum passes and wait another two blocks for enactment.
|
||||
fast_forward_to(6);
|
||||
|
||||
Reference in New Issue
Block a user