Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

allow to specify schedule time as a relative value #6578

Merged
8 commits merged into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 255,
impl_version: 1,
spec_version: 256,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
};
Expand Down
4 changes: 2 additions & 2 deletions frame/democracy/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use super::*;
use frame_benchmarking::{benchmarks, account};
use frame_support::{
IterableStorageMap,
traits::{Currency, Get, EnsureOrigin, OnInitialize, UnfilteredDispatchable},
traits::{Currency, Get, EnsureOrigin, OnInitialize, UnfilteredDispatchable, schedule::DispatchTime},
};
use frame_system::{RawOrigin, Module as System, self, EventRecord};
use sp_runtime::traits::{Bounded, One};
Expand Down Expand Up @@ -76,7 +76,7 @@ fn add_referendum<T: Trait>(n: u32) -> Result<ReferendumIndex, &'static str> {
let referendum_index: ReferendumIndex = ReferendumCount::get() - 1;
T::Scheduler::schedule_named(
(DEMOCRACY_ID, referendum_index).encode(),
1.into(),
DispatchTime::At(1.into()),
None,
63,
system::RawOrigin::Root.into(),
Expand Down
4 changes: 2 additions & 2 deletions frame/democracy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ use frame_support::{
weights::{Weight, DispatchClass},
traits::{
Currency, ReservableCurrency, LockableCurrency, WithdrawReason, LockIdentifier, Get,
OnUnbalanced, BalanceStatus, schedule::Named as ScheduleNamed, EnsureOrigin
OnUnbalanced, BalanceStatus, schedule::{Named as ScheduleNamed, DispatchTime}, EnsureOrigin
},
dispatch::DispatchResultWithPostInfo,
};
Expand Down Expand Up @@ -1688,7 +1688,7 @@ impl<T: Trait> Module<T> {

if T::Scheduler::schedule_named(
(DEMOCRACY_ID, index).encode(),
when,
DispatchTime::At(when),
None,
63,
system::RawOrigin::Root.into(),
Expand Down
2 changes: 1 addition & 1 deletion frame/scheduler/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn fill_schedule<T: Trait> (when: T::BlockNumber, n: u32) -> Result<(), &'static
// Named schedule is strictly heavier than anonymous
Scheduler::<T>::do_schedule_named(
i.encode(),
when,
DispatchTime::At(when),
// Add periodicity
Some((T::BlockNumber::one(), 100)),
// HARD_DEADLINE priority means it gets executed no matter what
Expand Down
Loading