mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 22:11:06 +00:00
Extend Schedule Pallet for Root Scheduling/Canceling (#5907)
* Add root dispatch to scheduler * Move encode operation upwards * fix benchmark * extend extrinsics * add some clarifying comments * start to add benchmarking * finish weights * remove double encode * bump spec * Update weights * more accurate weights * bump base weight
This commit is contained in:
@@ -69,7 +69,7 @@ fn add_referendum<T: Trait>(n: u32) -> Result<ReferendumIndex, &'static str> {
|
||||
);
|
||||
let referendum_index: ReferendumIndex = ReferendumCount::get() - 1;
|
||||
let _ = T::Scheduler::schedule_named(
|
||||
(DEMOCRACY_ID, referendum_index),
|
||||
(DEMOCRACY_ID, referendum_index).encode(),
|
||||
0.into(),
|
||||
None,
|
||||
63,
|
||||
|
||||
@@ -832,7 +832,7 @@ decl_module! {
|
||||
#[weight = (0, DispatchClass::Operational)]
|
||||
fn cancel_queued(origin, which: ReferendumIndex) {
|
||||
ensure_root(origin)?;
|
||||
T::Scheduler::cancel_named((DEMOCRACY_ID, which))
|
||||
T::Scheduler::cancel_named((DEMOCRACY_ID, which).encode())
|
||||
.map_err(|_| Error::<T>::ProposalMissing)?;
|
||||
}
|
||||
|
||||
@@ -1659,7 +1659,7 @@ impl<T: Trait> Module<T> {
|
||||
});
|
||||
|
||||
if T::Scheduler::schedule_named(
|
||||
(DEMOCRACY_ID, index),
|
||||
(DEMOCRACY_ID, index).encode(),
|
||||
when,
|
||||
None,
|
||||
63,
|
||||
|
||||
Reference in New Issue
Block a user