mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 01:51:02 +00:00
Weight v1.5: Opaque Struct (#12138)
* initial idea * update frame_support * update a bunch more * add ord * adjust RuntimeDbWeight * frame_system builds * re-export * frame_support tests pass * frame_executive compile * frame_executive builds * frame_system tests passing * pallet-utility tests pass * fix a bunch of pallets * more * phragmen * state-trie-migration * scheduler and referenda * pallet-election-provider-multi-phase * aura * staking * more * babe * balances * bunch more * sudo * transaction-payment * asset-tx-payment * last pallets * fix alliance merge * fix node template runtime * fix pallet-contracts cc @athei * fix node runtime * fix compile on runtime-benchmarks feature * comment * fix frame-support-test * fix more tests * weight regex * frame system works * fix a bunch * more * more * more * more * more * more fixes * update templates * fix contracts benchmarks * Update lib.rs * Update lib.rs * fix ui * make scalar saturating mul const * more const functions * scalar div * refactor using constant functions * move impl * fix overhead template * use compactas * Update lib.rs
This commit is contained in:
@@ -119,7 +119,7 @@ impl Contains<Call> for BaseFilter {
|
||||
|
||||
parameter_types! {
|
||||
pub BlockWeights: frame_system::limits::BlockWeights =
|
||||
frame_system::limits::BlockWeights::simple_max(2_000_000_000_000);
|
||||
frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(2_000_000_000_000));
|
||||
}
|
||||
impl system::Config for Test {
|
||||
type BaseCallFilter = BaseFilter;
|
||||
|
||||
@@ -30,7 +30,7 @@ use substrate_test_utils::assert_eq_uvec;
|
||||
#[test]
|
||||
fn basic_scheduling_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: 1000 });
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) });
|
||||
assert!(!<Test as frame_system::Config>::BaseCallFilter::contains(&call));
|
||||
assert_ok!(Scheduler::do_schedule(DispatchTime::At(4), None, 127, root(), call.into()));
|
||||
run_to_block(3);
|
||||
@@ -45,7 +45,7 @@ fn basic_scheduling_works() {
|
||||
#[test]
|
||||
fn scheduling_with_preimages_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: 1000 });
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) });
|
||||
let hash = <Test as frame_system::Config>::Hashing::hash_of(&call);
|
||||
let hashed = MaybeHashed::Hash(hash);
|
||||
assert_ok!(Preimage::note_preimage(Origin::signed(0), call.encode()));
|
||||
@@ -65,7 +65,7 @@ fn scheduling_with_preimages_works() {
|
||||
#[test]
|
||||
fn scheduling_with_preimage_postpones_correctly() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: 1000 });
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) });
|
||||
let hash = <Test as frame_system::Config>::Hashing::hash_of(&call);
|
||||
let hashed = MaybeHashed::Hash(hash);
|
||||
|
||||
@@ -98,7 +98,7 @@ fn scheduling_with_preimage_postpones_correctly() {
|
||||
fn schedule_after_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(2);
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: 1000 });
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) });
|
||||
assert!(!<Test as frame_system::Config>::BaseCallFilter::contains(&call));
|
||||
// This will schedule the call 3 blocks after the next block... so block 3 + 3 = 6
|
||||
assert_ok!(Scheduler::do_schedule(DispatchTime::After(3), None, 127, root(), call.into()));
|
||||
@@ -115,7 +115,7 @@ fn schedule_after_works() {
|
||||
fn schedule_after_zero_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(2);
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: 1000 });
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) });
|
||||
assert!(!<Test as frame_system::Config>::BaseCallFilter::contains(&call));
|
||||
assert_ok!(Scheduler::do_schedule(DispatchTime::After(0), None, 127, root(), call.into()));
|
||||
// Will trigger on the next block.
|
||||
@@ -135,7 +135,7 @@ fn periodic_scheduling_works() {
|
||||
Some((3, 3)),
|
||||
127,
|
||||
root(),
|
||||
Call::Logger(logger::Call::log { i: 42, weight: 1000 }).into()
|
||||
Call::Logger(logger::Call::log { i: 42, weight: Weight::from_ref_time(1000) }).into()
|
||||
));
|
||||
run_to_block(3);
|
||||
assert!(logger::log().is_empty());
|
||||
@@ -157,7 +157,7 @@ fn periodic_scheduling_works() {
|
||||
#[test]
|
||||
fn reschedule_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: 1000 });
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) });
|
||||
assert!(!<Test as frame_system::Config>::BaseCallFilter::contains(&call));
|
||||
assert_eq!(
|
||||
Scheduler::do_schedule(DispatchTime::At(4), None, 127, root(), call.into()).unwrap(),
|
||||
@@ -188,7 +188,7 @@ fn reschedule_works() {
|
||||
#[test]
|
||||
fn reschedule_named_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: 1000 });
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) });
|
||||
assert!(!<Test as frame_system::Config>::BaseCallFilter::contains(&call));
|
||||
assert_eq!(
|
||||
Scheduler::do_schedule_named(
|
||||
@@ -230,7 +230,7 @@ fn reschedule_named_works() {
|
||||
#[test]
|
||||
fn reschedule_named_perodic_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: 1000 });
|
||||
let call = Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) });
|
||||
assert!(!<Test as frame_system::Config>::BaseCallFilter::contains(&call));
|
||||
assert_eq!(
|
||||
Scheduler::do_schedule_named(
|
||||
@@ -292,7 +292,7 @@ fn cancel_named_scheduling_works_with_normal_cancel() {
|
||||
None,
|
||||
127,
|
||||
root(),
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into(),
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: Weight::from_ref_time(1000) }).into(),
|
||||
)
|
||||
.unwrap();
|
||||
let i = Scheduler::do_schedule(
|
||||
@@ -300,7 +300,7 @@ fn cancel_named_scheduling_works_with_normal_cancel() {
|
||||
None,
|
||||
127,
|
||||
root(),
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: 1000 }).into(),
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) }).into(),
|
||||
)
|
||||
.unwrap();
|
||||
run_to_block(3);
|
||||
@@ -322,7 +322,7 @@ fn cancel_named_periodic_scheduling_works() {
|
||||
Some((3, 3)),
|
||||
127,
|
||||
root(),
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: 1000 }).into(),
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) }).into(),
|
||||
)
|
||||
.unwrap();
|
||||
// same id results in error.
|
||||
@@ -332,7 +332,7 @@ fn cancel_named_periodic_scheduling_works() {
|
||||
None,
|
||||
127,
|
||||
root(),
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into(),
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: Weight::from_ref_time(1000) }).into(),
|
||||
)
|
||||
.is_err());
|
||||
// different id is ok.
|
||||
@@ -342,7 +342,7 @@ fn cancel_named_periodic_scheduling_works() {
|
||||
None,
|
||||
127,
|
||||
root(),
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into(),
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: Weight::from_ref_time(1000) }).into(),
|
||||
)
|
||||
.unwrap();
|
||||
run_to_block(3);
|
||||
@@ -458,8 +458,11 @@ fn scheduler_respects_priority_ordering_with_soft_deadlines() {
|
||||
None,
|
||||
126,
|
||||
root(),
|
||||
Call::Logger(LoggerCall::log { i: 2600, weight: max_weight / 2 - item_weight + 1 })
|
||||
.into(),
|
||||
Call::Logger(LoggerCall::log {
|
||||
i: 2600,
|
||||
weight: max_weight / 2 - item_weight + Weight::one()
|
||||
})
|
||||
.into(),
|
||||
));
|
||||
|
||||
// 2600 does not fit with 69 or 42, but has higher priority, so will go through
|
||||
@@ -484,7 +487,7 @@ fn on_initialize_weight_is_correct() {
|
||||
None,
|
||||
255,
|
||||
root(),
|
||||
Call::Logger(LoggerCall::log { i: 3, weight: call_weight + 1 }).into(),
|
||||
Call::Logger(LoggerCall::log { i: 3, weight: call_weight + Weight::one() }).into(),
|
||||
));
|
||||
// Anon Periodic
|
||||
assert_ok!(Scheduler::do_schedule(
|
||||
@@ -492,7 +495,8 @@ fn on_initialize_weight_is_correct() {
|
||||
Some((1000, 3)),
|
||||
128,
|
||||
root(),
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: call_weight + 2 }).into(),
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: call_weight + Weight::from_ref_time(2) })
|
||||
.into(),
|
||||
));
|
||||
// Anon
|
||||
assert_ok!(Scheduler::do_schedule(
|
||||
@@ -500,7 +504,8 @@ fn on_initialize_weight_is_correct() {
|
||||
None,
|
||||
127,
|
||||
root(),
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: call_weight + 3 }).into(),
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: call_weight + Weight::from_ref_time(3) })
|
||||
.into(),
|
||||
));
|
||||
// Named Periodic
|
||||
assert_ok!(Scheduler::do_schedule_named(
|
||||
@@ -509,7 +514,11 @@ fn on_initialize_weight_is_correct() {
|
||||
Some((1000, 3)),
|
||||
126,
|
||||
root(),
|
||||
Call::Logger(LoggerCall::log { i: 2600, weight: call_weight + 4 }).into(),
|
||||
Call::Logger(LoggerCall::log {
|
||||
i: 2600,
|
||||
weight: call_weight + Weight::from_ref_time(4)
|
||||
})
|
||||
.into(),
|
||||
));
|
||||
|
||||
// Will include the named periodic only
|
||||
@@ -517,7 +526,8 @@ fn on_initialize_weight_is_correct() {
|
||||
assert_eq!(
|
||||
actual_weight,
|
||||
base_weight +
|
||||
call_weight + 4 + <() as MarginalWeightInfo>::item(true, true, Some(false))
|
||||
call_weight + Weight::from_ref_time(4) +
|
||||
<() as MarginalWeightInfo>::item(true, true, Some(false))
|
||||
);
|
||||
assert_eq!(logger::log(), vec![(root(), 2600u32)]);
|
||||
|
||||
@@ -526,8 +536,10 @@ fn on_initialize_weight_is_correct() {
|
||||
assert_eq!(
|
||||
actual_weight,
|
||||
base_weight +
|
||||
call_weight + 2 + <() as MarginalWeightInfo>::item(false, false, Some(false)) +
|
||||
call_weight + 3 + <() as MarginalWeightInfo>::item(true, false, Some(false))
|
||||
call_weight + Weight::from_ref_time(2) +
|
||||
<() as MarginalWeightInfo>::item(false, false, Some(false)) +
|
||||
call_weight + Weight::from_ref_time(3) +
|
||||
<() as MarginalWeightInfo>::item(true, false, Some(false))
|
||||
);
|
||||
assert_eq!(logger::log(), vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32)]);
|
||||
|
||||
@@ -536,7 +548,8 @@ fn on_initialize_weight_is_correct() {
|
||||
assert_eq!(
|
||||
actual_weight,
|
||||
base_weight +
|
||||
call_weight + 1 + <() as MarginalWeightInfo>::item(false, true, Some(false))
|
||||
call_weight + Weight::from_ref_time(1) +
|
||||
<() as MarginalWeightInfo>::item(false, true, Some(false))
|
||||
);
|
||||
assert_eq!(
|
||||
logger::log(),
|
||||
@@ -552,8 +565,12 @@ fn on_initialize_weight_is_correct() {
|
||||
#[test]
|
||||
fn root_calls_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = Box::new(Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into());
|
||||
let call2 = Box::new(Call::Logger(LoggerCall::log { i: 42, weight: 1000 }).into());
|
||||
let call = Box::new(
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: Weight::from_ref_time(1000) }).into(),
|
||||
);
|
||||
let call2 = Box::new(
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) }).into(),
|
||||
);
|
||||
assert_ok!(Scheduler::schedule_named(Origin::root(), 1u32.encode(), 4, None, 127, call,));
|
||||
assert_ok!(Scheduler::schedule(Origin::root(), 4, None, 127, call2));
|
||||
run_to_block(3);
|
||||
@@ -573,9 +590,15 @@ fn fails_to_schedule_task_in_the_past() {
|
||||
new_test_ext().execute_with(|| {
|
||||
run_to_block(3);
|
||||
|
||||
let call1 = Box::new(Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into());
|
||||
let call2 = Box::new(Call::Logger(LoggerCall::log { i: 42, weight: 1000 }).into());
|
||||
let call3 = Box::new(Call::Logger(LoggerCall::log { i: 42, weight: 1000 }).into());
|
||||
let call1 = Box::new(
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: Weight::from_ref_time(1000) }).into(),
|
||||
);
|
||||
let call2 = Box::new(
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) }).into(),
|
||||
);
|
||||
let call3 = Box::new(
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) }).into(),
|
||||
);
|
||||
|
||||
assert_err!(
|
||||
Scheduler::schedule_named(Origin::root(), 1u32.encode(), 2, None, 127, call1),
|
||||
@@ -597,8 +620,12 @@ fn fails_to_schedule_task_in_the_past() {
|
||||
#[test]
|
||||
fn should_use_orign() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = Box::new(Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into());
|
||||
let call2 = Box::new(Call::Logger(LoggerCall::log { i: 42, weight: 1000 }).into());
|
||||
let call = Box::new(
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: Weight::from_ref_time(1000) }).into(),
|
||||
);
|
||||
let call2 = Box::new(
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) }).into(),
|
||||
);
|
||||
assert_ok!(Scheduler::schedule_named(
|
||||
system::RawOrigin::Signed(1).into(),
|
||||
1u32.encode(),
|
||||
@@ -623,8 +650,12 @@ fn should_use_orign() {
|
||||
#[test]
|
||||
fn should_check_orign() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = Box::new(Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into());
|
||||
let call2 = Box::new(Call::Logger(LoggerCall::log { i: 42, weight: 1000 }).into());
|
||||
let call = Box::new(
|
||||
Call::Logger(LoggerCall::log { i: 69, weight: Weight::from_ref_time(1000) }).into(),
|
||||
);
|
||||
let call2 = Box::new(
|
||||
Call::Logger(LoggerCall::log { i: 42, weight: Weight::from_ref_time(1000) }).into(),
|
||||
);
|
||||
assert_noop!(
|
||||
Scheduler::schedule_named(
|
||||
system::RawOrigin::Signed(2).into(),
|
||||
@@ -646,10 +677,20 @@ fn should_check_orign() {
|
||||
#[test]
|
||||
fn should_check_orign_for_cancel() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call =
|
||||
Box::new(Call::Logger(LoggerCall::log_without_filter { i: 69, weight: 1000 }).into());
|
||||
let call2 =
|
||||
Box::new(Call::Logger(LoggerCall::log_without_filter { i: 42, weight: 1000 }).into());
|
||||
let call = Box::new(
|
||||
Call::Logger(LoggerCall::log_without_filter {
|
||||
i: 69,
|
||||
weight: Weight::from_ref_time(1000),
|
||||
})
|
||||
.into(),
|
||||
);
|
||||
let call2 = Box::new(
|
||||
Call::Logger(LoggerCall::log_without_filter {
|
||||
i: 42,
|
||||
weight: Weight::from_ref_time(1000),
|
||||
})
|
||||
.into(),
|
||||
);
|
||||
assert_ok!(Scheduler::schedule_named(
|
||||
system::RawOrigin::Signed(1).into(),
|
||||
1u32.encode(),
|
||||
@@ -693,14 +734,20 @@ fn migration_to_v3_works() {
|
||||
Some(ScheduledV1 {
|
||||
maybe_id: None,
|
||||
priority: i as u8 + 10,
|
||||
call: Call::Logger(LoggerCall::log { i: 96, weight: 100 }),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 96,
|
||||
weight: Weight::from_ref_time(100),
|
||||
}),
|
||||
maybe_periodic: None,
|
||||
}),
|
||||
None,
|
||||
Some(ScheduledV1 {
|
||||
maybe_id: Some(b"test".to_vec()),
|
||||
priority: 123,
|
||||
call: Call::Logger(LoggerCall::log { i: 69, weight: 1000 }),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 69,
|
||||
weight: Weight::from_ref_time(1000),
|
||||
}),
|
||||
maybe_periodic: Some((456u64, 10)),
|
||||
}),
|
||||
];
|
||||
@@ -718,7 +765,11 @@ fn migration_to_v3_works() {
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: None,
|
||||
priority: 10,
|
||||
call: Call::Logger(LoggerCall::log { i: 96, weight: 100 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 96,
|
||||
weight: Weight::from_ref_time(100)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: None,
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -727,7 +778,11 @@ fn migration_to_v3_works() {
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: Some(b"test".to_vec()),
|
||||
priority: 123,
|
||||
call: Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 69,
|
||||
weight: Weight::from_ref_time(1000)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: Some((456u64, 10)),
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -740,7 +795,11 @@ fn migration_to_v3_works() {
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: None,
|
||||
priority: 11,
|
||||
call: Call::Logger(LoggerCall::log { i: 96, weight: 100 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 96,
|
||||
weight: Weight::from_ref_time(100)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: None,
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -749,7 +808,11 @@ fn migration_to_v3_works() {
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: Some(b"test".to_vec()),
|
||||
priority: 123,
|
||||
call: Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 69,
|
||||
weight: Weight::from_ref_time(1000)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: Some((456u64, 10)),
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -762,7 +825,11 @@ fn migration_to_v3_works() {
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: None,
|
||||
priority: 12,
|
||||
call: Call::Logger(LoggerCall::log { i: 96, weight: 100 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 96,
|
||||
weight: Weight::from_ref_time(100)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: None,
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -771,7 +838,11 @@ fn migration_to_v3_works() {
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: Some(b"test".to_vec()),
|
||||
priority: 123,
|
||||
call: Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 69,
|
||||
weight: Weight::from_ref_time(1000)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: Some((456u64, 10)),
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -794,7 +865,11 @@ fn test_migrate_origin() {
|
||||
Some(Scheduled {
|
||||
maybe_id: None,
|
||||
priority: i as u8 + 10,
|
||||
call: Call::Logger(LoggerCall::log { i: 96, weight: 100 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 96,
|
||||
weight: Weight::from_ref_time(100),
|
||||
})
|
||||
.into(),
|
||||
origin: 3u32,
|
||||
maybe_periodic: None,
|
||||
_phantom: Default::default(),
|
||||
@@ -804,7 +879,11 @@ fn test_migrate_origin() {
|
||||
maybe_id: Some(b"test".to_vec()),
|
||||
priority: 123,
|
||||
origin: 2u32,
|
||||
call: Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 69,
|
||||
weight: Weight::from_ref_time(1000),
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: Some((456u64, 10)),
|
||||
_phantom: Default::default(),
|
||||
}),
|
||||
@@ -833,7 +912,11 @@ fn test_migrate_origin() {
|
||||
Some(ScheduledV2::<CallOrHashOf<Test>, u64, OriginCaller, u64> {
|
||||
maybe_id: None,
|
||||
priority: 10,
|
||||
call: Call::Logger(LoggerCall::log { i: 96, weight: 100 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 96,
|
||||
weight: Weight::from_ref_time(100)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: None,
|
||||
origin: system::RawOrigin::Root.into(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -842,7 +925,11 @@ fn test_migrate_origin() {
|
||||
Some(ScheduledV2 {
|
||||
maybe_id: Some(b"test".to_vec()),
|
||||
priority: 123,
|
||||
call: Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 69,
|
||||
weight: Weight::from_ref_time(1000)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: Some((456u64, 10)),
|
||||
origin: system::RawOrigin::None.into(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -855,7 +942,11 @@ fn test_migrate_origin() {
|
||||
Some(ScheduledV2 {
|
||||
maybe_id: None,
|
||||
priority: 11,
|
||||
call: Call::Logger(LoggerCall::log { i: 96, weight: 100 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 96,
|
||||
weight: Weight::from_ref_time(100)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: None,
|
||||
origin: system::RawOrigin::Root.into(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -864,7 +955,11 @@ fn test_migrate_origin() {
|
||||
Some(ScheduledV2 {
|
||||
maybe_id: Some(b"test".to_vec()),
|
||||
priority: 123,
|
||||
call: Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 69,
|
||||
weight: Weight::from_ref_time(1000)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: Some((456u64, 10)),
|
||||
origin: system::RawOrigin::None.into(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -877,7 +972,11 @@ fn test_migrate_origin() {
|
||||
Some(ScheduledV2 {
|
||||
maybe_id: None,
|
||||
priority: 12,
|
||||
call: Call::Logger(LoggerCall::log { i: 96, weight: 100 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 96,
|
||||
weight: Weight::from_ref_time(100)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: None,
|
||||
origin: system::RawOrigin::Root.into(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
@@ -886,7 +985,11 @@ fn test_migrate_origin() {
|
||||
Some(ScheduledV2 {
|
||||
maybe_id: Some(b"test".to_vec()),
|
||||
priority: 123,
|
||||
call: Call::Logger(LoggerCall::log { i: 69, weight: 1000 }).into(),
|
||||
call: Call::Logger(LoggerCall::log {
|
||||
i: 69,
|
||||
weight: Weight::from_ref_time(1000)
|
||||
})
|
||||
.into(),
|
||||
maybe_periodic: Some((456u64, 10)),
|
||||
origin: system::RawOrigin::None.into(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use frame_support::{traits::Get, weights::{RefTimeWeight, Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions needed for pallet_scheduler.
|
||||
@@ -68,146 +68,146 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Storage: Preimage StatusFor (r:1 w:1)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {
|
||||
(9_994_000 as Weight)
|
||||
Weight::from_ref_time(9_994_000 as RefTimeWeight)
|
||||
// Standard Error: 20_000
|
||||
.saturating_add((19_843_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(19_843_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads((3 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((4 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
// Storage: Preimage PreimageFor (r:1 w:1)
|
||||
// Storage: Preimage StatusFor (r:1 w:1)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn on_initialize_named_resolved(s: u32, ) -> Weight {
|
||||
(10_318_000 as Weight)
|
||||
Weight::from_ref_time(10_318_000 as RefTimeWeight)
|
||||
// Standard Error: 17_000
|
||||
.saturating_add((15_451_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(15_451_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads((2 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((3 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:2 w:2)
|
||||
// Storage: Preimage PreimageFor (r:1 w:1)
|
||||
// Storage: Preimage StatusFor (r:1 w:1)
|
||||
fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
|
||||
(11_675_000 as Weight)
|
||||
Weight::from_ref_time(11_675_000 as RefTimeWeight)
|
||||
// Standard Error: 17_000
|
||||
.saturating_add((17_019_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(17_019_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads((3 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((3 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
// Storage: Preimage PreimageFor (r:1 w:1)
|
||||
// Storage: Preimage StatusFor (r:1 w:1)
|
||||
fn on_initialize_resolved(s: u32, ) -> Weight {
|
||||
(11_934_000 as Weight)
|
||||
Weight::from_ref_time(11_934_000 as RefTimeWeight)
|
||||
// Standard Error: 11_000
|
||||
.saturating_add((14_134_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(14_134_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads((2 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((2 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:2 w:2)
|
||||
// Storage: Preimage PreimageFor (r:1 w:0)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn on_initialize_named_aborted(s: u32, ) -> Weight {
|
||||
(7_279_000 as Weight)
|
||||
Weight::from_ref_time(7_279_000 as RefTimeWeight)
|
||||
// Standard Error: 5_000
|
||||
.saturating_add((5_388_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(5_388_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:2 w:2)
|
||||
// Storage: Preimage PreimageFor (r:1 w:0)
|
||||
fn on_initialize_aborted(s: u32, ) -> Weight {
|
||||
(8_619_000 as Weight)
|
||||
Weight::from_ref_time(8_619_000 as RefTimeWeight)
|
||||
// Standard Error: 4_000
|
||||
.saturating_add((2_969_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(2_969_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:2 w:2)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn on_initialize_periodic_named(s: u32, ) -> Weight {
|
||||
(16_129_000 as Weight)
|
||||
Weight::from_ref_time(16_129_000 as RefTimeWeight)
|
||||
// Standard Error: 7_000
|
||||
.saturating_add((9_772_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(9_772_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((2 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:2 w:2)
|
||||
fn on_initialize_periodic(s: u32, ) -> Weight {
|
||||
(15_785_000 as Weight)
|
||||
Weight::from_ref_time(15_785_000 as RefTimeWeight)
|
||||
// Standard Error: 5_000
|
||||
.saturating_add((7_208_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(7_208_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn on_initialize_named(s: u32, ) -> Weight {
|
||||
(15_778_000 as Weight)
|
||||
Weight::from_ref_time(15_778_000 as RefTimeWeight)
|
||||
// Standard Error: 3_000
|
||||
.saturating_add((5_597_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(5_597_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
fn on_initialize(s: u32, ) -> Weight {
|
||||
(15_912_000 as Weight)
|
||||
Weight::from_ref_time(15_912_000 as RefTimeWeight)
|
||||
// Standard Error: 5_000
|
||||
.saturating_add((4_530_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(4_530_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
fn schedule(s: u32, ) -> Weight {
|
||||
(18_013_000 as Weight)
|
||||
Weight::from_ref_time(18_013_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((87_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(87_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn cancel(s: u32, ) -> Weight {
|
||||
(18_131_000 as Weight)
|
||||
Weight::from_ref_time(18_131_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((595_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(595_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Scheduler Lookup (r:1 w:1)
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
fn schedule_named(s: u32, ) -> Weight {
|
||||
(21_230_000 as Weight)
|
||||
Weight::from_ref_time(21_230_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((98_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(98_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Scheduler Lookup (r:1 w:1)
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
fn cancel_named(s: u32, ) -> Weight {
|
||||
(20_139_000 as Weight)
|
||||
Weight::from_ref_time(20_139_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((595_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(595_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,145 +218,145 @@ impl WeightInfo for () {
|
||||
// Storage: Preimage StatusFor (r:1 w:1)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {
|
||||
(9_994_000 as Weight)
|
||||
Weight::from_ref_time(9_994_000 as RefTimeWeight)
|
||||
// Standard Error: 20_000
|
||||
.saturating_add((19_843_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(19_843_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads((3 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((4 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
// Storage: Preimage PreimageFor (r:1 w:1)
|
||||
// Storage: Preimage StatusFor (r:1 w:1)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn on_initialize_named_resolved(s: u32, ) -> Weight {
|
||||
(10_318_000 as Weight)
|
||||
Weight::from_ref_time(10_318_000 as RefTimeWeight)
|
||||
// Standard Error: 17_000
|
||||
.saturating_add((15_451_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(15_451_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads((2 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((3 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:2 w:2)
|
||||
// Storage: Preimage PreimageFor (r:1 w:1)
|
||||
// Storage: Preimage StatusFor (r:1 w:1)
|
||||
fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
|
||||
(11_675_000 as Weight)
|
||||
Weight::from_ref_time(11_675_000 as RefTimeWeight)
|
||||
// Standard Error: 17_000
|
||||
.saturating_add((17_019_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(17_019_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads((3 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((3 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
// Storage: Preimage PreimageFor (r:1 w:1)
|
||||
// Storage: Preimage StatusFor (r:1 w:1)
|
||||
fn on_initialize_resolved(s: u32, ) -> Weight {
|
||||
(11_934_000 as Weight)
|
||||
Weight::from_ref_time(11_934_000 as RefTimeWeight)
|
||||
// Standard Error: 11_000
|
||||
.saturating_add((14_134_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(14_134_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads((2 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((2 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:2 w:2)
|
||||
// Storage: Preimage PreimageFor (r:1 w:0)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn on_initialize_named_aborted(s: u32, ) -> Weight {
|
||||
(7_279_000 as Weight)
|
||||
Weight::from_ref_time(7_279_000 as RefTimeWeight)
|
||||
// Standard Error: 5_000
|
||||
.saturating_add((5_388_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(5_388_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:2 w:2)
|
||||
// Storage: Preimage PreimageFor (r:1 w:0)
|
||||
fn on_initialize_aborted(s: u32, ) -> Weight {
|
||||
(8_619_000 as Weight)
|
||||
Weight::from_ref_time(8_619_000 as RefTimeWeight)
|
||||
// Standard Error: 4_000
|
||||
.saturating_add((2_969_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(2_969_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:2 w:2)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn on_initialize_periodic_named(s: u32, ) -> Weight {
|
||||
(16_129_000 as Weight)
|
||||
Weight::from_ref_time(16_129_000 as RefTimeWeight)
|
||||
// Standard Error: 7_000
|
||||
.saturating_add((9_772_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(9_772_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((2 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:2 w:2)
|
||||
fn on_initialize_periodic(s: u32, ) -> Weight {
|
||||
(15_785_000 as Weight)
|
||||
Weight::from_ref_time(15_785_000 as RefTimeWeight)
|
||||
// Standard Error: 5_000
|
||||
.saturating_add((7_208_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(7_208_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn on_initialize_named(s: u32, ) -> Weight {
|
||||
(15_778_000 as Weight)
|
||||
Weight::from_ref_time(15_778_000 as RefTimeWeight)
|
||||
// Standard Error: 3_000
|
||||
.saturating_add((5_597_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
|
||||
.saturating_add(Weight::from_ref_time(5_597_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((1 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
fn on_initialize(s: u32, ) -> Weight {
|
||||
(15_912_000 as Weight)
|
||||
Weight::from_ref_time(15_912_000 as RefTimeWeight)
|
||||
// Standard Error: 5_000
|
||||
.saturating_add((4_530_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(4_530_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
fn schedule(s: u32, ) -> Weight {
|
||||
(18_013_000 as Weight)
|
||||
Weight::from_ref_time(18_013_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((87_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(87_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
// Storage: Scheduler Lookup (r:0 w:1)
|
||||
fn cancel(s: u32, ) -> Weight {
|
||||
(18_131_000 as Weight)
|
||||
Weight::from_ref_time(18_131_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((595_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(595_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Scheduler Lookup (r:1 w:1)
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
fn schedule_named(s: u32, ) -> Weight {
|
||||
(21_230_000 as Weight)
|
||||
Weight::from_ref_time(21_230_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((98_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(98_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Scheduler Lookup (r:1 w:1)
|
||||
// Storage: Scheduler Agenda (r:1 w:1)
|
||||
fn cancel_named(s: u32, ) -> Weight {
|
||||
(20_139_000 as Weight)
|
||||
Weight::from_ref_time(20_139_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((595_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(595_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user