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

Commit

Permalink
line width
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc committed Jun 19, 2020
1 parent c62d29d commit 3bae570
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions frame/scheduler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,10 @@ where
(when, index)
}

fn do_cancel(origin: Option<T::PalletsOrigin>, (when, index): TaskAddress<T::BlockNumber>) -> Result<(), DispatchError> {
fn do_cancel(
origin: Option<T::PalletsOrigin>,
(when, index): TaskAddress<T::BlockNumber>
) -> Result<(), DispatchError> {
let scheduled = Agenda::<T>::mutate(
when,
|agenda| {
Expand Down Expand Up @@ -785,8 +788,11 @@ mod tests {
let periodic_multiplier = <Test as frame_system::Trait>::DbWeight::get().reads_writes(1, 1);

// Named
assert_ok!(Scheduler::do_schedule_named(
1u32.encode(), 1, None, 255, root(), Call::Logger(logger::Call::log(3, MaximumSchedulerWeight::get() / 3)))
assert_ok!(
Scheduler::do_schedule_named(
1u32.encode(), 1, None, 255, root(),
Call::Logger(logger::Call::log(3, MaximumSchedulerWeight::get() / 3))
)
);
// Anon Periodic
Scheduler::do_schedule(
Expand All @@ -805,7 +811,9 @@ mod tests {
// Will include the named periodic only
let actual_weight = Scheduler::on_initialize(1);
let call_weight = MaximumSchedulerWeight::get() / 2;
assert_eq!(actual_weight, call_weight + base_weight + base_multiplier + named_multiplier + periodic_multiplier);
assert_eq!(
actual_weight, call_weight + base_weight + base_multiplier + named_multiplier + periodic_multiplier
);
assert_eq!(logger::log(), vec![(root(), 2600u32)]);

// Will include anon and anon periodic
Expand Down

0 comments on commit 3bae570

Please sign in to comment.