difftreelog
Merge pull request #376 from UniqueNetwork/fix/scheduler-benchmarks
in: master
Fix/scheduler benchmarks
14 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5356,7 +5356,7 @@
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-unique",
- "pallet-unq-scheduler",
+ "pallet-unique-scheduler",
"pallet-xcm",
"parachain-info",
"parity-scale-codec 3.1.2",
@@ -6646,7 +6646,7 @@
]
[[package]]
-name = "pallet-unq-scheduler"
+name = "pallet-unique-scheduler"
version = "0.1.0"
dependencies = [
"frame-benchmarking",
@@ -8590,7 +8590,7 @@
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-unique",
- "pallet-unq-scheduler",
+ "pallet-unique-scheduler",
"pallet-xcm",
"parachain-info",
"parity-scale-codec 3.1.2",
@@ -12643,7 +12643,7 @@
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-unique",
- "pallet-unq-scheduler",
+ "pallet-unique-scheduler",
"pallet-xcm",
"parachain-info",
"parity-scale-codec 3.1.2",
@@ -12688,6 +12688,7 @@
"pallet-nonfungible",
"pallet-refungible",
"pallet-unique",
+ "pallet-unique-scheduler",
"parity-scale-codec 3.1.2",
"rmrk-rpc",
"scale-info",
Makefilediffbeforeafterboth--- a/Makefile
+++ b/Makefile
@@ -65,6 +65,14 @@
--template .maintain/frame-weight-template.hbs --steps=50 --repeat=200 --heap-pages=4096 \
--output=./pallets/$(PALLET)/src/weights.rs
+.PHONY: _bench2
+_bench2:
+ cargo run --release --features runtime-benchmarks,unique-runtime -- \
+ benchmark pallet --pallet pallet-$(PALLET) \
+ --wasm-execution compiled --extrinsic '*' \
+ --template .maintain/frame-weight-template.hbs --steps=50 --repeat=200 --heap-pages=4096 \
+ --output=./pallets/$(PALLET_DIR)/src/weights.rs
+
.PHONY: bench-evm-migration
bench-evm-migration:
make _bench PALLET=evm-migration
@@ -93,9 +101,13 @@
bench-structure:
make _bench PALLET=structure
+.PHONY: bench-scheduler
+bench-scheduler:
+ make _bench2 PALLET=unique-scheduler PALLET_DIR=scheduler
+
.PHONY: bench-rmrk-core
bench-rmrk-core:
make _bench PALLET=proxy-rmrk-core
.PHONY: bench
-bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-rmrk-core
+bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core
pallets/scheduler/Cargo.tomldiffbeforeafterboth--- a/pallets/scheduler/Cargo.toml
+++ b/pallets/scheduler/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "pallet-unq-scheduler"
+name = "pallet-unique-scheduler"
version = "0.1.0"
authors = ["Unique Network <support@uniquenetwork.io>"]
edition = "2021"
pallets/scheduler/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/scheduler/src/benchmarking.rs
+++ b/pallets/scheduler/src/benchmarking.rs
@@ -34,35 +34,57 @@
//! Scheduler pallet benchmarking.
-#![cfg(feature = "runtime-benchmarks")]
-
use super::*;
-use sp_std::{vec, prelude::*};
+use frame_benchmarking::{benchmarks, account};
+use frame_support::{
+ ensure,
+ traits::{OnInitialize},
+};
use frame_system::RawOrigin;
-use frame_support::{ensure, traits::OnInitialize};
-use frame_benchmarking::{benchmarks, impl_benchmark_test_suite};
+use sp_runtime::traits::Hash;
+use sp_std::{prelude::*, vec};
-use crate::Module as Scheduler;
+use crate::Pallet as Scheduler;
use frame_system::Pallet as System;
+use frame_support::traits::Currency;
const BLOCK_NUMBER: u32 = 2;
-// Add `n` named items to the schedule
-fn fill_schedule<T: Config>(when: T::BlockNumber, n: u32) -> Result<(), &'static str> {
- // Essentially a no-op call.
- let call = frame_system::Call::set_storage { items: vec![] };
+/// Add `n` named items to the schedule.
+///
+/// For `resolved`:
+/// - `None`: aborted (hash without preimage)
+/// - `Some(true)`: hash resolves into call if possible, plain call otherwise
+/// - `Some(false)`: plain call
+fn fill_schedule<T: Config>(
+ when: T::BlockNumber,
+ n: u32,
+ periodic: bool,
+ resolved: Option<bool>,
+) -> Result<(), &'static str> {
+ let t = DispatchTime::At(when);
+ let caller = account("user", 0, 1);
+
+ // Give the sender account max funds for transfer (their account will never reasonably be killed).
+ T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance());
+
for i in 0..n {
- // Named schedule is strictly heavier than anonymous
- Scheduler::<T>::do_schedule_named(
- i.encode(),
- DispatchTime::At(when),
- // Add periodicity
- Some((T::BlockNumber::one(), 100)),
- // HARD_DEADLINE priority means it gets executed no matter what
- 0,
- frame_system::RawOrigin::Root.into(),
- call.clone().into(),
- )?;
+ let (call, hash) = call_and_hash::<T>(i);
+ let call_or_hash = match resolved {
+ Some(_) => call.into(),
+ None => CallOrHashOf::<T>::Hash(hash),
+ };
+ let period = match periodic {
+ true => Some(((i + 100).into(), 100)),
+ false => None,
+ };
+
+ let slice_id: [u8; 4] = i.encode().try_into().unwrap();
+ let mut id: [u8; 16] = [0; 16];
+ id[..4].clone_from_slice(&slice_id);
+
+ let origin = frame_system::RawOrigin::Signed(caller.clone()).into();
+ Scheduler::<T>::do_schedule_named(id, t, period, 0, origin, call_or_hash)?;
}
ensure!(
Agenda::<T>::get(when).len() == n as usize,
@@ -71,54 +93,121 @@
Ok(())
}
+fn call_and_hash<T: Config>(i: u32) -> (<T as Config>::Call, T::Hash) {
+ // Essentially a no-op call.
+ let call: <T as Config>::Call = frame_system::Call::remark { remark: i.encode() }.into();
+ let hash = T::Hashing::hash_of(&call);
+ (call, hash)
+}
+
benchmarks! {
- schedule {
- let s in 0 .. T::MaxScheduledPerBlock::get();
+ on_initialize_periodic_named_resolved {
+ let s in 1 .. T::MaxScheduledPerBlock::get();
let when = BLOCK_NUMBER.into();
- let periodic = Some((T::BlockNumber::one(), 100));
- let priority = 0;
- // Essentially a no-op call.
- let call = Box::new(frame_system::Call::set_storage { items: vec![] }.into());
+ fill_schedule::<T>(when, s, true, Some(true))?;
+ }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+ verify {
+ assert_eq!(System::<T>::event_count(), s);
+ for i in 0..s {
+ assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
+ }
+ }
- fill_schedule::<T>(when, s)?;
- }: _(RawOrigin::Root, when, periodic, priority, call)
+ on_initialize_named_resolved {
+ let s in 1 .. T::MaxScheduledPerBlock::get();
+ let when = BLOCK_NUMBER.into();
+ fill_schedule::<T>(when, s, false, Some(true))?;
+ }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
verify {
- ensure!(
- Agenda::<T>::get(when).len() == (s + 1) as usize,
- "didn't add to schedule"
- );
+ assert_eq!(System::<T>::event_count(), s);
+ assert!(Agenda::<T>::iter().count() == 0);
}
- cancel {
+ on_initialize_periodic {
let s in 1 .. T::MaxScheduledPerBlock::get();
let when = BLOCK_NUMBER.into();
+ fill_schedule::<T>(when, s, true, Some(false))?;
+ }: { Scheduler::<T>::on_initialize(when); }
+ verify {
+ assert_eq!(System::<T>::event_count(), s);
+ for i in 0..s {
+ assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
+ }
+ }
- fill_schedule::<T>(when, s)?;
- assert_eq!(Agenda::<T>::get(when).len(), s as usize);
- }: _(RawOrigin::Root, when, 0)
+ on_initialize_periodic_resolved {
+ let s in 1 .. T::MaxScheduledPerBlock::get();
+ let when = BLOCK_NUMBER.into();
+ fill_schedule::<T>(when, s, true, Some(true))?;
+ }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
verify {
- ensure!(
- Lookup::<T>::get(0.encode()).is_none(),
- "didn't remove from lookup"
- );
- // Removed schedule is NONE
- ensure!(
- Agenda::<T>::get(when)[0].is_none(),
- "didn't remove from schedule"
- );
+ assert_eq!(System::<T>::event_count(), s );
+ for i in 0..s {
+ assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
+ }
}
+ on_initialize_aborted {
+ let s in 1 .. T::MaxScheduledPerBlock::get();
+ let when = BLOCK_NUMBER.into();
+ fill_schedule::<T>(when, s, false, None)?;
+ }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+ verify {
+ assert_eq!(System::<T>::event_count(), 0);
+ }
+
+ on_initialize_named_aborted {
+ let s in 1 .. T::MaxScheduledPerBlock::get();
+ let when = BLOCK_NUMBER.into();
+ fill_schedule::<T>(when, s, false, Some(false))?;
+ }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+ verify {
+ }
+
+ on_initialize_named {
+ let s in 1 .. T::MaxScheduledPerBlock::get();
+ let when = BLOCK_NUMBER.into();
+ fill_schedule::<T>(when, s, false, None)?;
+ }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+ verify {
+ assert_eq!(System::<T>::event_count(), 0);
+ }
+
+ on_initialize {
+ let s in 1 .. T::MaxScheduledPerBlock::get();
+ let when = BLOCK_NUMBER.into();
+ fill_schedule::<T>(when, s, false, Some(false))?;
+ }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+ verify {
+ assert_eq!(System::<T>::event_count(), s);
+ assert!(Agenda::<T>::iter().count() == 0);
+ }
+
+ on_initialize_resolved {
+ let s in 1 .. T::MaxScheduledPerBlock::get();
+ let when = BLOCK_NUMBER.into();
+ fill_schedule::<T>(when, s, false, Some(true))?;
+ }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+ verify {
+ assert_eq!(System::<T>::event_count(), s);
+ assert!(Agenda::<T>::iter().count() == 0);
+ }
+
schedule_named {
+ let caller: T::AccountId = account("user", 0, 1);
+ let origin: RawOrigin<T::AccountId> = frame_system::RawOrigin::Signed(caller.clone());
let s in 0 .. T::MaxScheduledPerBlock::get();
- let id = s.encode();
+ let slice_id: [u8; 4] = s.encode().try_into().unwrap();
+ let mut id: [u8; 16] = [0; 16];
+ id[..4].clone_from_slice(&slice_id);
let when = BLOCK_NUMBER.into();
let periodic = Some((T::BlockNumber::one(), 100));
let priority = 0;
// Essentially a no-op call.
- let call = Box::new(frame_system::Call::set_storage { items: vec![] }.into());
-
- fill_schedule::<T>(when, s)?;
- }: _(RawOrigin::Root, id, when, periodic, priority, call)
+ let inner_call = frame_system::Call::set_storage { items: vec![] }.into();
+ let call = Box::new(CallOrHashOf::<T>::Value(inner_call));
+ fill_schedule::<T>(when, s, true, Some(false))?;
+ }: _(origin, id, when, periodic, priority, call)
verify {
ensure!(
Agenda::<T>::get(when).len() == (s + 1) as usize,
@@ -127,14 +216,16 @@
}
cancel_named {
+ let caller: T::AccountId = account("user", 0, 1);
+ let origin: RawOrigin<T::AccountId> = frame_system::RawOrigin::Signed(caller.clone());
let s in 1 .. T::MaxScheduledPerBlock::get();
let when = BLOCK_NUMBER.into();
-
- fill_schedule::<T>(when, s)?;
- }: _(RawOrigin::Root, 0.encode())
+ let id = 0.encode().try_into().unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
+ fill_schedule::<T>(when, s, true, Some(false))?;
+ }: _(origin, id)
verify {
ensure!(
- Lookup::<T>::get(0.encode()).is_none(),
+ Lookup::<T>::get(id).is_none(),
"didn't remove from lookup"
);
// Removed schedule is NONE
@@ -144,21 +235,5 @@
);
}
- // TODO [#7141]: Make this more complex and flexible so it can be used in automation.
- #[extra]
- on_initialize {
- let s in 0 .. T::MaxScheduledPerBlock::get();
- let when = BLOCK_NUMBER.into();
- fill_schedule::<T>(when, s)?;
- }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
- verify {
- assert_eq!(System::<T>::event_count(), s);
- // Next block should have all the schedules again
- ensure!(
- Agenda::<T>::get(when + T::BlockNumber::one()).len() == s as usize,
- "didn't append schedule"
- );
- }
+ impl_benchmark_test_suite!(Scheduler, crate::mock::new_test_ext(), crate::mock::Test);
}
-
-impl_benchmark_test_suite!(Scheduler, crate::tests::new_test_ext(), crate::tests::Test,);
pallets/scheduler/src/lib.rsdiffbeforeafterboth--- a/pallets/scheduler/src/lib.rs
+++ b/pallets/scheduler/src/lib.rs
@@ -60,9 +60,8 @@
// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
-// FIXME
-// #[cfg(feature = "runtime-benchmarks")]
-// mod benchmarking;
+#[cfg(feature = "runtime-benchmarks")]
+mod benchmarking;
pub mod weights;
@@ -159,11 +158,10 @@
Self::on_initialize_periodic(2) - Self::on_initialize_periodic(1)
}
(true, true, Some(false)) => {
- Self::on_initialize_periodic_named(2) - Self::on_initialize_periodic_named(1)
- }
- (false, false, Some(true)) => {
- Self::on_initialize_resolved(2) - Self::on_initialize_resolved(1)
+ Self::on_initialize_periodic_named_resolved(2)
+ - Self::on_initialize_periodic_named_resolved(1)
}
+ (false, false, Some(true)) => Self::on_initialize(2) - Self::on_initialize(1),
(false, true, Some(true)) => {
Self::on_initialize_named_resolved(2) - Self::on_initialize_named_resolved(1)
}
@@ -608,97 +606,8 @@
}
Ok(when)
- }
-
- fn do_schedule(
- when: DispatchTime<T::BlockNumber>,
- maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
- priority: schedule::Priority,
- origin: T::PalletsOrigin,
- call: CallOrHashOf<T>,
- ) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
- let when = Self::resolve_time(when)?;
- call.ensure_requested::<T::PreimageProvider>();
-
- // sanitize maybe_periodic
- let maybe_periodic = maybe_periodic
- .filter(|p| p.1 > 1 && !p.0.is_zero())
- // Remove one from the number of repetitions since we will schedule one now.
- .map(|(p, c)| (p, c - 1));
- let s = Some(Scheduled {
- maybe_id: None,
- priority,
- call,
- maybe_periodic,
- origin,
- _phantom: PhantomData::<T::AccountId>::default(),
- });
- Agenda::<T>::append(when, s);
- let index = Agenda::<T>::decode_len(when).unwrap_or(1) as u32 - 1;
- Self::deposit_event(Event::Scheduled { when, index });
-
- Ok((when, index))
}
- fn do_cancel(
- origin: Option<T::PalletsOrigin>,
- (when, index): TaskAddress<T::BlockNumber>,
- ) -> Result<(), DispatchError> {
- let scheduled = Agenda::<T>::try_mutate(when, |agenda| {
- agenda.get_mut(index as usize).map_or(
- Ok(None),
- |s| -> Result<Option<Scheduled<_, _, _, _>>, DispatchError> {
- if let (Some(ref o), Some(ref s)) = (origin, s.borrow()) {
- if matches!(
- T::OriginPrivilegeCmp::cmp_privilege(o, &s.origin),
- Some(Ordering::Less) | None
- ) {
- return Err(BadOrigin.into());
- }
- };
- Ok(s.take())
- },
- )
- })?;
- if let Some(s) = scheduled {
- s.call.ensure_unrequested::<T::PreimageProvider>();
- if let Some(id) = s.maybe_id {
- Lookup::<T>::remove(id);
- }
- Self::deposit_event(Event::Canceled { when, index });
- Ok(())
- } else {
- Err(Error::<T>::NotFound)?
- }
- }
-
- fn do_reschedule(
- (when, index): TaskAddress<T::BlockNumber>,
- new_time: DispatchTime<T::BlockNumber>,
- ) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
- let new_time = Self::resolve_time(new_time)?;
-
- if new_time == when {
- return Err(Error::<T>::RescheduleNoChange.into());
- }
-
- Agenda::<T>::try_mutate(when, |agenda| -> DispatchResult {
- let task = agenda.get_mut(index as usize).ok_or(Error::<T>::NotFound)?;
- let task = task.take().ok_or(Error::<T>::NotFound)?;
- Agenda::<T>::append(new_time, Some(task));
- Ok(())
- })?;
-
- let new_index = Agenda::<T>::decode_len(new_time).unwrap_or(1) as u32 - 1;
- Self::deposit_event(Event::Canceled { when, index });
- Self::deposit_event(Event::Scheduled {
- when: new_time,
- index: new_index,
- });
-
- Ok((new_time, new_index))
- }
-
fn do_schedule_named(
id: ScheduledId,
when: DispatchTime<T::BlockNumber>,
@@ -789,125 +698,5 @@
Err(Error::<T>::NotFound)?
}
})
- }
-
- fn do_reschedule_named(
- id: ScheduledId,
- new_time: DispatchTime<T::BlockNumber>,
- ) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
- let new_time = Self::resolve_time(new_time)?;
-
- Lookup::<T>::try_mutate_exists(
- id,
- |lookup| -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
- let (when, index) = lookup.ok_or(Error::<T>::NotFound)?;
-
- if new_time == when {
- return Err(Error::<T>::RescheduleNoChange.into());
- }
-
- Agenda::<T>::try_mutate(when, |agenda| -> DispatchResult {
- let task = agenda.get_mut(index as usize).ok_or(Error::<T>::NotFound)?;
- let task = task.take().ok_or(Error::<T>::NotFound)?;
- Agenda::<T>::append(new_time, Some(task));
-
- Ok(())
- })?;
-
- let new_index = Agenda::<T>::decode_len(new_time).unwrap_or(1) as u32 - 1;
- Self::deposit_event(Event::Canceled { when, index });
- Self::deposit_event(Event::Scheduled {
- when: new_time,
- index: new_index,
- });
-
- *lookup = Some((new_time, new_index));
-
- Ok((new_time, new_index))
- },
- )
- }
-}
-
-impl<T: Config> schedule::v2::Anon<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin>
- for Pallet<T>
-{
- type Address = TaskAddress<T::BlockNumber>;
- type Hash = T::Hash;
-
- fn schedule(
- when: DispatchTime<T::BlockNumber>,
- maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
- priority: schedule::Priority,
- origin: T::PalletsOrigin,
- call: CallOrHashOf<T>,
- ) -> Result<Self::Address, DispatchError> {
- Self::do_schedule(when, maybe_periodic, priority, origin, call)
- }
-
- fn cancel((when, index): Self::Address) -> Result<(), ()> {
- Self::do_cancel(None, (when, index)).map_err(|_| ())
- }
-
- fn reschedule(
- address: Self::Address,
- when: DispatchTime<T::BlockNumber>,
- ) -> Result<Self::Address, DispatchError> {
- Self::do_reschedule(address, when)
- }
-
- fn next_dispatch_time((when, index): Self::Address) -> Result<T::BlockNumber, ()> {
- Agenda::<T>::get(when)
- .get(index as usize)
- .ok_or(())
- .map(|_| when)
- }
-}
-
-impl<T: Config> schedule::v2::Named<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin>
- for Pallet<T>
-{
- type Address = TaskAddress<T::BlockNumber>;
- type Hash = T::Hash;
-
- fn schedule_named(
- id: Vec<u8>,
- when: DispatchTime<T::BlockNumber>,
- maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
- priority: schedule::Priority,
- origin: T::PalletsOrigin,
- call: CallOrHashOf<T>,
- ) -> Result<Self::Address, ()> {
- let inner_id: ScheduledId = id
- .try_into()
- .unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
- Self::do_schedule_named(inner_id, when, maybe_periodic, priority, origin, call)
- .map_err(|_| ())
- }
-
- fn cancel_named(id: Vec<u8>) -> Result<(), ()> {
- let inner_id: ScheduledId = id
- .try_into()
- .unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
- Self::do_cancel_named(None, inner_id).map_err(|_| ())
- }
-
- fn reschedule_named(
- id: Vec<u8>,
- when: DispatchTime<T::BlockNumber>,
- ) -> Result<Self::Address, DispatchError> {
- let inner_id: ScheduledId = id
- .try_into()
- .unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
- Self::do_reschedule_named(inner_id, when)
- }
-
- fn next_dispatch_time(id: Vec<u8>) -> Result<T::BlockNumber, ()> {
- let inner_id: ScheduledId = id
- .try_into()
- .unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
- Lookup::<T>::get(inner_id)
- .and_then(|(when, index)| Agenda::<T>::get(when).get(index as usize).map(|_| when))
- .ok_or(())
}
}
pallets/scheduler/src/weights.rsdiffbeforeafterboth1// This file is part of Substrate.1// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs223// Copyright (C) 2022 Parity Technologies (UK) Ltd.3//! Autogenerated weights for pallet_unique_scheduler4// SPDX-License-Identifier: Apache-2.056// Licensed under the Apache License, Version 2.0 (the "License");7// you may not use this file except in compliance with the License.8// You may obtain a copy of the License at9//10// http://www.apache.org/licenses/LICENSE-2.011//12// Unless required by applicable law or agreed to in writing, software13// distributed under the License is distributed on an "AS IS" BASIS,14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15// See the License for the specific language governing permissions and16// limitations under the License.1718//! Autogenerated weights for pallet_scheduler19//!4//!20//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev21//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`6//! DATE: 2022-06-09, STEPS: `50`, REPEAT: 200, LOW RANGE: `[]`, HIGH RANGE: `[]`22//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 10247//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 102423824// Executed Command:9// Executed Command:25// ./target/production/substrate10// target/release/unique-collator26// benchmark11// benchmark27// --chain=dev12// pallet13// --pallet14// pallet-unique-scheduler15// --wasm-execution16// compiled17// --extrinsic18// *19// --template20// .maintain/frame-weight-template.hbs28// --steps=5021// --steps=5029// --repeat=2022// --repeat=20030// --pallet=pallet_scheduler31// --extrinsic=*32// --execution=wasm33// --wasm-execution=compiled34// --heap-pages=409623// --heap-pages=409635// --output=./frame/scheduler/src/weights.rs24// --output=./pallets/scheduler/src/weights.rs36// --template=.maintain/frame-weight-template.hbs37// --header=HEADER-APACHE238// --raw392540#![cfg_attr(rustfmt, rustfmt_skip)]26#![cfg_attr(rustfmt, rustfmt_skip)]41#![allow(unused_parens)]27#![allow(unused_parens)]42#![allow(unused_imports)]28#![allow(unused_imports)]29#![allow(clippy::unnecessary_cast)]433044use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};31use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};45use sp_std::marker::PhantomData;32use sp_std::marker::PhantomData;463347/// Weight functions needed for pallet_scheduler.34/// Weight functions needed for pallet_unique_scheduler.48pub trait WeightInfo {35pub trait WeightInfo {49 fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight;36 fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight;50 fn on_initialize_named_resolved(s: u32, ) -> Weight;37 fn on_initialize_named_resolved(s: u32, ) -> Weight;38 fn on_initialize_periodic(s: u32, ) -> Weight;51 fn on_initialize_periodic_resolved(s: u32, ) -> Weight;39 fn on_initialize_periodic_resolved(s: u32, ) -> Weight;52 fn on_initialize_resolved(s: u32, ) -> Weight;53 fn on_initialize_named_aborted(s: u32, ) -> Weight;54 fn on_initialize_aborted(s: u32, ) -> Weight;40 fn on_initialize_aborted(s: u32, ) -> Weight;55 fn on_initialize_periodic_named(s: u32, ) -> Weight;41 fn on_initialize_named_aborted(s: u32, ) -> Weight;56 fn on_initialize_periodic(s: u32, ) -> Weight;57 fn on_initialize_named(s: u32, ) -> Weight;42 fn on_initialize_named(s: u32, ) -> Weight;58 fn on_initialize(s: u32, ) -> Weight;43 fn on_initialize(s: u32, ) -> Weight;59 fn schedule(s: u32, ) -> Weight;44 fn on_initialize_resolved(s: u32, ) -> Weight;60 fn cancel(s: u32, ) -> Weight;61 fn schedule_named(s: u32, ) -> Weight;45 fn schedule_named(s: u32, ) -> Weight;62 fn cancel_named(s: u32, ) -> Weight;46 fn cancel_named(s: u32, ) -> Weight;63}47}644865/// Weights for pallet_scheduler using the Substrate node and recommended hardware.49/// Weights for pallet_unique_scheduler using the Substrate node and recommended hardware.66pub struct SubstrateWeight<T>(PhantomData<T>);50pub struct SubstrateWeight<T>(PhantomData<T>);67impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {51impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {68 // Storage: Scheduler Agenda (r:2 w:2)52 // Storage: Scheduler Agenda (r:2 w:2)69 // Storage: Preimage PreimageFor (r:1 w:1)53 // Storage: System Account (r:1 w:1)70 // Storage: Preimage StatusFor (r:1 w:1)54 // Storage: System AllExtrinsicsLen (r:1 w:1)55 // Storage: System BlockWeight (r:1 w:1)71 // Storage: Scheduler Lookup (r:0 w:1)56 // Storage: Scheduler Lookup (r:0 w:1)72 fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {57 fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {73 (11_587_000 as Weight)58 (35_999_000 as Weight)74 // Standard Error: 17_00059 // Standard Error: 3_00075 .saturating_add((17_428_000 as Weight).saturating_mul(s as Weight))60 .saturating_add((32_234_000 as Weight).saturating_mul(s as Weight))76 .saturating_add(T::DbWeight::get().reads(1 as Weight))61 .saturating_add(T::DbWeight::get().reads(4 as Weight))77 .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))62 .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))78 .saturating_add(T::DbWeight::get().writes(1 as Weight))63 .saturating_add(T::DbWeight::get().writes(4 as Weight))79 .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(s as Weight)))64 .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))80 }65 }81 // Storage: Scheduler Agenda (r:1 w:1)66 // Storage: Scheduler Agenda (r:1 w:1)82 // Storage: Preimage PreimageFor (r:1 w:1)67 // Storage: System Account (r:1 w:1)83 // Storage: Preimage StatusFor (r:1 w:1)68 // Storage: System AllExtrinsicsLen (r:1 w:1)69 // Storage: System BlockWeight (r:1 w:1)84 // Storage: Scheduler Lookup (r:0 w:1)70 // Storage: Scheduler Lookup (r:0 w:1)85 fn on_initialize_named_resolved(s: u32, ) -> Weight {71 fn on_initialize_named_resolved(s: u32, ) -> Weight {86 (8_965_000 as Weight)72 (34_874_000 as Weight)87 // Standard Error: 11_00073 // Standard Error: 2_00088 .saturating_add((13_410_000 as Weight).saturating_mul(s as Weight))74 .saturating_add((23_114_000 as Weight).saturating_mul(s as Weight))89 .saturating_add(T::DbWeight::get().reads(1 as Weight))75 .saturating_add(T::DbWeight::get().reads(4 as Weight))90 .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))76 .saturating_add(T::DbWeight::get().writes(4 as Weight))91 .saturating_add(T::DbWeight::get().writes(1 as Weight))92 .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))77 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))93 }78 }94 // Storage: Scheduler Agenda (r:2 w:2)79 // Storage: Scheduler Agenda (r:2 w:2)95 // Storage: Preimage PreimageFor (r:1 w:1)80 // Storage: System Account (r:1 w:1)96 // Storage: Preimage StatusFor (r:1 w:1)81 // Storage: System AllExtrinsicsLen (r:1 w:1)97 fn on_initialize_periodic_resolved(s: u32, ) -> Weight {82 // Storage: System BlockWeight (r:1 w:1)98 (8_654_000 as Weight)99 // Standard Error: 17_000100 .saturating_add((14_990_000 as Weight).saturating_mul(s as Weight))101 .saturating_add(T::DbWeight::get().reads(1 as Weight))102 .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))103 .saturating_add(T::DbWeight::get().writes(1 as Weight))104 .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))105 }106 // Storage: Scheduler Agenda (r:1 w:1)107 // Storage: Preimage PreimageFor (r:1 w:1)83 // Storage: Scheduler Lookup (r:0 w:1)108 // Storage: Preimage StatusFor (r:1 w:1)84 fn on_initialize_periodic(s: u32, ) -> Weight {109 fn on_initialize_resolved(s: u32, ) -> Weight {110 (9_303_000 as Weight)85 (36_469_000 as Weight)111 // Standard Error: 10_00086 // Standard Error: 3_000112 .saturating_add((12_244_000 as Weight).saturating_mul(s as Weight))87 .saturating_add((32_202_000 as Weight).saturating_mul(s as Weight))113 .saturating_add(T::DbWeight::get().reads(1 as Weight))88 .saturating_add(T::DbWeight::get().reads(4 as Weight))114 .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))89 .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))115 .saturating_add(T::DbWeight::get().writes(1 as Weight))90 .saturating_add(T::DbWeight::get().writes(4 as Weight))116 .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))91 .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))117 }92 }118 // Storage: Scheduler Agenda (r:2 w:2)93 // Storage: Scheduler Agenda (r:2 w:2)119 // Storage: Preimage PreimageFor (r:1 w:0)94 // Storage: System Account (r:1 w:1)95 // Storage: System AllExtrinsicsLen (r:1 w:1)96 // Storage: System BlockWeight (r:1 w:1)120 // Storage: Scheduler Lookup (r:0 w:1)97 // Storage: Scheduler Lookup (r:0 w:1)121 fn on_initialize_named_aborted(s: u32, ) -> Weight {98 fn on_initialize_periodic_resolved(s: u32, ) -> Weight {122 (7_506_000 as Weight)99 (35_352_000 as Weight)123 // Standard Error: 3_000100 // Standard Error: 3_000124 .saturating_add((5_208_000 as Weight).saturating_mul(s as Weight))101 .saturating_add((32_309_000 as Weight).saturating_mul(s as Weight))125 .saturating_add(T::DbWeight::get().reads(2 as Weight))102 .saturating_add(T::DbWeight::get().reads(4 as Weight))126 .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))103 .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))127 .saturating_add(T::DbWeight::get().writes(2 as Weight))104 .saturating_add(T::DbWeight::get().writes(4 as Weight))128 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))105 .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))129 }106 }130 // Storage: Scheduler Agenda (r:2 w:2)107 // Storage: Scheduler Agenda (r:2 w:2)131 // Storage: Preimage PreimageFor (r:1 w:0)108 // Storage: Scheduler Lookup (r:0 w:1)132 fn on_initialize_aborted(s: u32, ) -> Weight {109 fn on_initialize_aborted(s: u32, ) -> Weight {133 (8_046_000 as Weight)110 (11_267_000 as Weight)134 // Standard Error: 3_000111 // Standard Error: 1_000135 .saturating_add((2_914_000 as Weight).saturating_mul(s as Weight))112 .saturating_add((9_368_000 as Weight).saturating_mul(s as Weight))136 .saturating_add(T::DbWeight::get().reads(2 as Weight))113 .saturating_add(T::DbWeight::get().reads(2 as Weight))137 .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))138 .saturating_add(T::DbWeight::get().writes(2 as Weight))114 .saturating_add(T::DbWeight::get().writes(2 as Weight))115 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))139 }116 }140 // Storage: Scheduler Agenda (r:2 w:2)117 // Storage: Scheduler Agenda (r:1 w:1)118 // Storage: System Account (r:1 w:1)119 // Storage: System AllExtrinsicsLen (r:1 w:1)120 // Storage: System BlockWeight (r:1 w:1)141 // Storage: Scheduler Lookup (r:0 w:1)121 // Storage: Scheduler Lookup (r:0 w:1)142 fn on_initialize_periodic_named(s: u32, ) -> Weight {122 fn on_initialize_named_aborted(s: u32, ) -> Weight {143 (13_704_000 as Weight)123 (35_937_000 as Weight)144 // Standard Error: 4_000124 // Standard Error: 3_000145 .saturating_add((8_186_000 as Weight).saturating_mul(s as Weight))125 .saturating_add((23_037_000 as Weight).saturating_mul(s as Weight))146 .saturating_add(T::DbWeight::get().reads(1 as Weight))126 .saturating_add(T::DbWeight::get().reads(4 as Weight))147 .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))127 .saturating_add(T::DbWeight::get().writes(4 as Weight))148 .saturating_add(T::DbWeight::get().writes(1 as Weight))149 .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))150 }151 // Storage: Scheduler Agenda (r:2 w:2)152 fn on_initialize_periodic(s: u32, ) -> Weight {153 (12_668_000 as Weight)154 // Standard Error: 5_000155 .saturating_add((5_868_000 as Weight).saturating_mul(s as Weight))156 .saturating_add(T::DbWeight::get().reads(1 as Weight))157 .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))158 .saturating_add(T::DbWeight::get().writes(1 as Weight))159 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))128 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))160 }129 }161 // Storage: Scheduler Agenda (r:1 w:1)130 // Storage: Scheduler Agenda (r:2 w:2)162 // Storage: Scheduler Lookup (r:0 w:1)131 // Storage: Scheduler Lookup (r:0 w:1)163 fn on_initialize_named(s: u32, ) -> Weight {132 fn on_initialize_named(s: u32, ) -> Weight {164 (13_946_000 as Weight)133 (10_338_000 as Weight)165 // Standard Error: 4_000134 // Standard Error: 2_000166 .saturating_add((4_367_000 as Weight).saturating_mul(s as Weight))135 .saturating_add((9_422_000 as Weight).saturating_mul(s as Weight))167 .saturating_add(T::DbWeight::get().reads(1 as Weight))136 .saturating_add(T::DbWeight::get().reads(2 as Weight))168 .saturating_add(T::DbWeight::get().writes(1 as Weight))137 .saturating_add(T::DbWeight::get().writes(2 as Weight))169 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))138 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))170 }139 }171 // Storage: Scheduler Agenda (r:1 w:1)140 // Storage: Scheduler Agenda (r:1 w:1)141 // Storage: System Account (r:1 w:1)142 // Storage: System AllExtrinsicsLen (r:1 w:1)143 // Storage: System BlockWeight (r:1 w:1)144 // Storage: Scheduler Lookup (r:0 w:1)172 fn on_initialize(s: u32, ) -> Weight {145 fn on_initialize(s: u32, ) -> Weight {173 (13_151_000 as Weight)146 (37_448_000 as Weight)174 // Standard Error: 4_000147 // Standard Error: 7_000175 .saturating_add((3_455_000 as Weight).saturating_mul(s as Weight))148 .saturating_add((22_907_000 as Weight).saturating_mul(s as Weight))176 .saturating_add(T::DbWeight::get().reads(1 as Weight))149 .saturating_add(T::DbWeight::get().reads(4 as Weight))177 .saturating_add(T::DbWeight::get().writes(1 as Weight))150 .saturating_add(T::DbWeight::get().writes(4 as Weight))151 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))178 }152 }179 // Storage: Scheduler Agenda (r:1 w:1)153 // Storage: Scheduler Agenda (r:1 w:1)180 fn schedule(s: u32, ) -> Weight {154 // Storage: System Account (r:1 w:1)181 (14_040_000 as Weight)182 // Standard Error: 1_000155 // Storage: System AllExtrinsicsLen (r:1 w:1)183 .saturating_add((89_000 as Weight).saturating_mul(s as Weight))184 .saturating_add(T::DbWeight::get().reads(1 as Weight))185 .saturating_add(T::DbWeight::get().writes(1 as Weight))186 }187 // Storage: Scheduler Agenda (r:1 w:1)156 // Storage: System BlockWeight (r:1 w:1)188 // Storage: Scheduler Lookup (r:0 w:1)157 // Storage: Scheduler Lookup (r:0 w:1)189 fn cancel(s: u32, ) -> Weight {158 fn on_initialize_resolved(s: u32, ) -> Weight {190 (14_376_000 as Weight)159 (34_841_000 as Weight)191 // Standard Error: 1_000160 // Standard Error: 7_000192 .saturating_add((576_000 as Weight).saturating_mul(s as Weight))161 .saturating_add((22_966_000 as Weight).saturating_mul(s as Weight))193 .saturating_add(T::DbWeight::get().reads(1 as Weight))162 .saturating_add(T::DbWeight::get().reads(4 as Weight))194 .saturating_add(T::DbWeight::get().writes(2 as Weight))163 .saturating_add(T::DbWeight::get().writes(4 as Weight))164 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))195 }165 }196 // Storage: Scheduler Lookup (r:1 w:1)166 // Storage: Scheduler Lookup (r:1 w:1)197 // Storage: Scheduler Agenda (r:1 w:1)167 // Storage: Scheduler Agenda (r:1 w:1)198 fn schedule_named(s: u32, ) -> Weight {168 fn schedule_named(s: u32, ) -> Weight {199 (16_806_000 as Weight)169 (33_845_000 as Weight)200 // Standard Error: 1_000170 // Standard Error: 0201 .saturating_add((102_000 as Weight).saturating_mul(s as Weight))171 .saturating_add((168_000 as Weight).saturating_mul(s as Weight))202 .saturating_add(T::DbWeight::get().reads(2 as Weight))172 .saturating_add(T::DbWeight::get().reads(2 as Weight))203 .saturating_add(T::DbWeight::get().writes(2 as Weight))173 .saturating_add(T::DbWeight::get().writes(2 as Weight))204 }174 }205 // Storage: Scheduler Lookup (r:1 w:1)175 // Storage: Scheduler Lookup (r:1 w:1)206 // Storage: Scheduler Agenda (r:1 w:1)176 // Storage: Scheduler Agenda (r:1 w:1)207 fn cancel_named(s: u32, ) -> Weight {177 fn cancel_named(s: u32, ) -> Weight {208 (15_852_000 as Weight)178 (31_169_000 as Weight)209 // Standard Error: 2_000179 // Standard Error: 1_000210 .saturating_add((590_000 as Weight).saturating_mul(s as Weight))180 .saturating_add((1_565_000 as Weight).saturating_mul(s as Weight))211 .saturating_add(T::DbWeight::get().reads(2 as Weight))181 .saturating_add(T::DbWeight::get().reads(2 as Weight))212 .saturating_add(T::DbWeight::get().writes(2 as Weight))182 .saturating_add(T::DbWeight::get().writes(2 as Weight))213 }183 }216// For backwards compatibility and tests186// For backwards compatibility and tests217impl WeightInfo for () {187impl WeightInfo for () {218 // Storage: Scheduler Agenda (r:2 w:2)188 // Storage: Scheduler Agenda (r:2 w:2)219 // Storage: Preimage PreimageFor (r:1 w:1)189 // Storage: System Account (r:1 w:1)220 // Storage: Preimage StatusFor (r:1 w:1)190 // Storage: System AllExtrinsicsLen (r:1 w:1)191 // Storage: System BlockWeight (r:1 w:1)221 // Storage: Scheduler Lookup (r:0 w:1)192 // Storage: Scheduler Lookup (r:0 w:1)222 fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {193 fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {223 (11_587_000 as Weight)194 (35_999_000 as Weight)224 // Standard Error: 17_000195 // Standard Error: 3_000225 .saturating_add((17_428_000 as Weight).saturating_mul(s as Weight))196 .saturating_add((32_234_000 as Weight).saturating_mul(s as Weight))226 .saturating_add(RocksDbWeight::get().reads(1 as Weight))197 .saturating_add(RocksDbWeight::get().reads(4 as Weight))227 .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))198 .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))228 .saturating_add(RocksDbWeight::get().writes(1 as Weight))199 .saturating_add(RocksDbWeight::get().writes(4 as Weight))229 .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(s as Weight)))200 .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))230 }201 }231 // Storage: Scheduler Agenda (r:1 w:1)202 // Storage: Scheduler Agenda (r:1 w:1)232 // Storage: Preimage PreimageFor (r:1 w:1)203 // Storage: System Account (r:1 w:1)233 // Storage: Preimage StatusFor (r:1 w:1)204 // Storage: System AllExtrinsicsLen (r:1 w:1)205 // Storage: System BlockWeight (r:1 w:1)234 // Storage: Scheduler Lookup (r:0 w:1)206 // Storage: Scheduler Lookup (r:0 w:1)235 fn on_initialize_named_resolved(s: u32, ) -> Weight {207 fn on_initialize_named_resolved(s: u32, ) -> Weight {236 (8_965_000 as Weight)208 (34_874_000 as Weight)237 // Standard Error: 11_000209 // Standard Error: 2_000238 .saturating_add((13_410_000 as Weight).saturating_mul(s as Weight))210 .saturating_add((23_114_000 as Weight).saturating_mul(s as Weight))239 .saturating_add(RocksDbWeight::get().reads(1 as Weight))211 .saturating_add(RocksDbWeight::get().reads(4 as Weight))240 .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))212 .saturating_add(RocksDbWeight::get().writes(4 as Weight))241 .saturating_add(RocksDbWeight::get().writes(1 as Weight))242 .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))213 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))243 }214 }244 // Storage: Scheduler Agenda (r:2 w:2)215 // Storage: Scheduler Agenda (r:2 w:2)245 // Storage: Preimage PreimageFor (r:1 w:1)216 // Storage: System Account (r:1 w:1)246 // Storage: Preimage StatusFor (r:1 w:1)217 // Storage: System AllExtrinsicsLen (r:1 w:1)247 fn on_initialize_periodic_resolved(s: u32, ) -> Weight {218 // Storage: System BlockWeight (r:1 w:1)248 (8_654_000 as Weight)249 // Standard Error: 17_000250 .saturating_add((14_990_000 as Weight).saturating_mul(s as Weight))251 .saturating_add(RocksDbWeight::get().reads(1 as Weight))252 .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))253 .saturating_add(RocksDbWeight::get().writes(1 as Weight))254 .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))255 }256 // Storage: Scheduler Agenda (r:1 w:1)257 // Storage: Preimage PreimageFor (r:1 w:1)219 // Storage: Scheduler Lookup (r:0 w:1)258 // Storage: Preimage StatusFor (r:1 w:1)220 fn on_initialize_periodic(s: u32, ) -> Weight {259 fn on_initialize_resolved(s: u32, ) -> Weight {260 (9_303_000 as Weight)221 (36_469_000 as Weight)261 // Standard Error: 10_000222 // Standard Error: 3_000262 .saturating_add((12_244_000 as Weight).saturating_mul(s as Weight))223 .saturating_add((32_202_000 as Weight).saturating_mul(s as Weight))263 .saturating_add(RocksDbWeight::get().reads(1 as Weight))224 .saturating_add(RocksDbWeight::get().reads(4 as Weight))264 .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))225 .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))265 .saturating_add(RocksDbWeight::get().writes(1 as Weight))226 .saturating_add(RocksDbWeight::get().writes(4 as Weight))266 .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))227 .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))267 }228 }268 // Storage: Scheduler Agenda (r:2 w:2)229 // Storage: Scheduler Agenda (r:2 w:2)269 // Storage: Preimage PreimageFor (r:1 w:0)230 // Storage: System Account (r:1 w:1)231 // Storage: System AllExtrinsicsLen (r:1 w:1)232 // Storage: System BlockWeight (r:1 w:1)270 // Storage: Scheduler Lookup (r:0 w:1)233 // Storage: Scheduler Lookup (r:0 w:1)271 fn on_initialize_named_aborted(s: u32, ) -> Weight {234 fn on_initialize_periodic_resolved(s: u32, ) -> Weight {272 (7_506_000 as Weight)235 (35_352_000 as Weight)273 // Standard Error: 3_000236 // Standard Error: 3_000274 .saturating_add((5_208_000 as Weight).saturating_mul(s as Weight))237 .saturating_add((32_309_000 as Weight).saturating_mul(s as Weight))275 .saturating_add(RocksDbWeight::get().reads(2 as Weight))238 .saturating_add(RocksDbWeight::get().reads(4 as Weight))276 .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))239 .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))277 .saturating_add(RocksDbWeight::get().writes(2 as Weight))240 .saturating_add(RocksDbWeight::get().writes(4 as Weight))278 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))241 .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))279 }242 }280 // Storage: Scheduler Agenda (r:2 w:2)243 // Storage: Scheduler Agenda (r:2 w:2)281 // Storage: Preimage PreimageFor (r:1 w:0)244 // Storage: Scheduler Lookup (r:0 w:1)282 fn on_initialize_aborted(s: u32, ) -> Weight {245 fn on_initialize_aborted(s: u32, ) -> Weight {283 (8_046_000 as Weight)246 (11_267_000 as Weight)284 // Standard Error: 3_000247 // Standard Error: 1_000285 .saturating_add((2_914_000 as Weight).saturating_mul(s as Weight))248 .saturating_add((9_368_000 as Weight).saturating_mul(s as Weight))286 .saturating_add(RocksDbWeight::get().reads(2 as Weight))249 .saturating_add(RocksDbWeight::get().reads(2 as Weight))287 .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))288 .saturating_add(RocksDbWeight::get().writes(2 as Weight))250 .saturating_add(RocksDbWeight::get().writes(2 as Weight))251 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))289 }252 }290 // Storage: Scheduler Agenda (r:2 w:2)253 // Storage: Scheduler Agenda (r:1 w:1)254 // Storage: System Account (r:1 w:1)255 // Storage: System AllExtrinsicsLen (r:1 w:1)256 // Storage: System BlockWeight (r:1 w:1)291 // Storage: Scheduler Lookup (r:0 w:1)257 // Storage: Scheduler Lookup (r:0 w:1)292 fn on_initialize_periodic_named(s: u32, ) -> Weight {258 fn on_initialize_named_aborted(s: u32, ) -> Weight {293 (13_704_000 as Weight)259 (35_937_000 as Weight)294 // Standard Error: 4_000260 // Standard Error: 3_000295 .saturating_add((8_186_000 as Weight).saturating_mul(s as Weight))261 .saturating_add((23_037_000 as Weight).saturating_mul(s as Weight))296 .saturating_add(RocksDbWeight::get().reads(1 as Weight))262 .saturating_add(RocksDbWeight::get().reads(4 as Weight))297 .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))263 .saturating_add(RocksDbWeight::get().writes(4 as Weight))298 .saturating_add(RocksDbWeight::get().writes(1 as Weight))299 .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))300 }301 // Storage: Scheduler Agenda (r:2 w:2)302 fn on_initialize_periodic(s: u32, ) -> Weight {303 (12_668_000 as Weight)304 // Standard Error: 5_000305 .saturating_add((5_868_000 as Weight).saturating_mul(s as Weight))306 .saturating_add(RocksDbWeight::get().reads(1 as Weight))307 .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))308 .saturating_add(RocksDbWeight::get().writes(1 as Weight))309 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))264 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))310 }265 }311 // Storage: Scheduler Agenda (r:1 w:1)266 // Storage: Scheduler Agenda (r:2 w:2)312 // Storage: Scheduler Lookup (r:0 w:1)267 // Storage: Scheduler Lookup (r:0 w:1)313 fn on_initialize_named(s: u32, ) -> Weight {268 fn on_initialize_named(s: u32, ) -> Weight {314 (13_946_000 as Weight)269 (10_338_000 as Weight)315 // Standard Error: 4_000270 // Standard Error: 2_000316 .saturating_add((4_367_000 as Weight).saturating_mul(s as Weight))271 .saturating_add((9_422_000 as Weight).saturating_mul(s as Weight))317 .saturating_add(RocksDbWeight::get().reads(1 as Weight))272 .saturating_add(RocksDbWeight::get().reads(2 as Weight))318 .saturating_add(RocksDbWeight::get().writes(1 as Weight))273 .saturating_add(RocksDbWeight::get().writes(2 as Weight))319 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))274 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))320 }275 }321 // Storage: Scheduler Agenda (r:1 w:1)276 // Storage: Scheduler Agenda (r:1 w:1)277 // Storage: System Account (r:1 w:1)278 // Storage: System AllExtrinsicsLen (r:1 w:1)279 // Storage: System BlockWeight (r:1 w:1)280 // Storage: Scheduler Lookup (r:0 w:1)322 fn on_initialize(s: u32, ) -> Weight {281 fn on_initialize(s: u32, ) -> Weight {323 (13_151_000 as Weight)282 (37_448_000 as Weight)324 // Standard Error: 4_000283 // Standard Error: 7_000325 .saturating_add((3_455_000 as Weight).saturating_mul(s as Weight))284 .saturating_add((22_907_000 as Weight).saturating_mul(s as Weight))326 .saturating_add(RocksDbWeight::get().reads(1 as Weight))285 .saturating_add(RocksDbWeight::get().reads(4 as Weight))327 .saturating_add(RocksDbWeight::get().writes(1 as Weight))286 .saturating_add(RocksDbWeight::get().writes(4 as Weight))287 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))328 }288 }329 // Storage: Scheduler Agenda (r:1 w:1)289 // Storage: Scheduler Agenda (r:1 w:1)330 fn schedule(s: u32, ) -> Weight {290 // Storage: System Account (r:1 w:1)331 (14_040_000 as Weight)332 // Standard Error: 1_000291 // Storage: System AllExtrinsicsLen (r:1 w:1)333 .saturating_add((89_000 as Weight).saturating_mul(s as Weight))334 .saturating_add(RocksDbWeight::get().reads(1 as Weight))335 .saturating_add(RocksDbWeight::get().writes(1 as Weight))336 }337 // Storage: Scheduler Agenda (r:1 w:1)292 // Storage: System BlockWeight (r:1 w:1)338 // Storage: Scheduler Lookup (r:0 w:1)293 // Storage: Scheduler Lookup (r:0 w:1)339 fn cancel(s: u32, ) -> Weight {294 fn on_initialize_resolved(s: u32, ) -> Weight {340 (14_376_000 as Weight)295 (34_841_000 as Weight)341 // Standard Error: 1_000296 // Standard Error: 7_000342 .saturating_add((576_000 as Weight).saturating_mul(s as Weight))297 .saturating_add((22_966_000 as Weight).saturating_mul(s as Weight))343 .saturating_add(RocksDbWeight::get().reads(1 as Weight))298 .saturating_add(RocksDbWeight::get().reads(4 as Weight))344 .saturating_add(RocksDbWeight::get().writes(2 as Weight))299 .saturating_add(RocksDbWeight::get().writes(4 as Weight))300 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))345 }301 }346 // Storage: Scheduler Lookup (r:1 w:1)302 // Storage: Scheduler Lookup (r:1 w:1)347 // Storage: Scheduler Agenda (r:1 w:1)303 // Storage: Scheduler Agenda (r:1 w:1)348 fn schedule_named(s: u32, ) -> Weight {304 fn schedule_named(s: u32, ) -> Weight {349 (16_806_000 as Weight)305 (33_845_000 as Weight)350 // Standard Error: 1_000306 // Standard Error: 0351 .saturating_add((102_000 as Weight).saturating_mul(s as Weight))307 .saturating_add((168_000 as Weight).saturating_mul(s as Weight))352 .saturating_add(RocksDbWeight::get().reads(2 as Weight))308 .saturating_add(RocksDbWeight::get().reads(2 as Weight))353 .saturating_add(RocksDbWeight::get().writes(2 as Weight))309 .saturating_add(RocksDbWeight::get().writes(2 as Weight))354 }310 }355 // Storage: Scheduler Lookup (r:1 w:1)311 // Storage: Scheduler Lookup (r:1 w:1)356 // Storage: Scheduler Agenda (r:1 w:1)312 // Storage: Scheduler Agenda (r:1 w:1)357 fn cancel_named(s: u32, ) -> Weight {313 fn cancel_named(s: u32, ) -> Weight {358 (15_852_000 as Weight)314 (31_169_000 as Weight)359 // Standard Error: 2_000315 // Standard Error: 1_000360 .saturating_add((590_000 as Weight).saturating_mul(s as Weight))316 .saturating_add((1_565_000 as Weight).saturating_mul(s as Weight))361 .saturating_add(RocksDbWeight::get().reads(2 as Weight))317 .saturating_add(RocksDbWeight::get().reads(2 as Weight))362 .saturating_add(RocksDbWeight::get().writes(2 as Weight))318 .saturating_add(RocksDbWeight::get().writes(2 as Weight))363 }319 }runtime/common/Cargo.tomldiffbeforeafterboth--- a/runtime/common/Cargo.toml
+++ b/runtime/common/Cargo.toml
@@ -89,6 +89,10 @@
default-features = false
path = "../../pallets/refungible"
+[dependencies.pallet-unique-scheduler]
+default-features = false
+path = "../../pallets/scheduler"
+
[dependencies.up-data-structs]
default-features = false
path = "../../primitives/data-structs"
runtime/common/src/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/src/runtime_apis.rs
+++ b/runtime/common/src/runtime_apis.rs
@@ -843,6 +843,7 @@
list_benchmark!(list, extra, pallet_fungible, Fungible);
list_benchmark!(list, extra, pallet_refungible, Refungible);
list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);
+ list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler);
list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);
// list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);
@@ -887,6 +888,7 @@
add_benchmark!(params, batches, pallet_fungible, Fungible);
add_benchmark!(params, batches, pallet_refungible, Refungible);
add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);
+ add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler);
add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);
// add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -36,6 +36,7 @@
'pallet-proxy-rmrk-core/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
+ 'pallet-unique-scheduler/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
'sp-runtime/runtime-benchmarks',
'xcm-builder/runtime-benchmarks',
@@ -93,7 +94,7 @@
'pallet-proxy-rmrk-core/std',
'pallet-proxy-rmrk-equip/std',
'pallet-unique/std',
- 'pallet-unq-scheduler/std',
+ 'pallet-unique-scheduler/std',
'pallet-charge-transaction/std',
'up-data-structs/std',
'sp-api/std',
@@ -412,7 +413,7 @@
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
+pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.22", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -68,7 +68,7 @@
WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,
},
};
-use pallet_unq_scheduler::DispatchCall;
+use pallet_unique_scheduler::DispatchCall;
use up_data_structs::{
CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits,
CollectionStats, RpcCollection,
@@ -969,7 +969,7 @@
}
pub struct SchedulerPaymentExecutor;
-impl<T: frame_system::Config + pallet_unq_scheduler::Config, SelfContainedSignedInfo>
+impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
where
<T as frame_system::Config>::Call: Member
@@ -979,13 +979,13 @@
+ From<frame_system::Call<Runtime>>,
SelfContainedSignedInfo: Send + Sync + 'static,
Call: From<<T as frame_system::Config>::Call>
- + From<<T as pallet_unq_scheduler::Config>::Call>
+ + From<<T as pallet_unique_scheduler::Config>::Call>
+ SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,
sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,
{
fn dispatch_call(
signer: <T as frame_system::Config>::AccountId,
- call: <T as pallet_unq_scheduler::Config>::Call,
+ call: <T as pallet_unique_scheduler::Config>::Call,
) -> Result<
Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
TransactionValidityError,
@@ -1011,7 +1011,7 @@
fn reserve_balance(
id: [u8; 16],
sponsor: <T as frame_system::Config>::AccountId,
- call: <T as pallet_unq_scheduler::Config>::Call,
+ call: <T as pallet_unique_scheduler::Config>::Call,
count: u32,
) -> Result<(), DispatchError> {
let dispatch_info = call.get_dispatch_info();
@@ -1028,7 +1028,7 @@
fn pay_for_call(
id: [u8; 16],
sponsor: <T as frame_system::Config>::AccountId,
- call: <T as pallet_unq_scheduler::Config>::Call,
+ call: <T as pallet_unique_scheduler::Config>::Call,
) -> Result<u128, DispatchError> {
let dispatch_info = call.get_dispatch_info();
let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
@@ -1069,7 +1069,7 @@
}
}
-impl pallet_unq_scheduler::Config for Runtime {
+impl pallet_unique_scheduler::Config for Runtime {
type Event = Event;
type Origin = Origin;
type Currency = Balances;
@@ -1158,7 +1158,7 @@
// Unique Pallets
Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
- Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
+ Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
// free = 63
Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -37,6 +37,7 @@
'pallet-proxy-rmrk-equip/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
+ 'pallet-unique-scheduler/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
'sp-runtime/runtime-benchmarks',
'xcm-builder/runtime-benchmarks',
@@ -94,7 +95,7 @@
'pallet-proxy-rmrk-core/std',
'pallet-proxy-rmrk-equip/std',
'pallet-unique/std',
- 'pallet-unq-scheduler/std',
+ 'pallet-unique-scheduler/std',
'pallet-charge-transaction/std',
'up-data-structs/std',
'sp-api/std',
@@ -419,7 +420,7 @@
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
+pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.22", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -68,7 +68,7 @@
WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,
},
};
-use pallet_unq_scheduler::DispatchCall;
+use pallet_unique_scheduler::DispatchCall;
use up_data_structs::{
CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits,
CollectionStats, RpcCollection,
@@ -968,7 +968,7 @@
}
pub struct SchedulerPaymentExecutor;
-impl<T: frame_system::Config + pallet_unq_scheduler::Config, SelfContainedSignedInfo>
+impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
where
<T as frame_system::Config>::Call: Member
@@ -978,13 +978,13 @@
+ From<frame_system::Call<Runtime>>,
SelfContainedSignedInfo: Send + Sync + 'static,
Call: From<<T as frame_system::Config>::Call>
- + From<<T as pallet_unq_scheduler::Config>::Call>
+ + From<<T as pallet_unique_scheduler::Config>::Call>
+ SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,
sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,
{
fn dispatch_call(
signer: <T as frame_system::Config>::AccountId,
- call: <T as pallet_unq_scheduler::Config>::Call,
+ call: <T as pallet_unique_scheduler::Config>::Call,
) -> Result<
Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
TransactionValidityError,
@@ -1010,7 +1010,7 @@
fn reserve_balance(
id: [u8; 16],
sponsor: <T as frame_system::Config>::AccountId,
- call: <T as pallet_unq_scheduler::Config>::Call,
+ call: <T as pallet_unique_scheduler::Config>::Call,
count: u32,
) -> Result<(), DispatchError> {
let dispatch_info = call.get_dispatch_info();
@@ -1027,7 +1027,7 @@
fn pay_for_call(
id: [u8; 16],
sponsor: <T as frame_system::Config>::AccountId,
- call: <T as pallet_unq_scheduler::Config>::Call,
+ call: <T as pallet_unique_scheduler::Config>::Call,
) -> Result<u128, DispatchError> {
let dispatch_info = call.get_dispatch_info();
let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
@@ -1068,7 +1068,7 @@
}
}
-impl pallet_unq_scheduler::Config for Runtime {
+impl pallet_unique_scheduler::Config for Runtime {
type Event = Event;
type Origin = Origin;
type Currency = Balances;
@@ -1156,7 +1156,7 @@
// Unique Pallets
Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
- Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
+ Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
// free = 63
Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -37,6 +37,7 @@
'pallet-proxy-rmrk-equip/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
+ 'pallet-unique-scheduler/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
'sp-runtime/runtime-benchmarks',
'xcm-builder/runtime-benchmarks',
@@ -95,7 +96,7 @@
'pallet-proxy-rmrk-core/std',
'pallet-proxy-rmrk-equip/std',
'pallet-unique/std',
- 'pallet-unq-scheduler/std',
+ 'pallet-unique-scheduler/std',
'pallet-charge-transaction/std',
'up-data-structs/std',
'sp-api/std',
@@ -412,7 +413,7 @@
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
+pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.22", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
runtime/unique/src/lib.rsdiffbeforeafterboth--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -68,7 +68,7 @@
WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,
},
};
-use pallet_unq_scheduler::DispatchCall;
+use pallet_unique_scheduler::DispatchCall;
use up_data_structs::{
CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits,
CollectionStats, RpcCollection,
@@ -967,7 +967,7 @@
}
pub struct SchedulerPaymentExecutor;
-impl<T: frame_system::Config + pallet_unq_scheduler::Config, SelfContainedSignedInfo>
+impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
where
<T as frame_system::Config>::Call: Member
@@ -977,13 +977,13 @@
+ From<frame_system::Call<Runtime>>,
SelfContainedSignedInfo: Send + Sync + 'static,
Call: From<<T as frame_system::Config>::Call>
- + From<<T as pallet_unq_scheduler::Config>::Call>
+ + From<<T as pallet_unique_scheduler::Config>::Call>
+ SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,
sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,
{
fn dispatch_call(
signer: <T as frame_system::Config>::AccountId,
- call: <T as pallet_unq_scheduler::Config>::Call,
+ call: <T as pallet_unique_scheduler::Config>::Call,
) -> Result<
Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
TransactionValidityError,
@@ -1009,7 +1009,7 @@
fn reserve_balance(
id: [u8; 16],
sponsor: <T as frame_system::Config>::AccountId,
- call: <T as pallet_unq_scheduler::Config>::Call,
+ call: <T as pallet_unique_scheduler::Config>::Call,
count: u32,
) -> Result<(), DispatchError> {
let dispatch_info = call.get_dispatch_info();
@@ -1026,7 +1026,7 @@
fn pay_for_call(
id: [u8; 16],
sponsor: <T as frame_system::Config>::AccountId,
- call: <T as pallet_unq_scheduler::Config>::Call,
+ call: <T as pallet_unique_scheduler::Config>::Call,
) -> Result<u128, DispatchError> {
let dispatch_info = call.get_dispatch_info();
let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
@@ -1067,7 +1067,7 @@
}
}
-impl pallet_unq_scheduler::Config for Runtime {
+impl pallet_unique_scheduler::Config for Runtime {
type Event = Event;
type Origin = Origin;
type Currency = Balances;
@@ -1155,7 +1155,7 @@
// Unique Pallets
Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
- Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
+ Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
// free = 63
Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,