difftreelog
chore remove old scheduler
in: master
12 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5389,7 +5389,6 @@
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-unique",
- "pallet-unique-scheduler",
"pallet-unique-scheduler-v2",
"pallet-xcm",
"parachain-info",
@@ -6850,25 +6849,6 @@
"sp-runtime",
"sp-std",
"up-data-structs",
-]
-
-[[package]]
-name = "pallet-unique-scheduler"
-version = "0.1.1"
-dependencies = [
- "frame-benchmarking",
- "frame-support",
- "frame-system",
- "log",
- "parity-scale-codec 3.2.1",
- "scale-info",
- "serde",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
- "substrate-test-utils",
- "up-sponsorship",
]
[[package]]
@@ -8881,7 +8861,6 @@
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-unique",
- "pallet-unique-scheduler",
"pallet-xcm",
"parachain-info",
"parity-scale-codec 3.2.1",
@@ -13012,7 +12991,6 @@
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-unique",
- "pallet-unique-scheduler",
"pallet-xcm",
"parachain-info",
"parity-scale-codec 3.2.1",
pallets/scheduler/CHANGELOG.mddiffbeforeafterboth--- a/pallets/scheduler/CHANGELOG.md
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- bureaucrate goes here -->
-## [v0.1.1] 2022-08-16
-
-### Other changes
-
-- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a
-
-- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8
-
-- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
\ No newline at end of file
pallets/scheduler/Cargo.tomldiffbeforeafterboth--- a/pallets/scheduler/Cargo.toml
+++ /dev/null
@@ -1,53 +0,0 @@
-[package]
-name = "pallet-unique-scheduler"
-version = "0.1.1"
-authors = ["Unique Network <support@uniquenetwork.io>"]
-edition = "2021"
-license = "GPLv3"
-homepage = "https://unique.network"
-repository = "https://github.com/UniqueNetwork/unique-chain"
-description = "Unique Scheduler pallet"
-readme = "README.md"
-
-[dependencies]
-serde = { version = "1.0.130", default-features = false }
-codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false }
-scale-info = { version = "2.0.1", default-features = false, features = [
- "derive",
-] }
-
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.30' }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-
-up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30" }
-log = { version = "0.4.16", default-features = false }
-
-[dev-dependencies]
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-
-[features]
-default = ["std"]
-std = [
- "codec/std",
- "sp-runtime/std",
- "frame-benchmarking/std",
- "frame-support/std",
- "frame-system/std",
- "up-sponsorship/std",
- "sp-io/std",
- "sp-std/std",
- "sp-core/std",
- "log/std",
-]
-runtime-benchmarks = [
- "frame-benchmarking",
- "frame-support/runtime-benchmarks",
- "frame-system/runtime-benchmarks",
-]
-try-runtime = ["frame-support/try-runtime"]
pallets/scheduler/README.mddiffbeforeafterboth--- a/pallets/scheduler/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# Scheduler
-A module for scheduling dispatches.
-
-- [`scheduler::Trait`](https://docs.rs/pallet-scheduler/latest/pallet_scheduler/trait.Trait.html)
-- [`Call`](https://docs.rs/pallet-scheduler/latest/pallet_scheduler/enum.Call.html)
-- [`Module`](https://docs.rs/pallet-scheduler/latest/pallet_scheduler/struct.Module.html)
-
-## Overview
-
-This module exposes capabilities for scheduling dispatches to occur at a
-specified block number or at a specified period. These scheduled dispatches
-may be named or anonymous and may be canceled.
-
-**NOTE:** The scheduled calls will be dispatched with the default filter
-for the origin: namely `frame_system::Config::BaseCallFilter` for all origin
-except root which will get no filter. And not the filter contained in origin
-use to call `fn schedule`.
-
-If a call is scheduled using proxy or whatever mecanism which adds filter,
-then those filter will not be used when dispatching the schedule call.
-
-## Interface
-
-### Dispatchable Functions
-
-* `schedule` - schedule a dispatch, which may be periodic, to occur at a
- specified block and with a specified priority.
-* `cancel` - cancel a scheduled dispatch, specified by block number and
- index.
-* `schedule_named` - augments the `schedule` interface with an additional
- `Vec<u8>` parameter that can be used for identification.
-* `cancel_named` - the named complement to the cancel function.
-
-License: Unlicense
pallets/scheduler/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/scheduler/src/benchmarking.rs
+++ /dev/null
@@ -1,260 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-// Original license
-// This file is part of Substrate.
-
-// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
-// SPDX-License-Identifier: Apache-2.0
-
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//! Scheduler pallet benchmarking.
-
-use super::*;
-use frame_benchmarking::{benchmarks, account};
-use frame_support::{
- ensure,
- traits::{OnInitialize},
-};
-use frame_system::RawOrigin;
-use sp_runtime::traits::Hash;
-use sp_std::{prelude::*, vec};
-
-use crate::Pallet as Scheduler;
-use frame_system::Pallet as System;
-use frame_support::traits::Currency;
-
-const BLOCK_NUMBER: u32 = 2;
-
-fn make_scheduled_id(src: u32) -> ScheduledId {
- let slice_id: [u8; 4] = src.encode().try_into().unwrap();
- let mut id: [u8; 16] = [0; 16];
- id[..4].clone_from_slice(&slice_id);
- id
-}
-
-/// 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 {
- 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 id = make_scheduled_id(i);
- 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,
- "didn't fill schedule"
- );
- Ok(())
-}
-
-fn call_and_hash<T: Config>(i: u32) -> (<T as Config>::RuntimeCall, T::Hash) {
- // Essentially a no-op call.
- let call: <T as Config>::RuntimeCall = frame_system::Call::remark { remark: i.encode() }.into();
- let hash = T::Hashing::hash_of(&call);
- (call, hash)
-}
-
-benchmarks! {
- on_initialize_periodic_named_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 {
- 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_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 {
- assert_eq!(System::<T>::event_count(), s);
- assert!(Agenda::<T>::iter().count() == 0);
- }
-
- 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);
- }
- }
-
- 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 {
- 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 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 = None;
- // Essentially a no-op 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,
- "didn't add to schedule"
- );
- }
-
- 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();
- let idx = s - 1;
- let id = make_scheduled_id(idx);
- fill_schedule::<T>(when, s, true, Some(false))?;
- }: _(origin, id)
- verify {
- ensure!(
- Lookup::<T>::get(id).is_none(),
- "didn't remove from lookup"
- );
- // Removed schedule is NONE
- ensure!(
- Agenda::<T>::get(when)[idx as usize].is_none(),
- "didn't remove from schedule"
- );
- }
-
- change_named_priority {
- let origin: RawOrigin<T::AccountId> = frame_system::RawOrigin::Root;
- let s in 1 .. T::MaxScheduledPerBlock::get();
- let when = BLOCK_NUMBER.into();
- let idx = s - 1;
- let id = make_scheduled_id(idx);
- let priority = 42;
- fill_schedule::<T>(when, s, true, Some(false))?;
- }: _(origin, id, priority)
- verify {
- ensure!(
- Agenda::<T>::get(when)[idx as usize].clone().unwrap().priority == priority,
- "didn't change the priority"
- );
- }
-
- impl_benchmark_test_suite!(Scheduler, crate::mock::new_test_ext(), crate::mock::Test);
-}
pallets/scheduler/src/lib.rsdiffbeforeafterboth--- a/pallets/scheduler/src/lib.rs
+++ /dev/null
@@ -1,802 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-// Original license:
-// This file is part of Substrate.
-
-// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd.
-// SPDX-License-Identifier: Apache-2.0
-
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// <http://www.apache.org/licenses/LICENSE-2.0>
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//! # Unique scheduler
-//! A Pallet for scheduling dispatches.
-//!
-//! - [`Config`]
-//! - [`Call`]
-//! - [`Pallet`]
-//!
-//! ## Overview
-//!
-//! This Pallet exposes capabilities for scheduling dispatches to occur at a
-//! specified block number or at a specified period. These scheduled dispatches
-//! should be named and may be canceled.
-//!
-//! **NOTE:** The unique scheduler is designed for deferred transaction calls by block number.
-//! Any user can book a call of a certain transaction to a specific block number.
-//! Also possible to book a call with a certain frequency.
-//!
-//! Key differences from the original pallet:
-//! <https://crates.io/crates/pallet-scheduler>
-//! Schedule Id restricted by 16 bytes. Identificator for booked call.
-//! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block.
-//! The maximum weight that may be scheduled per block for any dispatchables of less priority than `schedule::HARD_DEADLINE`.
-//! Maybe_periodic limit is 100 calls. Reserved for future sponsored transaction support.
-//! At 100 calls reserved amount is not so much and this is avoid potential problems with balance locks.
-//! Any account allowed to schedule any calls. Account withdraw implemented through default transaction logic.
-//!
-//! ## Interface
-//!
-//! ### Dispatchable Functions
-//!
-//! * `schedule_named` - augments the `schedule` interface with an additional `Vec<u8>` parameter
-//! that can be used for identification.
-//! * `cancel_named` - the named complement to the cancel function.
-
-// Ensure we're `no_std` when compiling for Wasm.
-#![cfg_attr(not(feature = "std"), no_std)]
-
-#[cfg(feature = "runtime-benchmarks")]
-mod benchmarking;
-
-pub mod weights;
-
-use sp_core::H160;
-use codec::{Codec, Decode, Encode};
-use frame_system::{self as system, ensure_signed};
-pub use pallet::*;
-use scale_info::TypeInfo;
-use sp_runtime::{
- traits::{BadOrigin, One, Saturating, Zero},
- RuntimeDebug, DispatchErrorWithPostInfo,
-};
-use sp_std::{borrow::Borrow, cmp::Ordering, marker::PhantomData, prelude::*};
-
-use frame_support::{
- dispatch::{
- DispatchError, DispatchResult, Dispatchable, UnfilteredDispatchable, Parameter,
- GetDispatchInfo,
- },
- traits::{
- schedule::{self, DispatchTime, MaybeHashed},
- NamedReservableCurrency, EnsureOrigin, Get, IsType, OriginTrait, PrivilegeCmp,
- StorageVersion,
- },
- weights::{Weight},
-};
-
-pub use weights::WeightInfo;
-
-/// The location of a scheduled task that can be used to remove it.
-pub type TaskAddress<BlockNumber> = (BlockNumber, u32);
-pub const MAX_TASK_ID_LENGTH_IN_BYTES: u8 = 16;
-
-pub type ScheduledId = [u8; MAX_TASK_ID_LENGTH_IN_BYTES as usize];
-pub type CallOrHashOf<T> =
- MaybeHashed<<T as Config>::RuntimeCall, <T as frame_system::Config>::Hash>;
-
-/// Information regarding an item to be executed in the future.
-#[cfg_attr(any(feature = "std", test), derive(PartialEq, Eq))]
-#[derive(Clone, RuntimeDebug, Encode, Decode, TypeInfo)]
-pub struct ScheduledV3<Call, BlockNumber, PalletsOrigin, AccountId> {
- /// The unique identity for this task, if there is one.
- maybe_id: Option<ScheduledId>,
- /// This task's priority.
- priority: schedule::Priority,
- /// The call to be dispatched.
- call: Call,
- /// If the call is periodic, then this points to the information concerning that.
- maybe_periodic: Option<schedule::Period<BlockNumber>>,
- /// The origin to dispatch the call.
- origin: PalletsOrigin,
- _phantom: PhantomData<AccountId>,
-}
-
-pub type ScheduledV3Of<T> = ScheduledV3<
- CallOrHashOf<T>,
- <T as frame_system::Config>::BlockNumber,
- <T as Config>::PalletsOrigin,
- <T as frame_system::Config>::AccountId,
->;
-
-pub type ScheduledOf<T> = ScheduledV3Of<T>;
-
-/// The current version of Scheduled struct.
-pub type Scheduled<Call, BlockNumber, PalletsOrigin, AccountId> =
- ScheduledV3<Call, BlockNumber, PalletsOrigin, AccountId>;
-
-pub enum ScheduledEnsureOriginSuccess<AccountId> {
- Root,
- Signed(AccountId),
-}
-
-#[cfg(feature = "runtime-benchmarks")]
-mod preimage_provider {
- use frame_support::traits::PreimageRecipient;
- pub trait PreimageProviderAndMaybeRecipient<H>: PreimageRecipient<H> {}
- impl<H, T: PreimageRecipient<H>> PreimageProviderAndMaybeRecipient<H> for T {}
-}
-
-#[cfg(not(feature = "runtime-benchmarks"))]
-mod preimage_provider {
- use frame_support::traits::PreimageProvider;
- pub trait PreimageProviderAndMaybeRecipient<H>: PreimageProvider<H> {}
- impl<H, T: PreimageProvider<H>> PreimageProviderAndMaybeRecipient<H> for T {}
-}
-
-pub use preimage_provider::PreimageProviderAndMaybeRecipient;
-
-pub(crate) trait MarginalWeightInfo: WeightInfo {
- fn item(periodic: bool, named: bool, resolved: Option<bool>) -> Weight {
- match (periodic, named, resolved) {
- (_, false, None) => Self::on_initialize_aborted(2) - Self::on_initialize_aborted(1),
- (_, true, None) => {
- Self::on_initialize_named_aborted(2) - Self::on_initialize_named_aborted(1)
- }
- (false, false, Some(false)) => Self::on_initialize(2) - Self::on_initialize(1),
- (false, true, Some(false)) => {
- Self::on_initialize_named(2) - Self::on_initialize_named(1)
- }
- (true, false, Some(false)) => {
- Self::on_initialize_periodic(2) - Self::on_initialize_periodic(1)
- }
- (true, true, Some(false)) => {
- 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)
- }
- (true, false, Some(true)) => {
- Self::on_initialize_periodic_resolved(2) - Self::on_initialize_periodic_resolved(1)
- }
- (true, true, Some(true)) => {
- Self::on_initialize_periodic_named_resolved(2)
- - Self::on_initialize_periodic_named_resolved(1)
- }
- }
- }
-}
-impl<T: WeightInfo> MarginalWeightInfo for T {}
-
-#[frame_support::pallet]
-pub mod pallet {
- use super::*;
- use frame_support::{
- dispatch::PostDispatchInfo,
- pallet_prelude::*,
- traits::{
- schedule::{LookupError, LOWEST_PRIORITY},
- PreimageProvider,
- },
- };
- use frame_system::pallet_prelude::*;
-
- /// The current storage version.
- const STORAGE_VERSION: StorageVersion = StorageVersion::new(3);
-
- #[pallet::pallet]
- #[pallet::generate_store(pub(super) trait Store)]
- #[pallet::storage_version(STORAGE_VERSION)]
- #[pallet::without_storage_info]
- pub struct Pallet<T>(_);
-
- /// `system::Config` should always be included in our implied traits.
- #[pallet::config]
- pub trait Config: frame_system::Config {
- /// The overarching event type.
- type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
-
- /// The aggregated origin which the dispatch will take.
- type RuntimeOrigin: OriginTrait<PalletsOrigin = Self::PalletsOrigin>
- + From<Self::PalletsOrigin>
- + IsType<<Self as system::Config>::RuntimeOrigin>;
-
- /// The caller origin, overarching type of all pallets origins.
- type PalletsOrigin: From<system::RawOrigin<Self::AccountId>> + Codec + Clone + Eq + TypeInfo;
-
- type Currency: NamedReservableCurrency<Self::AccountId, ReserveIdentifier = ScheduledId>;
-
- /// The aggregated call type.
- type RuntimeCall: Parameter
- + Dispatchable<
- RuntimeOrigin = <Self as Config>::RuntimeOrigin,
- PostInfo = PostDispatchInfo,
- > + UnfilteredDispatchable<RuntimeOrigin = <Self as system::Config>::RuntimeOrigin>
- + GetDispatchInfo
- + From<system::Call<Self>>;
-
- /// The maximum weight that may be scheduled per block for any dispatchables of less
- /// priority than `schedule::HARD_DEADLINE`.
- #[pallet::constant]
- type MaximumWeight: Get<Weight>;
-
- /// Required origin to schedule or cancel calls.
- type ScheduleOrigin: EnsureOrigin<
- <Self as system::Config>::RuntimeOrigin,
- Success = ScheduledEnsureOriginSuccess<Self::AccountId>,
- >;
-
- /// Required origin to set/change calls' priority.
- type PrioritySetOrigin: EnsureOrigin<<Self as system::Config>::RuntimeOrigin>;
-
- /// Compare the privileges of origins.
- ///
- /// This will be used when canceling a task, to ensure that the origin that tries
- /// to cancel has greater or equal privileges as the origin that created the scheduled task.
- ///
- /// For simplicity the [`EqualPrivilegeOnly`](frame_support::traits::EqualPrivilegeOnly) can
- /// be used. This will only check if two given origins are equal.
- type OriginPrivilegeCmp: PrivilegeCmp<Self::PalletsOrigin>;
-
- /// The maximum number of scheduled calls in the queue for a single block.
- /// Not strictly enforced, but used for weight estimation.
- #[pallet::constant]
- type MaxScheduledPerBlock: Get<u32>;
-
- /// Weight information for extrinsics in this pallet.
- type WeightInfo: WeightInfo;
-
- /// The preimage provider with which we look up call hashes to get the call.
- type PreimageProvider: PreimageProviderAndMaybeRecipient<Self::Hash>;
-
- /// If `Some` then the number of blocks to postpone execution for when the item is delayed.
- type NoPreimagePostponement: Get<Option<Self::BlockNumber>>;
-
- /// Sponsoring function.
- // type SponsorshipHandler: SponsorshipHandler<Self::AccountId, <Self as Config>::Call>;
-
- /// The helper type used for custom transaction fee logic.
- type CallExecutor: DispatchCall<Self, H160>;
- }
-
- /// A Scheduler-Runtime interface for finer payment handling.
- pub trait DispatchCall<T: frame_system::Config + Config, SelfContainedSignedInfo> {
- /// Reserve (lock) the maximum spendings on a call, calculated from its weight and the repetition count.
- fn reserve_balance(
- id: ScheduledId,
- sponsor: <T as frame_system::Config>::AccountId,
- call: <T as Config>::RuntimeCall,
- count: u32,
- ) -> Result<(), DispatchError>;
-
- /// Unreserve (unlock) a certain amount from the payer's reserved funds, returning the change.
- fn pay_for_call(
- id: ScheduledId,
- sponsor: <T as frame_system::Config>::AccountId,
- call: <T as Config>::RuntimeCall,
- ) -> Result<u128, DispatchError>;
-
- /// Resolve the call dispatch, including any post-dispatch operations.
- fn dispatch_call(
- signer: Option<T::AccountId>,
- function: <T as Config>::RuntimeCall,
- ) -> Result<
- Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
- TransactionValidityError,
- >;
-
- /// Release unspent reserved funds in case of a schedule cancel.
- fn cancel_reserve(
- id: ScheduledId,
- sponsor: <T as frame_system::Config>::AccountId,
- ) -> Result<u128, DispatchError>;
- }
-
- /// Items to be executed, indexed by the block number that they should be executed on.
- #[pallet::storage]
- pub type Agenda<T: Config> =
- StorageMap<_, Twox64Concat, T::BlockNumber, Vec<Option<ScheduledV3Of<T>>>, ValueQuery>;
-
- /// Lookup from identity to the block number and index of the task.
- #[pallet::storage]
- pub(crate) type Lookup<T: Config> =
- StorageMap<_, Twox64Concat, ScheduledId, TaskAddress<T::BlockNumber>>;
-
- /// Events type.
- #[pallet::event]
- #[pallet::generate_deposit(pub(super) fn deposit_event)]
- pub enum Event<T: Config> {
- /// Scheduled some task.
- Scheduled { when: T::BlockNumber, index: u32 },
- /// Canceled some task.
- Canceled { when: T::BlockNumber, index: u32 },
- /// Scheduled task's priority has changed
- PriorityChanged {
- when: T::BlockNumber,
- index: u32,
- priority: schedule::Priority,
- },
- /// Dispatched some task.
- Dispatched {
- task: TaskAddress<T::BlockNumber>,
- id: Option<ScheduledId>,
- result: DispatchResult,
- },
- /// The call for the provided hash was not found so the task has been aborted.
- CallLookupFailed {
- task: TaskAddress<T::BlockNumber>,
- id: Option<ScheduledId>,
- error: LookupError,
- },
- }
-
- #[pallet::error]
- pub enum Error<T> {
- /// Failed to schedule a call
- FailedToSchedule,
- /// Cannot find the scheduled call.
- NotFound,
- /// Given target block number is in the past.
- TargetBlockNumberInPast,
- /// Reschedule failed because it does not change scheduled time.
- RescheduleNoChange,
- }
-
- #[pallet::hooks]
- impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
- /// Execute the scheduled calls
- fn on_initialize(now: T::BlockNumber) -> Weight {
- let limit = T::MaximumWeight::get();
-
- let mut queued = Agenda::<T>::take(now)
- .into_iter()
- .enumerate()
- .filter_map(|(index, s)| Some((index as u32, s?)))
- .collect::<Vec<_>>();
-
- if queued.len() as u32 > T::MaxScheduledPerBlock::get() {
- log::warn!(
- target: "runtime::scheduler",
- "Warning: This block has more items queued in Scheduler than \
- expected from the runtime configuration. An update might be needed."
- );
- }
-
- queued.sort_by_key(|(_, s)| s.priority);
-
- let next = now + One::one();
-
- let mut total_weight: Weight = T::WeightInfo::on_initialize(0);
- for (order, (index, mut s)) in queued.into_iter().enumerate() {
- let named = s.maybe_id.is_some();
-
- let (call, maybe_completed) = s.call.resolved::<T::PreimageProvider>();
- s.call = call;
-
- let resolved = if let Some(completed) = maybe_completed {
- T::PreimageProvider::unrequest_preimage(&completed);
- true
- } else {
- false
- };
- let call = match s.call.as_value().cloned() {
- Some(c) => c,
- None => {
- // Preimage not available - postpone until some block.
- total_weight.saturating_accrue(T::WeightInfo::item(false, named, None));
- if let Some(delay) = T::NoPreimagePostponement::get() {
- let until = now.saturating_add(delay);
- if let Some(ref id) = s.maybe_id {
- let index = Agenda::<T>::decode_len(until).unwrap_or(0);
- Lookup::<T>::insert(id, (until, index as u32));
- }
- Agenda::<T>::append(until, Some(s));
- } else if let Some(ref id) = s.maybe_id {
- Lookup::<T>::remove(id);
- }
- continue;
- }
- };
-
- let periodic = s.maybe_periodic.is_some();
- let call_weight = call.get_dispatch_info().weight;
- let mut item_weight = T::WeightInfo::item(periodic, named, Some(resolved));
- let origin = <<T as Config>::RuntimeOrigin as From<T::PalletsOrigin>>::from(
- s.origin.clone(),
- )
- .into();
- if ensure_signed(origin).is_ok() {
- // Weights of Signed dispatches expect their signing account to be whitelisted.
- item_weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1));
- }
-
- // We allow a scheduled call if any is true:
- // - It's priority is `HARD_DEADLINE`
- // - It does not push the weight past the limit.
- // - It is the first item in the schedule
- let hard_deadline = s.priority <= schedule::HARD_DEADLINE;
- let test_weight = total_weight
- .saturating_add(call_weight)
- .saturating_add(item_weight);
- if !hard_deadline && order > 0 && test_weight.all_gt(limit) {
- // Cannot be scheduled this block - postpone until next.
- total_weight.saturating_accrue(T::WeightInfo::item(false, named, None));
- if let Some(ref id) = s.maybe_id {
- // NOTE: We could reasonably not do this (in which case there would be one
- // block where the named and delayed item could not be referenced by name),
- // but we will do it anyway since it should be mostly free in terms of
- // weight and it is slightly cleaner.
- let index = Agenda::<T>::decode_len(next).unwrap_or(0);
- Lookup::<T>::insert(id, (next, index as u32));
- }
- Agenda::<T>::append(next, Some(s));
- continue;
- }
-
- let scheduled_origin =
- <<T as Config>::RuntimeOrigin as From<T::PalletsOrigin>>::from(
- s.origin.clone(),
- );
- let ensured_origin = T::ScheduleOrigin::ensure_origin(scheduled_origin.into());
-
- let r = match ensured_origin {
- Ok(ScheduledEnsureOriginSuccess::Root) => {
- Ok(call.dispatch_bypass_filter(frame_system::RawOrigin::Root.into()))
- }
- Ok(ScheduledEnsureOriginSuccess::Signed(sender)) => {
- // Execute transaction via chain default pipeline
- // That means dispatch will be processed like any user's extrinsic e.g. transaction fees will be taken
- T::CallExecutor::dispatch_call(Some(sender), call.clone())
- }
- Err(e) => Ok(Err(e.into())),
- };
-
- let mut actual_call_weight: Weight = item_weight;
- let result: Result<_, DispatchError> = match r {
- Ok(o) => match o {
- Ok(di) => {
- actual_call_weight = di.actual_weight.unwrap_or(item_weight);
- Ok(())
- }
- Err(err) => Err(err.error),
- },
- Err(_) => {
- log::error!(
- target: "runtime::scheduler",
- "Warning: Scheduler has failed to execute a post-dispatch transaction. \
- This block might have become invalid.");
- Err(DispatchError::CannotLookup)
- } // todo possibly force a skip/return here, do something with the error
- };
-
- total_weight.saturating_accrue(item_weight);
- total_weight.saturating_accrue(actual_call_weight);
-
- Self::deposit_event(Event::Dispatched {
- task: (now, index),
- id: s.maybe_id.clone(),
- result,
- });
-
- if let &Some((period, count)) = &s.maybe_periodic {
- if count > 1 {
- s.maybe_periodic = Some((period, count - 1));
- } else {
- s.maybe_periodic = None;
- }
- let wake = now + period;
- let is_canceled;
-
- // If scheduled is named, place its information in `Lookup`
- if let Some(ref id) = s.maybe_id {
- is_canceled = Lookup::<T>::get(id).is_none();
- let wake_index = Agenda::<T>::decode_len(wake).unwrap_or(0);
-
- if !is_canceled {
- Lookup::<T>::insert(id, (wake, wake_index as u32));
- }
- } else {
- is_canceled = false;
- }
-
- if !is_canceled {
- Agenda::<T>::append(wake, Some(s));
- }
- } else if let Some(ref id) = s.maybe_id {
- Lookup::<T>::remove(id);
- }
- }
- total_weight
- }
- }
-
- #[pallet::call]
- impl<T: Config> Pallet<T> {
- /// Schedule a named task.
- #[pallet::weight(<T as Config>::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))]
- pub fn schedule_named(
- origin: OriginFor<T>,
- id: ScheduledId,
- when: T::BlockNumber,
- maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
- priority: Option<schedule::Priority>,
- call: Box<CallOrHashOf<T>>,
- ) -> DispatchResult {
- T::ScheduleOrigin::ensure_origin(origin.clone())?;
-
- if priority.is_some() {
- T::PrioritySetOrigin::ensure_origin(origin.clone())?;
- }
-
- let origin = <T as Config>::RuntimeOrigin::from(origin);
- Self::do_schedule_named(
- id,
- DispatchTime::At(when),
- maybe_periodic,
- priority.unwrap_or(LOWEST_PRIORITY),
- origin.caller().clone(),
- *call,
- )?;
- Ok(())
- }
-
- /// Cancel a named scheduled task.
- #[pallet::weight(<T as Config>::WeightInfo::cancel_named(T::MaxScheduledPerBlock::get()))]
- pub fn cancel_named(origin: OriginFor<T>, id: ScheduledId) -> DispatchResult {
- T::ScheduleOrigin::ensure_origin(origin.clone())?;
- let origin = <T as Config>::RuntimeOrigin::from(origin);
- Self::do_cancel_named(Some(origin.caller().clone()), id)?;
- Ok(())
- }
-
- /// Schedule a named task after a delay.
- ///
- /// # <weight>
- /// Same as [`schedule_named`](Self::schedule_named).
- /// # </weight>
- #[pallet::weight(<T as Config>::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))]
- pub fn schedule_named_after(
- origin: OriginFor<T>,
- id: ScheduledId,
- after: T::BlockNumber,
- maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
- priority: Option<schedule::Priority>,
- call: Box<CallOrHashOf<T>>,
- ) -> DispatchResult {
- T::ScheduleOrigin::ensure_origin(origin.clone())?;
-
- if priority.is_some() {
- T::PrioritySetOrigin::ensure_origin(origin.clone())?;
- }
-
- let origin = <T as Config>::RuntimeOrigin::from(origin);
- Self::do_schedule_named(
- id,
- DispatchTime::After(after),
- maybe_periodic,
- priority.unwrap_or(LOWEST_PRIORITY),
- origin.caller().clone(),
- *call,
- )?;
- Ok(())
- }
-
- #[pallet::weight(<T as Config>::WeightInfo::change_named_priority(T::MaxScheduledPerBlock::get()))]
- pub fn change_named_priority(
- origin: OriginFor<T>,
- id: ScheduledId,
- priority: schedule::Priority,
- ) -> DispatchResult {
- T::PrioritySetOrigin::ensure_origin(origin.clone())?;
- let origin = <T as Config>::RuntimeOrigin::from(origin);
- Self::do_change_named_priority(origin.caller().clone(), id, priority)
- }
- }
-}
-
-impl<T: Config> Pallet<T> {
- #[cfg(feature = "try-runtime")]
- pub fn pre_migrate_to_v3() -> Result<(), &'static str> {
- Ok(())
- }
-
- #[cfg(feature = "try-runtime")]
- pub fn post_migrate_to_v3() -> Result<(), &'static str> {
- use frame_support::dispatch::GetStorageVersion;
-
- assert!(Self::current_storage_version() == 3);
- for k in Agenda::<T>::iter_keys() {
- let _ = Agenda::<T>::try_get(k).map_err(|()| "Invalid item in Agenda")?;
- }
- Ok(())
- }
-
- /// Helper to migrate scheduler when the pallet origin type has changed.
- pub fn migrate_origin<OldOrigin: Into<T::PalletsOrigin> + codec::Decode>() {
- Agenda::<T>::translate::<
- Vec<Option<Scheduled<CallOrHashOf<T>, T::BlockNumber, OldOrigin, T::AccountId>>>,
- _,
- >(|_, agenda| {
- Some(
- agenda
- .into_iter()
- .map(|schedule| {
- schedule.map(|schedule| Scheduled {
- maybe_id: schedule.maybe_id,
- priority: schedule.priority,
- call: schedule.call,
- maybe_periodic: schedule.maybe_periodic,
- origin: schedule.origin.into(),
- _phantom: Default::default(),
- })
- })
- .collect::<Vec<_>>(),
- )
- });
- }
-
- fn resolve_time(when: DispatchTime<T::BlockNumber>) -> Result<T::BlockNumber, DispatchError> {
- let now = frame_system::Pallet::<T>::block_number();
-
- let when = match when {
- DispatchTime::At(x) => x,
- // The current block has already completed it's scheduled tasks, so
- // Schedule the task at lest one block after this current block.
- DispatchTime::After(x) => now.saturating_add(x).saturating_add(One::one()),
- };
-
- if when <= now {
- return Err(Error::<T>::TargetBlockNumberInPast.into());
- }
-
- Ok(when)
- }
-
- fn do_schedule_named(
- id: ScheduledId,
- 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> {
- // ensure id it is unique
- if Lookup::<T>::contains_key(&id) {
- return Err(Error::<T>::FailedToSchedule)?;
- }
-
- 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 = Scheduled {
- maybe_id: Some(id.clone()),
- priority,
- call: call.clone(),
- maybe_periodic,
- origin: origin.clone(),
- _phantom: Default::default(),
- };
-
- // reserve balance for periodic execution
- // let sender =
- // ensure_signed(<<T as Config>::Origin as From<T::PalletsOrigin>>::from(origin).into())?;
- // let repeats = match maybe_periodic {
- // Some(p) => p.1,
- // None => 1,
- // };
- // let _ = T::CallExecutor::reserve_balance(
- // id.clone(),
- // sender,
- // call.as_value().unwrap().clone(),
- // repeats,
- // );
-
- Agenda::<T>::append(when, Some(s));
- let index = Agenda::<T>::decode_len(when).unwrap_or(1) as u32 - 1;
- let address = (when, index);
- Lookup::<T>::insert(&id, &address);
- Self::deposit_event(Event::Scheduled { when, index });
-
- Ok(address)
- }
-
- fn do_cancel_named(origin: Option<T::PalletsOrigin>, id: ScheduledId) -> DispatchResult {
- Lookup::<T>::try_mutate_exists(id, |lookup| -> DispatchResult {
- if let Some((when, index)) = lookup.take() {
- let i = index as usize;
- Agenda::<T>::try_mutate(when, |agenda| -> DispatchResult {
- if let Some(s) = agenda.get_mut(i) {
- if let (Some(ref o), Some(ref s)) = (origin.clone(), s.borrow()) {
- if matches!(
- T::OriginPrivilegeCmp::cmp_privilege(o, &s.origin),
- Some(Ordering::Less) | None
- ) {
- return Err(BadOrigin.into());
- }
- // release balance reserve
- // let sender = ensure_signed(
- // <<T as Config>::Origin as From<T::PalletsOrigin>>::from(
- // origin.unwrap(),
- // )
- // .into(),
- // )?;
- // let _ = T::CallExecutor::cancel_reserve(id, sender);
-
- s.call.ensure_unrequested::<T::PreimageProvider>();
- }
- *s = None;
- }
- Ok(())
- })?;
-
- Self::deposit_event(Event::Canceled { when, index });
- Ok(())
- } else {
- Err(Error::<T>::NotFound)?
- }
- })
- }
-
- fn do_change_named_priority(
- origin: T::PalletsOrigin,
- id: ScheduledId,
- priority: schedule::Priority,
- ) -> DispatchResult {
- match Lookup::<T>::get(id) {
- Some((when, index)) => {
- let i = index as usize;
- Agenda::<T>::try_mutate(when, |agenda| {
- if let Some(Some(s)) = agenda.get_mut(i) {
- if matches!(
- T::OriginPrivilegeCmp::cmp_privilege(&origin, &s.origin),
- Some(Ordering::Less) | None
- ) {
- return Err(BadOrigin.into());
- }
-
- s.priority = priority;
- Self::deposit_event(Event::PriorityChanged {
- when,
- index,
- priority,
- });
- }
- Ok(())
- })
- }
- None => Err(Error::<T>::NotFound.into()),
- }
- }
-}
pallets/scheduler/src/weights.rsdiffbeforeafterboth--- a/pallets/scheduler/src/weights.rs
+++ /dev/null
@@ -1,369 +0,0 @@
-// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs
-
-//! Autogenerated weights for pallet_unique_scheduler
-//!
-//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-09-14, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
-//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
-
-// Executed Command:
-// target/release/unique-collator
-// benchmark
-// pallet
-// --pallet
-// pallet-unique-scheduler
-// --wasm-execution
-// compiled
-// --extrinsic
-// *
-// --template
-// .maintain/frame-weight-template.hbs
-// --steps=50
-// --repeat=80
-// --heap-pages=4096
-// --output=./pallets/scheduler/src/weights.rs
-
-#![cfg_attr(rustfmt, rustfmt_skip)]
-#![allow(unused_parens)]
-#![allow(unused_imports)]
-#![allow(missing_docs)]
-#![allow(clippy::unnecessary_cast)]
-
-use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
-use sp_std::marker::PhantomData;
-
-/// Weight functions needed for pallet_unique_scheduler.
-pub trait WeightInfo {
- fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight;
- fn on_initialize_named_resolved(s: u32, ) -> Weight;
- fn on_initialize_periodic(s: u32, ) -> Weight;
- fn on_initialize_periodic_resolved(s: u32, ) -> Weight;
- fn on_initialize_aborted(s: u32, ) -> Weight;
- fn on_initialize_named_aborted(s: u32, ) -> Weight;
- fn on_initialize_named(s: u32, ) -> Weight;
- fn on_initialize(s: u32, ) -> Weight;
- fn on_initialize_resolved(s: u32, ) -> Weight;
- fn schedule_named(s: u32, ) -> Weight;
- fn cancel_named(s: u32, ) -> Weight;
- fn change_named_priority(s: u32, ) -> Weight;
-}
-
-/// Weights for pallet_unique_scheduler using the Substrate node and recommended hardware.
-pub struct SubstrateWeight<T>(PhantomData<T>);
-impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
- // Storage: Scheduler Agenda (r:2 w:2)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:1 w:1)
- fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {
- Weight::from_ref_time(26_641_000)
- // Standard Error: 9_000
- .saturating_add(Weight::from_ref_time(8_547_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(4 as u64))
- .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
- .saturating_add(T::DbWeight::get().writes(4 as u64))
- .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:1 w:1)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize_named_resolved(s: u32, ) -> Weight {
- Weight::from_ref_time(23_941_000)
- // Standard Error: 17_000
- .saturating_add(Weight::from_ref_time(5_282_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(4 as u64))
- .saturating_add(T::DbWeight::get().writes(4 as u64))
- .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:2 w:2)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:1 w:1)
- fn on_initialize_periodic(s: u32, ) -> Weight {
- Weight::from_ref_time(24_858_000)
- // Standard Error: 7_000
- .saturating_add(Weight::from_ref_time(8_657_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(4 as u64))
- .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
- .saturating_add(T::DbWeight::get().writes(4 as u64))
- .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:2 w:2)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:1 w:1)
- fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
- Weight::from_ref_time(25_515_000)
- // Standard Error: 14_000
- .saturating_add(Weight::from_ref_time(8_656_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(4 as u64))
- .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
- .saturating_add(T::DbWeight::get().writes(4 as u64))
- .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:2 w:2)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize_aborted(s: u32, ) -> Weight {
- Weight::from_ref_time(7_584_000)
- // Standard Error: 1_000
- .saturating_add(Weight::from_ref_time(2_065_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(2 as u64))
- .saturating_add(T::DbWeight::get().writes(2 as u64))
- .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:1 w:1)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize_named_aborted(s: u32, ) -> Weight {
- Weight::from_ref_time(25_552_000)
- // Standard Error: 4_000
- .saturating_add(Weight::from_ref_time(5_187_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(4 as u64))
- .saturating_add(T::DbWeight::get().writes(4 as u64))
- .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:2 w:2)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize_named(s: u32, ) -> Weight {
- Weight::from_ref_time(8_980_000)
- // Standard Error: 12_000
- .saturating_add(Weight::from_ref_time(2_050_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(2 as u64))
- .saturating_add(T::DbWeight::get().writes(2 as u64))
- .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:1 w:1)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize(s: u32, ) -> Weight {
- Weight::from_ref_time(24_482_000)
- // Standard Error: 4_000
- .saturating_add(Weight::from_ref_time(5_249_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(4 as u64))
- .saturating_add(T::DbWeight::get().writes(4 as u64))
- .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:1 w:1)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize_resolved(s: u32, ) -> Weight {
- Weight::from_ref_time(25_187_000)
- // Standard Error: 4_000
- .saturating_add(Weight::from_ref_time(5_216_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(4 as u64))
- .saturating_add(T::DbWeight::get().writes(4 as u64))
- .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Lookup (r:1 w:1)
- // Storage: Scheduler Agenda (r:1 w:1)
- fn schedule_named(s: u32, ) -> Weight {
- Weight::from_ref_time(17_316_000)
- // Standard Error: 3_000
- .saturating_add(Weight::from_ref_time(82_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(2 as u64))
- .saturating_add(T::DbWeight::get().writes(2 as u64))
- }
- // Storage: Scheduler Lookup (r:1 w:1)
- // Storage: Scheduler Agenda (r:1 w:1)
- fn cancel_named(s: u32, ) -> Weight {
- Weight::from_ref_time(15_652_000)
- // Standard Error: 1_000
- .saturating_add(Weight::from_ref_time(436_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(2 as u64))
- .saturating_add(T::DbWeight::get().writes(2 as u64))
- }
- // Storage: Scheduler Lookup (r:1 w:1)
- // Storage: Scheduler Agenda (r:1 w:1)
- fn change_named_priority(s: u32, ) -> Weight {
- Weight::from_ref_time(8_642_000)
- // Standard Error: 0
- .saturating_add(Weight::from_ref_time(431_000).saturating_mul(s as u64))
- .saturating_add(T::DbWeight::get().reads(2 as u64))
- .saturating_add(T::DbWeight::get().writes(2 as u64))
- }
-}
-
-// For backwards compatibility and tests
-impl WeightInfo for () {
- // Storage: Scheduler Agenda (r:2 w:2)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:1 w:1)
- fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {
- Weight::from_ref_time(26_641_000)
- // Standard Error: 9_000
- .saturating_add(Weight::from_ref_time(8_547_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(4 as u64))
- .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
- .saturating_add(RocksDbWeight::get().writes(4 as u64))
- .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:1 w:1)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize_named_resolved(s: u32, ) -> Weight {
- Weight::from_ref_time(23_941_000)
- // Standard Error: 17_000
- .saturating_add(Weight::from_ref_time(5_282_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(4 as u64))
- .saturating_add(RocksDbWeight::get().writes(4 as u64))
- .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:2 w:2)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:1 w:1)
- fn on_initialize_periodic(s: u32, ) -> Weight {
- Weight::from_ref_time(24_858_000)
- // Standard Error: 7_000
- .saturating_add(Weight::from_ref_time(8_657_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(4 as u64))
- .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
- .saturating_add(RocksDbWeight::get().writes(4 as u64))
- .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:2 w:2)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:1 w:1)
- fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
- Weight::from_ref_time(25_515_000)
- // Standard Error: 14_000
- .saturating_add(Weight::from_ref_time(8_656_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(4 as u64))
- .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
- .saturating_add(RocksDbWeight::get().writes(4 as u64))
- .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:2 w:2)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize_aborted(s: u32, ) -> Weight {
- Weight::from_ref_time(7_584_000)
- // Standard Error: 1_000
- .saturating_add(Weight::from_ref_time(2_065_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(2 as u64))
- .saturating_add(RocksDbWeight::get().writes(2 as u64))
- .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:1 w:1)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize_named_aborted(s: u32, ) -> Weight {
- Weight::from_ref_time(25_552_000)
- // Standard Error: 4_000
- .saturating_add(Weight::from_ref_time(5_187_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(4 as u64))
- .saturating_add(RocksDbWeight::get().writes(4 as u64))
- .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:2 w:2)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize_named(s: u32, ) -> Weight {
- Weight::from_ref_time(8_980_000)
- // Standard Error: 12_000
- .saturating_add(Weight::from_ref_time(2_050_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(2 as u64))
- .saturating_add(RocksDbWeight::get().writes(2 as u64))
- .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:1 w:1)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize(s: u32, ) -> Weight {
- Weight::from_ref_time(24_482_000)
- // Standard Error: 4_000
- .saturating_add(Weight::from_ref_time(5_249_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(4 as u64))
- .saturating_add(RocksDbWeight::get().writes(4 as u64))
- .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Agenda (r:1 w:1)
- // Storage: System Account (r:1 w:1)
- // Storage: System AllExtrinsicsLen (r:1 w:1)
- // Storage: System BlockWeight (r:1 w:1)
- // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
- // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
- // Storage: Scheduler Lookup (r:0 w:1)
- fn on_initialize_resolved(s: u32, ) -> Weight {
- Weight::from_ref_time(25_187_000)
- // Standard Error: 4_000
- .saturating_add(Weight::from_ref_time(5_216_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(4 as u64))
- .saturating_add(RocksDbWeight::get().writes(4 as u64))
- .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
- }
- // Storage: Scheduler Lookup (r:1 w:1)
- // Storage: Scheduler Agenda (r:1 w:1)
- fn schedule_named(s: u32, ) -> Weight {
- Weight::from_ref_time(17_316_000)
- // Standard Error: 3_000
- .saturating_add(Weight::from_ref_time(82_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(2 as u64))
- .saturating_add(RocksDbWeight::get().writes(2 as u64))
- }
- // Storage: Scheduler Lookup (r:1 w:1)
- // Storage: Scheduler Agenda (r:1 w:1)
- fn cancel_named(s: u32, ) -> Weight {
- Weight::from_ref_time(15_652_000)
- // Standard Error: 1_000
- .saturating_add(Weight::from_ref_time(436_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(2 as u64))
- .saturating_add(RocksDbWeight::get().writes(2 as u64))
- }
-
- // Storage: Scheduler Lookup (r:1 w:1)
- // Storage: Scheduler Agenda (r:1 w:1)
- fn change_named_priority(s: u32, ) -> Weight {
- Weight::from_ref_time(8_642_000)
- // Standard Error: 0
- .saturating_add(Weight::from_ref_time(431_000).saturating_mul(s as u64))
- .saturating_add(RocksDbWeight::get().reads(2 as u64))
- .saturating_add(RocksDbWeight::get().writes(2 as u64))
- }
-}
runtime/common/config/pallets/scheduler.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/scheduler.rs
+++ b/runtime/common/config/pallets/scheduler.rs
@@ -25,7 +25,7 @@
use codec::Decode;
use crate::{
runtime_common::{scheduler::SchedulerPaymentExecutor, config::substrate::RuntimeBlockWeights},
- Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, OriginCaller, Balances,
+ Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, OriginCaller,
};
use pallet_unique_scheduler_v2::ScheduledEnsureOriginSuccess;
use up_common::types::AccountId;
@@ -69,23 +69,6 @@
}
}
}
-
-// impl pallet_unique_scheduler::Config for Runtime {
-// type RuntimeEvent = RuntimeEvent;
-// type RuntimeOrigin = RuntimeOrigin;
-// type Currency = Balances;
-// type PalletsOrigin = OriginCaller;
-// type RuntimeCall = RuntimeCall;
-// type MaximumWeight = MaximumSchedulerWeight;
-// type ScheduleOrigin = EnsureSignedOrRoot<AccountId>;
-// type PrioritySetOrigin = EnsureRoot<AccountId>;
-// type MaxScheduledPerBlock = MaxScheduledPerBlock;
-// type WeightInfo = ();
-// type CallExecutor = SchedulerPaymentExecutor;
-// type OriginPrivilegeCmp = EqualOrRootOnly;
-// type PreimageProvider = ();
-// type NoPreimagePostponement = NoPreimagePostponement;
-// }
impl pallet_unique_scheduler_v2::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
runtime/common/scheduler.rsdiffbeforeafterboth--- a/runtime/common/scheduler.rs
+++ b/runtime/common/scheduler.rs
@@ -15,25 +15,21 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
use frame_support::{
- traits::NamedReservableCurrency,
dispatch::{GetDispatchInfo, PostDispatchInfo, DispatchInfo},
};
use sp_runtime::{
traits::{Dispatchable, Applyable, Member},
generic::Era,
transaction_validity::TransactionValidityError,
- DispatchErrorWithPostInfo, DispatchError,
+ DispatchErrorWithPostInfo,
};
use codec::Encode;
-use crate::{Runtime, RuntimeCall, RuntimeOrigin, Balances, maintenance};
-use up_common::types::{AccountId, Balance};
+use crate::{Runtime, RuntimeCall, RuntimeOrigin, maintenance};
+use up_common::types::AccountId;
use fp_self_contained::SelfContainedCall;
use pallet_unique_scheduler_v2::DispatchCall;
use pallet_transaction_payment::ChargeTransactionPayment;
-// type SponsorshipChargeTransactionPayment =
-// pallet_charge_transaction::ChargeTransactionPayment<Runtime>;
-
/// The SignedExtension to the basic transaction logic.
pub type SignedExtraScheduler = (
frame_system::CheckSpecVersion<Runtime>,
@@ -106,97 +102,3 @@
extrinsic.apply::<Runtime>(&dispatch_info, len)
}
}
-
-// impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
-// DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
-// where
-// <T as frame_system::Config>::Call: Member
-// + Dispatchable<Origin = Origin, Info = DispatchInfo>
-// + SelfContainedCall<SignedInfo = SelfContainedSignedInfo>
-// + GetDispatchInfo
-// + From<frame_system::Call<Runtime>>,
-// SelfContainedSignedInfo: Send + Sync + 'static,
-// Call: From<<T as frame_system::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: Option<<T as frame_system::Config>::AccountId>,
-// call: <T as pallet_unique_scheduler::Config>::Call,
-// ) -> Result<
-// Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
-// TransactionValidityError,
-// > {
-// let dispatch_info = call.get_dispatch_info();
-// let len = call.encoded_size();
-
-// let signed = match signer {
-// Some(signer) => fp_self_contained::CheckedSignature::Signed(
-// signer.clone().into(),
-// get_signed_extras(signer.into()),
-// ),
-// None => fp_self_contained::CheckedSignature::Unsigned,
-// };
-
-// let extrinsic = fp_self_contained::CheckedExtrinsic::<
-// AccountId,
-// Call,
-// SignedExtraScheduler,
-// SelfContainedSignedInfo,
-// > {
-// signed,
-// function: call.into(),
-// };
-
-// extrinsic.apply::<Runtime>(&dispatch_info, len)
-// }
-
-// fn reserve_balance(
-// id: [u8; 16],
-// sponsor: <T as frame_system::Config>::AccountId,
-// call: <T as pallet_unique_scheduler::Config>::Call,
-// count: u32,
-// ) -> Result<(), DispatchError> {
-// let dispatch_info = call.get_dispatch_info();
-// let weight: Balance =
-// SponsorshipChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0)
-// .saturating_mul(count.into());
-
-// <Balances as NamedReservableCurrency<AccountId>>::reserve_named(
-// &id,
-// &(sponsor.into()),
-// weight,
-// )
-// }
-
-// fn pay_for_call(
-// id: [u8; 16],
-// sponsor: <T as frame_system::Config>::AccountId,
-// call: <T as pallet_unique_scheduler::Config>::Call,
-// ) -> Result<u128, DispatchError> {
-// let dispatch_info = call.get_dispatch_info();
-// let weight: Balance =
-// SponsorshipChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
-// Ok(
-// <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(
-// &id,
-// &(sponsor.into()),
-// weight,
-// ),
-// )
-// }
-
-// fn cancel_reserve(
-// id: [u8; 16],
-// sponsor: <T as frame_system::Config>::AccountId,
-// ) -> Result<u128, DispatchError> {
-// Ok(
-// <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(
-// &id,
-// &(sponsor.into()),
-// u128::MAX,
-// ),
-// )
-// }
-// }
runtime/opal/Cargo.tomldiffbeforeafterboth1################################################################################2# Package34cargo-features = ["workspace-inheritance"]56[package]7authors = ['Unique Network <support@uniquenetwork.io>']8build = 'build.rs'9description = 'Opal Runtime'10edition = '2021'11homepage = 'https://unique.network'12license = 'GPLv3'13name = 'opal-runtime'14repository = 'https://github.com/UniqueNetwork/unique-chain'15version = "0.9.30"1617[package.metadata.docs.rs]18targets = ['x86_64-unknown-linux-gnu']1920[features]21default = ['std', 'opal-runtime']22runtime-benchmarks = [23 'hex-literal',24 'frame-benchmarking',25 'frame-support/runtime-benchmarks',26 'frame-system-benchmarking',27 'frame-system/runtime-benchmarks',28 'pallet-ethereum/runtime-benchmarks',29 'pallet-evm-migration/runtime-benchmarks',30 'pallet-evm-coder-substrate/runtime-benchmarks',31 'pallet-balances/runtime-benchmarks',32 'pallet-timestamp/runtime-benchmarks',33 'pallet-common/runtime-benchmarks',34 'pallet-structure/runtime-benchmarks',35 'pallet-fungible/runtime-benchmarks',36 'pallet-refungible/runtime-benchmarks',37 'pallet-nonfungible/runtime-benchmarks',38 'pallet-proxy-rmrk-core/runtime-benchmarks',39 'pallet-proxy-rmrk-equip/runtime-benchmarks',40 'pallet-foreign-assets/runtime-benchmarks',41 'pallet-unique/runtime-benchmarks',42 'pallet-inflation/runtime-benchmarks',43 'pallet-app-promotion/runtime-benchmarks',44 'pallet-unique-scheduler/runtime-benchmarks',45 'pallet-unique-scheduler-v2/runtime-benchmarks',46 'pallet-xcm/runtime-benchmarks',47 'sp-runtime/runtime-benchmarks',48 'xcm-builder/runtime-benchmarks',49 'pallet-maintenance/runtime-benchmarks',50]51try-runtime = [52 'frame-try-runtime',53 'frame-executive/try-runtime',54 'frame-support/try-runtime',55 'frame-system/try-runtime',56 'cumulus-pallet-parachain-system/try-runtime',57 'parachain-info/try-runtime',58 'pallet-aura/try-runtime',59 'cumulus-pallet-aura-ext/try-runtime',60 'pallet-balances/try-runtime',61 'pallet-randomness-collective-flip/try-runtime',62 'pallet-timestamp/try-runtime',63 'pallet-transaction-payment/try-runtime',64 'pallet-treasury/try-runtime',65 'pallet-sudo/try-runtime',66 'orml-vesting/try-runtime',67 'orml-xtokens/try-runtime',68 'orml-tokens/try-runtime',69 'cumulus-pallet-xcmp-queue/try-runtime',70 'pallet-xcm/try-runtime',71 'cumulus-pallet-xcm/try-runtime',72 'cumulus-pallet-dmp-queue/try-runtime',73 'pallet-inflation/try-runtime',74 'pallet-unique/try-runtime',75 'pallet-unique-scheduler/try-runtime',76 'pallet-configuration/try-runtime',77 'pallet-charge-transaction/try-runtime',78 'pallet-common/try-runtime',79 'pallet-fungible/try-runtime',80 'pallet-refungible/try-runtime',81 'pallet-nonfungible/try-runtime',82 'pallet-structure/try-runtime',83 'pallet-proxy-rmrk-core/try-runtime',84 'pallet-proxy-rmrk-equip/try-runtime',85 'pallet-app-promotion/try-runtime',86 'pallet-foreign-assets/try-runtime',87 'pallet-evm/try-runtime',88 'pallet-ethereum/try-runtime',89 'pallet-evm-coder-substrate/try-runtime',90 'pallet-evm-contract-helpers/try-runtime',91 'pallet-evm-transaction-payment/try-runtime',92 'pallet-evm-migration/try-runtime',93 'pallet-maintenance/try-runtime',94 'pallet-test-utils?/try-runtime',95]96std = [97 'codec/std',98 'cumulus-pallet-aura-ext/std',99 'cumulus-pallet-parachain-system/std',100 'cumulus-pallet-xcm/std',101 'cumulus-pallet-xcmp-queue/std',102 'cumulus-primitives-core/std',103 'cumulus-primitives-utility/std',104 'frame-try-runtime/std',105 'frame-executive/std',106 'frame-support/std',107 'frame-system/std',108 'frame-system-rpc-runtime-api/std',109 'pallet-aura/std',110 'pallet-balances/std',111 # 'pallet-contracts/std',112 # 'pallet-contracts-primitives/std',113 # 'pallet-contracts-rpc-runtime-api/std',114 # 'pallet-contract-helpers/std',115 'pallet-randomness-collective-flip/std',116 'pallet-sudo/std',117 'pallet-timestamp/std',118 'pallet-transaction-payment/std',119 'pallet-transaction-payment-rpc-runtime-api/std',120 'pallet-treasury/std',121 'pallet-evm/std',122 'pallet-evm-migration/std',123 'pallet-evm-contract-helpers/std',124 'pallet-evm-transaction-payment/std',125 'pallet-evm-coder-substrate/std',126 'pallet-ethereum/std',127 'pallet-base-fee/std',128 'fp-rpc/std',129 'up-rpc/std',130 'app-promotion-rpc/std',131 'fp-evm-mapping/std',132 'fp-self-contained/std',133 'parachain-info/std',134 'serde',135 'pallet-inflation/std',136 'pallet-configuration/std',137 'pallet-app-promotion/std',138 'pallet-common/std',139 'pallet-structure/std',140 'pallet-fungible/std',141 'pallet-refungible/std',142 'pallet-nonfungible/std',143 'pallet-proxy-rmrk-core/std',144 'pallet-proxy-rmrk-equip/std',145 'pallet-unique/std',146 'pallet-unique-scheduler/std',147 'pallet-unique-scheduler-v2/std',148 'pallet-charge-transaction/std',149 'up-data-structs/std',150 'sp-api/std',151 'sp-block-builder/std',152 "sp-consensus-aura/std",153 'sp-core/std',154 'sp-inherents/std',155 'sp-io/std',156 'sp-offchain/std',157 'sp-runtime/std',158 'sp-session/std',159 'sp-std/std',160 'sp-transaction-pool/std',161 'sp-version/std',162 'xcm/std',163 'xcm-builder/std',164 'xcm-executor/std',165 'up-common/std',166 'rmrk-rpc/std',167 'evm-coder/std',168 'up-sponsorship/std',169170 "orml-vesting/std",171 "orml-tokens/std",172 "orml-xtokens/std",173 "orml-traits/std",174 "pallet-foreign-assets/std",175176 'pallet-maintenance/std',177 'pallet-test-utils?/std',178]179limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']180opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion', 'foreign-assets', 'pallet-test-utils']181182refungible = []183scheduler = []184rmrk = []185foreign-assets = []186app-promotion = []187188################################################################################189# Substrate Dependencies190191[dependencies.codec]192default-features = false193features = ['derive']194package = 'parity-scale-codec'195version = '3.1.2'196197[dependencies.frame-benchmarking]198default-features = false199git = "https://github.com/paritytech/substrate"200optional = true201branch = "polkadot-v0.9.30"202203[dependencies.frame-try-runtime]204default-features = false205git = "https://github.com/paritytech/substrate"206optional = true207branch = "polkadot-v0.9.30"208209[dependencies.frame-executive]210default-features = false211git = "https://github.com/paritytech/substrate"212branch = "polkadot-v0.9.30"213214[dependencies.frame-support]215default-features = false216git = "https://github.com/paritytech/substrate"217branch = "polkadot-v0.9.30"218219[dependencies.frame-system]220default-features = false221git = "https://github.com/paritytech/substrate"222branch = "polkadot-v0.9.30"223224[dependencies.frame-system-benchmarking]225default-features = false226git = "https://github.com/paritytech/substrate"227optional = true228branch = "polkadot-v0.9.30"229230[dependencies.frame-system-rpc-runtime-api]231default-features = false232git = "https://github.com/paritytech/substrate"233branch = "polkadot-v0.9.30"234235[dependencies.hex-literal]236optional = true237version = '0.3.3'238239[dependencies.serde]240default-features = false241features = ['derive']242optional = true243version = '1.0.130'244245[dependencies.pallet-aura]246default-features = false247git = "https://github.com/paritytech/substrate"248branch = "polkadot-v0.9.30"249250[dependencies.pallet-balances]251default-features = false252git = "https://github.com/paritytech/substrate"253branch = "polkadot-v0.9.30"254255# Contracts specific packages256# [dependencies.pallet-contracts]257# git = 'https://github.com/paritytech/substrate'258# default-features = false259# branch = 'master'260# version = '4.0.0-dev'261262# [dependencies.pallet-contracts-primitives]263# git = 'https://github.com/paritytech/substrate'264# default-features = false265# branch = 'master'266# version = '4.0.0-dev'267268# [dependencies.pallet-contracts-rpc-runtime-api]269# git = 'https://github.com/paritytech/substrate'270# default-features = false271# branch = 'master'272# version = '4.0.0-dev'273274[dependencies.pallet-randomness-collective-flip]275default-features = false276git = "https://github.com/paritytech/substrate"277branch = "polkadot-v0.9.30"278279[dependencies.pallet-sudo]280default-features = false281git = "https://github.com/paritytech/substrate"282branch = "polkadot-v0.9.30"283284[dependencies.pallet-timestamp]285default-features = false286git = "https://github.com/paritytech/substrate"287branch = "polkadot-v0.9.30"288289[dependencies.pallet-transaction-payment]290default-features = false291git = "https://github.com/paritytech/substrate"292branch = "polkadot-v0.9.30"293294[dependencies.pallet-transaction-payment-rpc-runtime-api]295default-features = false296git = "https://github.com/paritytech/substrate"297branch = "polkadot-v0.9.30"298299[dependencies.pallet-treasury]300default-features = false301git = "https://github.com/paritytech/substrate"302branch = "polkadot-v0.9.30"303304[dependencies.sp-arithmetic]305default-features = false306git = "https://github.com/paritytech/substrate"307branch = "polkadot-v0.9.30"308309[dependencies.sp-api]310default-features = false311git = "https://github.com/paritytech/substrate"312branch = "polkadot-v0.9.30"313314[dependencies.sp-block-builder]315default-features = false316git = "https://github.com/paritytech/substrate"317branch = "polkadot-v0.9.30"318319[dependencies.sp-core]320default-features = false321git = "https://github.com/paritytech/substrate"322branch = "polkadot-v0.9.30"323324[dependencies.sp-consensus-aura]325default-features = false326git = "https://github.com/paritytech/substrate"327branch = "polkadot-v0.9.30"328329[dependencies.sp-inherents]330default-features = false331git = "https://github.com/paritytech/substrate"332branch = "polkadot-v0.9.30"333334[dependencies.sp-io]335default-features = false336git = "https://github.com/paritytech/substrate"337branch = "polkadot-v0.9.30"338339[dependencies.sp-offchain]340default-features = false341git = "https://github.com/paritytech/substrate"342branch = "polkadot-v0.9.30"343344[dependencies.sp-runtime]345default-features = false346git = "https://github.com/paritytech/substrate"347branch = "polkadot-v0.9.30"348349[dependencies.sp-session]350default-features = false351git = "https://github.com/paritytech/substrate"352branch = "polkadot-v0.9.30"353354[dependencies.sp-std]355default-features = false356git = "https://github.com/paritytech/substrate"357branch = "polkadot-v0.9.30"358359[dependencies.sp-transaction-pool]360default-features = false361git = "https://github.com/paritytech/substrate"362branch = "polkadot-v0.9.30"363364[dependencies.sp-version]365default-features = false366git = "https://github.com/paritytech/substrate"367branch = "polkadot-v0.9.30"368369[dependencies.smallvec]370version = '1.6.1'371372################################################################################373# Cumulus dependencies374375[dependencies.parachain-info]376default-features = false377git = "https://github.com/paritytech/cumulus"378branch = "polkadot-v0.9.30"379380[dependencies.cumulus-pallet-aura-ext]381git = "https://github.com/paritytech/cumulus"382branch = "polkadot-v0.9.30"383default-features = false384385[dependencies.cumulus-pallet-parachain-system]386git = "https://github.com/paritytech/cumulus"387branch = "polkadot-v0.9.30"388default-features = false389390[dependencies.cumulus-primitives-core]391git = "https://github.com/paritytech/cumulus"392branch = "polkadot-v0.9.30"393default-features = false394395[dependencies.cumulus-pallet-xcm]396git = "https://github.com/paritytech/cumulus"397branch = "polkadot-v0.9.30"398default-features = false399400[dependencies.cumulus-pallet-dmp-queue]401git = "https://github.com/paritytech/cumulus"402branch = "polkadot-v0.9.30"403default-features = false404405[dependencies.cumulus-pallet-xcmp-queue]406git = "https://github.com/paritytech/cumulus"407branch = "polkadot-v0.9.30"408default-features = false409410[dependencies.cumulus-primitives-utility]411git = "https://github.com/paritytech/cumulus"412branch = "polkadot-v0.9.30"413default-features = false414415[dependencies.cumulus-primitives-timestamp]416git = "https://github.com/paritytech/cumulus"417branch = "polkadot-v0.9.30"418default-features = false419420################################################################################421# Polkadot dependencies422423[dependencies.polkadot-parachain]424git = "https://github.com/paritytech/polkadot"425branch = "release-v0.9.30"426default-features = false427428[dependencies.xcm]429git = "https://github.com/paritytech/polkadot"430branch = "release-v0.9.30"431default-features = false432433[dependencies.xcm-builder]434git = "https://github.com/paritytech/polkadot"435branch = "release-v0.9.30"436default-features = false437438[dependencies.xcm-executor]439git = "https://github.com/paritytech/polkadot"440branch = "release-v0.9.30"441default-features = false442443[dependencies.pallet-xcm]444git = "https://github.com/paritytech/polkadot"445branch = "release-v0.9.30"446default-features = false447448################################################################################449# local dependencies450451[dependencies]452orml-vesting.workspace = true453orml-xtokens.workspace = true454orml-tokens.workspace = true455orml-traits.workspace = true456457log = { version = "0.4.16", default-features = false }458up-common = { path = "../../primitives/common", default-features = false }459scale-info = { version = "2.0.1", default-features = false, features = [460 "derive",461] }462derivative = "2.2.0"463pallet-unique = { path = '../../pallets/unique', default-features = false }464up-rpc = { path = "../../primitives/rpc", default-features = false }465app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }466rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }467fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }468pallet-inflation = { path = '../../pallets/inflation', default-features = false }469pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }470up-data-structs = { path = '../../primitives/data-structs', default-features = false }471pallet-configuration = { default-features = false, path = "../../pallets/configuration" }472pallet-common = { default-features = false, path = "../../pallets/common" }473pallet-structure = { default-features = false, path = "../../pallets/structure" }474pallet-fungible = { default-features = false, path = "../../pallets/fungible" }475pallet-refungible = { default-features = false, path = "../../pallets/refungible" }476pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }477pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }478pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }479pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }480pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }481pallet-unique-scheduler-v2 = { path = '../../pallets/scheduler-v2', default-features = false }482pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }483pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }484pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }485pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }486pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }487pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }488pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }489fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }490fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }491evm-coder = { default-features = false, path = '../../crates/evm-coder' }492up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' }493pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }494pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" }495496################################################################################497# Test dependencies498499pallet-test-utils = { optional = true, default-features = false, path = "../../test-pallets/utils" }500501################################################################################502# Other Dependencies503504impl-trait-for-tuples = "0.2.2"505506################################################################################507# Dev Dependencies508509[dev-dependencies.logtest]510version = "2.0.0"511512################################################################################513# Build Dependencies514515[build-dependencies.substrate-wasm-builder]516git = "https://github.com/paritytech/substrate"517branch = "polkadot-v0.9.30"1################################################################################2# Package34cargo-features = ["workspace-inheritance"]56[package]7authors = ['Unique Network <support@uniquenetwork.io>']8build = 'build.rs'9description = 'Opal Runtime'10edition = '2021'11homepage = 'https://unique.network'12license = 'GPLv3'13name = 'opal-runtime'14repository = 'https://github.com/UniqueNetwork/unique-chain'15version = "0.9.30"1617[package.metadata.docs.rs]18targets = ['x86_64-unknown-linux-gnu']1920[features]21default = ['std', 'opal-runtime']22runtime-benchmarks = [23 'hex-literal',24 'frame-benchmarking',25 'frame-support/runtime-benchmarks',26 'frame-system-benchmarking',27 'frame-system/runtime-benchmarks',28 'pallet-ethereum/runtime-benchmarks',29 'pallet-evm-migration/runtime-benchmarks',30 'pallet-evm-coder-substrate/runtime-benchmarks',31 'pallet-balances/runtime-benchmarks',32 'pallet-timestamp/runtime-benchmarks',33 'pallet-common/runtime-benchmarks',34 'pallet-structure/runtime-benchmarks',35 'pallet-fungible/runtime-benchmarks',36 'pallet-refungible/runtime-benchmarks',37 'pallet-nonfungible/runtime-benchmarks',38 'pallet-proxy-rmrk-core/runtime-benchmarks',39 'pallet-proxy-rmrk-equip/runtime-benchmarks',40 'pallet-foreign-assets/runtime-benchmarks',41 'pallet-unique/runtime-benchmarks',42 'pallet-inflation/runtime-benchmarks',43 'pallet-app-promotion/runtime-benchmarks',44 'pallet-unique-scheduler-v2/runtime-benchmarks',45 'pallet-xcm/runtime-benchmarks',46 'sp-runtime/runtime-benchmarks',47 'xcm-builder/runtime-benchmarks',48 'pallet-maintenance/runtime-benchmarks',49]50try-runtime = [51 'frame-try-runtime',52 'frame-executive/try-runtime',53 'frame-support/try-runtime',54 'frame-system/try-runtime',55 'cumulus-pallet-parachain-system/try-runtime',56 'parachain-info/try-runtime',57 'pallet-aura/try-runtime',58 'cumulus-pallet-aura-ext/try-runtime',59 'pallet-balances/try-runtime',60 'pallet-randomness-collective-flip/try-runtime',61 'pallet-timestamp/try-runtime',62 'pallet-transaction-payment/try-runtime',63 'pallet-treasury/try-runtime',64 'pallet-sudo/try-runtime',65 'orml-vesting/try-runtime',66 'orml-xtokens/try-runtime',67 'orml-tokens/try-runtime',68 'cumulus-pallet-xcmp-queue/try-runtime',69 'pallet-xcm/try-runtime',70 'cumulus-pallet-xcm/try-runtime',71 'cumulus-pallet-dmp-queue/try-runtime',72 'pallet-inflation/try-runtime',73 'pallet-unique/try-runtime',74 'pallet-configuration/try-runtime',75 'pallet-charge-transaction/try-runtime',76 'pallet-common/try-runtime',77 'pallet-fungible/try-runtime',78 'pallet-refungible/try-runtime',79 'pallet-nonfungible/try-runtime',80 'pallet-structure/try-runtime',81 'pallet-proxy-rmrk-core/try-runtime',82 'pallet-proxy-rmrk-equip/try-runtime',83 'pallet-app-promotion/try-runtime',84 'pallet-foreign-assets/try-runtime',85 'pallet-evm/try-runtime',86 'pallet-ethereum/try-runtime',87 'pallet-evm-coder-substrate/try-runtime',88 'pallet-evm-contract-helpers/try-runtime',89 'pallet-evm-transaction-payment/try-runtime',90 'pallet-evm-migration/try-runtime',91 'pallet-maintenance/try-runtime',92 'pallet-test-utils?/try-runtime',93]94std = [95 'codec/std',96 'cumulus-pallet-aura-ext/std',97 'cumulus-pallet-parachain-system/std',98 'cumulus-pallet-xcm/std',99 'cumulus-pallet-xcmp-queue/std',100 'cumulus-primitives-core/std',101 'cumulus-primitives-utility/std',102 'frame-try-runtime/std',103 'frame-executive/std',104 'frame-support/std',105 'frame-system/std',106 'frame-system-rpc-runtime-api/std',107 'pallet-aura/std',108 'pallet-balances/std',109 # 'pallet-contracts/std',110 # 'pallet-contracts-primitives/std',111 # 'pallet-contracts-rpc-runtime-api/std',112 # 'pallet-contract-helpers/std',113 'pallet-randomness-collective-flip/std',114 'pallet-sudo/std',115 'pallet-timestamp/std',116 'pallet-transaction-payment/std',117 'pallet-transaction-payment-rpc-runtime-api/std',118 'pallet-treasury/std',119 'pallet-evm/std',120 'pallet-evm-migration/std',121 'pallet-evm-contract-helpers/std',122 'pallet-evm-transaction-payment/std',123 'pallet-evm-coder-substrate/std',124 'pallet-ethereum/std',125 'pallet-base-fee/std',126 'fp-rpc/std',127 'up-rpc/std',128 'app-promotion-rpc/std',129 'fp-evm-mapping/std',130 'fp-self-contained/std',131 'parachain-info/std',132 'serde',133 'pallet-inflation/std',134 'pallet-configuration/std',135 'pallet-app-promotion/std',136 'pallet-common/std',137 'pallet-structure/std',138 'pallet-fungible/std',139 'pallet-refungible/std',140 'pallet-nonfungible/std',141 'pallet-proxy-rmrk-core/std',142 'pallet-proxy-rmrk-equip/std',143 'pallet-unique/std',144 'pallet-unique-scheduler-v2/std',145 'pallet-charge-transaction/std',146 'up-data-structs/std',147 'sp-api/std',148 'sp-block-builder/std',149 "sp-consensus-aura/std",150 'sp-core/std',151 'sp-inherents/std',152 'sp-io/std',153 'sp-offchain/std',154 'sp-runtime/std',155 'sp-session/std',156 'sp-std/std',157 'sp-transaction-pool/std',158 'sp-version/std',159 'xcm/std',160 'xcm-builder/std',161 'xcm-executor/std',162 'up-common/std',163 'rmrk-rpc/std',164 'evm-coder/std',165 'up-sponsorship/std',166167 "orml-vesting/std",168 "orml-tokens/std",169 "orml-xtokens/std",170 "orml-traits/std",171 "pallet-foreign-assets/std",172173 'pallet-maintenance/std',174 'pallet-test-utils?/std',175]176limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']177opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion', 'foreign-assets', 'pallet-test-utils']178179refungible = []180scheduler = []181rmrk = []182foreign-assets = []183app-promotion = []184185################################################################################186# Substrate Dependencies187188[dependencies.codec]189default-features = false190features = ['derive']191package = 'parity-scale-codec'192version = '3.1.2'193194[dependencies.frame-benchmarking]195default-features = false196git = "https://github.com/paritytech/substrate"197optional = true198branch = "polkadot-v0.9.30"199200[dependencies.frame-try-runtime]201default-features = false202git = "https://github.com/paritytech/substrate"203optional = true204branch = "polkadot-v0.9.30"205206[dependencies.frame-executive]207default-features = false208git = "https://github.com/paritytech/substrate"209branch = "polkadot-v0.9.30"210211[dependencies.frame-support]212default-features = false213git = "https://github.com/paritytech/substrate"214branch = "polkadot-v0.9.30"215216[dependencies.frame-system]217default-features = false218git = "https://github.com/paritytech/substrate"219branch = "polkadot-v0.9.30"220221[dependencies.frame-system-benchmarking]222default-features = false223git = "https://github.com/paritytech/substrate"224optional = true225branch = "polkadot-v0.9.30"226227[dependencies.frame-system-rpc-runtime-api]228default-features = false229git = "https://github.com/paritytech/substrate"230branch = "polkadot-v0.9.30"231232[dependencies.hex-literal]233optional = true234version = '0.3.3'235236[dependencies.serde]237default-features = false238features = ['derive']239optional = true240version = '1.0.130'241242[dependencies.pallet-aura]243default-features = false244git = "https://github.com/paritytech/substrate"245branch = "polkadot-v0.9.30"246247[dependencies.pallet-balances]248default-features = false249git = "https://github.com/paritytech/substrate"250branch = "polkadot-v0.9.30"251252# Contracts specific packages253# [dependencies.pallet-contracts]254# git = 'https://github.com/paritytech/substrate'255# default-features = false256# branch = 'master'257# version = '4.0.0-dev'258259# [dependencies.pallet-contracts-primitives]260# git = 'https://github.com/paritytech/substrate'261# default-features = false262# branch = 'master'263# version = '4.0.0-dev'264265# [dependencies.pallet-contracts-rpc-runtime-api]266# git = 'https://github.com/paritytech/substrate'267# default-features = false268# branch = 'master'269# version = '4.0.0-dev'270271[dependencies.pallet-randomness-collective-flip]272default-features = false273git = "https://github.com/paritytech/substrate"274branch = "polkadot-v0.9.30"275276[dependencies.pallet-sudo]277default-features = false278git = "https://github.com/paritytech/substrate"279branch = "polkadot-v0.9.30"280281[dependencies.pallet-timestamp]282default-features = false283git = "https://github.com/paritytech/substrate"284branch = "polkadot-v0.9.30"285286[dependencies.pallet-transaction-payment]287default-features = false288git = "https://github.com/paritytech/substrate"289branch = "polkadot-v0.9.30"290291[dependencies.pallet-transaction-payment-rpc-runtime-api]292default-features = false293git = "https://github.com/paritytech/substrate"294branch = "polkadot-v0.9.30"295296[dependencies.pallet-treasury]297default-features = false298git = "https://github.com/paritytech/substrate"299branch = "polkadot-v0.9.30"300301[dependencies.sp-arithmetic]302default-features = false303git = "https://github.com/paritytech/substrate"304branch = "polkadot-v0.9.30"305306[dependencies.sp-api]307default-features = false308git = "https://github.com/paritytech/substrate"309branch = "polkadot-v0.9.30"310311[dependencies.sp-block-builder]312default-features = false313git = "https://github.com/paritytech/substrate"314branch = "polkadot-v0.9.30"315316[dependencies.sp-core]317default-features = false318git = "https://github.com/paritytech/substrate"319branch = "polkadot-v0.9.30"320321[dependencies.sp-consensus-aura]322default-features = false323git = "https://github.com/paritytech/substrate"324branch = "polkadot-v0.9.30"325326[dependencies.sp-inherents]327default-features = false328git = "https://github.com/paritytech/substrate"329branch = "polkadot-v0.9.30"330331[dependencies.sp-io]332default-features = false333git = "https://github.com/paritytech/substrate"334branch = "polkadot-v0.9.30"335336[dependencies.sp-offchain]337default-features = false338git = "https://github.com/paritytech/substrate"339branch = "polkadot-v0.9.30"340341[dependencies.sp-runtime]342default-features = false343git = "https://github.com/paritytech/substrate"344branch = "polkadot-v0.9.30"345346[dependencies.sp-session]347default-features = false348git = "https://github.com/paritytech/substrate"349branch = "polkadot-v0.9.30"350351[dependencies.sp-std]352default-features = false353git = "https://github.com/paritytech/substrate"354branch = "polkadot-v0.9.30"355356[dependencies.sp-transaction-pool]357default-features = false358git = "https://github.com/paritytech/substrate"359branch = "polkadot-v0.9.30"360361[dependencies.sp-version]362default-features = false363git = "https://github.com/paritytech/substrate"364branch = "polkadot-v0.9.30"365366[dependencies.smallvec]367version = '1.6.1'368369################################################################################370# Cumulus dependencies371372[dependencies.parachain-info]373default-features = false374git = "https://github.com/paritytech/cumulus"375branch = "polkadot-v0.9.30"376377[dependencies.cumulus-pallet-aura-ext]378git = "https://github.com/paritytech/cumulus"379branch = "polkadot-v0.9.30"380default-features = false381382[dependencies.cumulus-pallet-parachain-system]383git = "https://github.com/paritytech/cumulus"384branch = "polkadot-v0.9.30"385default-features = false386387[dependencies.cumulus-primitives-core]388git = "https://github.com/paritytech/cumulus"389branch = "polkadot-v0.9.30"390default-features = false391392[dependencies.cumulus-pallet-xcm]393git = "https://github.com/paritytech/cumulus"394branch = "polkadot-v0.9.30"395default-features = false396397[dependencies.cumulus-pallet-dmp-queue]398git = "https://github.com/paritytech/cumulus"399branch = "polkadot-v0.9.30"400default-features = false401402[dependencies.cumulus-pallet-xcmp-queue]403git = "https://github.com/paritytech/cumulus"404branch = "polkadot-v0.9.30"405default-features = false406407[dependencies.cumulus-primitives-utility]408git = "https://github.com/paritytech/cumulus"409branch = "polkadot-v0.9.30"410default-features = false411412[dependencies.cumulus-primitives-timestamp]413git = "https://github.com/paritytech/cumulus"414branch = "polkadot-v0.9.30"415default-features = false416417################################################################################418# Polkadot dependencies419420[dependencies.polkadot-parachain]421git = "https://github.com/paritytech/polkadot"422branch = "release-v0.9.30"423default-features = false424425[dependencies.xcm]426git = "https://github.com/paritytech/polkadot"427branch = "release-v0.9.30"428default-features = false429430[dependencies.xcm-builder]431git = "https://github.com/paritytech/polkadot"432branch = "release-v0.9.30"433default-features = false434435[dependencies.xcm-executor]436git = "https://github.com/paritytech/polkadot"437branch = "release-v0.9.30"438default-features = false439440[dependencies.pallet-xcm]441git = "https://github.com/paritytech/polkadot"442branch = "release-v0.9.30"443default-features = false444445################################################################################446# local dependencies447448[dependencies]449orml-vesting.workspace = true450orml-xtokens.workspace = true451orml-tokens.workspace = true452orml-traits.workspace = true453454log = { version = "0.4.16", default-features = false }455up-common = { path = "../../primitives/common", default-features = false }456scale-info = { version = "2.0.1", default-features = false, features = [457 "derive",458] }459derivative = "2.2.0"460pallet-unique = { path = '../../pallets/unique', default-features = false }461up-rpc = { path = "../../primitives/rpc", default-features = false }462app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }463rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }464fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }465pallet-inflation = { path = '../../pallets/inflation', default-features = false }466pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }467up-data-structs = { path = '../../primitives/data-structs', default-features = false }468pallet-configuration = { default-features = false, path = "../../pallets/configuration" }469pallet-common = { default-features = false, path = "../../pallets/common" }470pallet-structure = { default-features = false, path = "../../pallets/structure" }471pallet-fungible = { default-features = false, path = "../../pallets/fungible" }472pallet-refungible = { default-features = false, path = "../../pallets/refungible" }473pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }474pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }475pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }476pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }477pallet-unique-scheduler-v2 = { path = '../../pallets/scheduler-v2', default-features = false }478pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }479pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }480pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }481pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }482pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }483pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }484pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }485fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }486fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }487evm-coder = { default-features = false, path = '../../crates/evm-coder' }488up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' }489pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }490pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" }491492################################################################################493# Test dependencies494495pallet-test-utils = { optional = true, default-features = false, path = "../../test-pallets/utils" }496497################################################################################498# Other Dependencies499500impl-trait-for-tuples = "0.2.2"501502################################################################################503# Dev Dependencies504505[dev-dependencies.logtest]506version = "2.0.0"507508################################################################################509# Build Dependencies510511[build-dependencies.substrate-wasm-builder]512git = "https://github.com/paritytech/substrate"513branch = "polkadot-v0.9.30"runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -40,7 +40,6 @@
'pallet-unique/runtime-benchmarks',
'pallet-foreign-assets/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
- 'pallet-unique-scheduler/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
'sp-runtime/runtime-benchmarks',
'xcm-builder/runtime-benchmarks',
@@ -70,7 +69,6 @@
'cumulus-pallet-dmp-queue/try-runtime',
'pallet-inflation/try-runtime',
'pallet-unique/try-runtime',
- 'pallet-unique-scheduler/try-runtime',
'pallet-configuration/try-runtime',
'pallet-charge-transaction/try-runtime',
'pallet-common/try-runtime',
@@ -139,7 +137,6 @@
'pallet-proxy-rmrk-core/std',
'pallet-proxy-rmrk-equip/std',
'pallet-unique/std',
- 'pallet-unique-scheduler/std',
'pallet-charge-transaction/std',
'up-data-structs/std',
'sp-api/std',
@@ -475,7 +472,6 @@
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-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.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -40,7 +40,6 @@
'pallet-unique/runtime-benchmarks',
'pallet-foreign-assets/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
- 'pallet-unique-scheduler/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
'sp-runtime/runtime-benchmarks',
'xcm-builder/runtime-benchmarks',
@@ -71,7 +70,6 @@
'cumulus-pallet-dmp-queue/try-runtime',
'pallet-inflation/try-runtime',
'pallet-unique/try-runtime',
- 'pallet-unique-scheduler/try-runtime',
'pallet-configuration/try-runtime',
'pallet-charge-transaction/try-runtime',
'pallet-common/try-runtime',
@@ -140,7 +138,6 @@
'pallet-proxy-rmrk-core/std',
'pallet-proxy-rmrk-equip/std',
'pallet-unique/std',
- 'pallet-unique-scheduler/std',
'pallet-charge-transaction/std',
'up-data-structs/std',
'sp-api/std',
@@ -469,7 +466,6 @@
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-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.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }