difftreelog
Typos fixed
in: master
1 file changed
pallets/scheduler/src/lib.rsdiffbeforeafterboth46//! If a call is scheduled using proxy or whatever mecanism which adds filter,46//! If a call is scheduled using proxy or whatever mecanism which adds filter,47//! then those filter will not be used when dispatching the schedule call.47//! then those filter will not be used when dispatching the schedule call.48//!48//!49//! The scheduler is designed for deferred transaction calls by block number.50//! Any user can book a call of a certain transaction to a specific block number.51//! Also possible to book a call with a certain frequency.52//! Key differences from original pallet:53//! Id restricted by 16 bytes54//! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block55//! Maybe_periodic limit is 100 calls56//! Any account allowed to schedule any calls. Account withdraw implemented through default transaction logic.57//! 58//! ## Interface49//! ## Interface59//!50//!60//! ### Dispatchable Functions51//! ### Dispatchable Functions152143153pub use preimage_provider::PreimageProviderAndMaybeRecipient;144pub use preimage_provider::PreimageProviderAndMaybeRecipient;154145155/// Weight templates for calculating actual fees156pub(crate) trait MarginalWeightInfo: WeightInfo {146pub(crate) trait MarginalWeightInfo: WeightInfo {157 fn item(periodic: bool, named: bool, resolved: Option<bool>) -> Weight {147 fn item(periodic: bool, named: bool, resolved: Option<bool>) -> Weight {158 match (periodic, named, resolved) {148 match (periodic, named, resolved) {259 /// If `Some` then the number of blocks to postpone execution for when the item is delayed.249 /// If `Some` then the number of blocks to postpone execution for when the item is delayed.260 type NoPreimagePostponement: Get<Option<Self::BlockNumber>>;250 type NoPreimagePostponement: Get<Option<Self::BlockNumber>>;261251262 /// Sponsoring function. In this version sposorship is disabled252 /// Sponsoring function.263 // type SponsorshipHandler: SponsorshipHandler<Self::AccountId, <Self as Config>::Call>;253 // type SponsorshipHandler: SponsorshipHandler<Self::AccountId, <Self as Config>::Call>;264254265 /// The helper type used for custom transaction fee logic.255 /// The helper type used for custom transaction fee logic.268258269 /// A Scheduler-Runtime interface for finer payment handling.259 /// A Scheduler-Runtime interface for finer payment handling.270 pub trait DispatchCall<T: frame_system::Config + Config, SelfContainedSignedInfo> {260 pub trait DispatchCall<T: frame_system::Config + Config, SelfContainedSignedInfo> {271 /// Lock balance required for transaction payment272 fn reserve_balance(261 fn reserve_balance(273 id: ScheduledId,262 id: ScheduledId,274 sponsor: <T as frame_system::Config>::AccountId,263 sponsor: <T as frame_system::Config>::AccountId,275 call: <T as Config>::Call,264 call: <T as Config>::Call,276 count: u32,265 count: u32,277 ) -> Result<(), DispatchError>;266 ) -> Result<(), DispatchError>;278267279 /// Unlock centain amount from payer 280 fn pay_for_call(268 fn pay_for_call(281 id: ScheduledId,269 id: ScheduledId,282 sponsor: <T as frame_system::Config>::AccountId,270 sponsor: <T as frame_system::Config>::AccountId,292 TransactionValidityError,280 TransactionValidityError,293 >;281 >;294282295 /// Cancel schedule reservation and unlock balance296 fn cancel_reserve(283 fn cancel_reserve(297 id: ScheduledId,284 id: ScheduledId,298 sponsor: <T as frame_system::Config>::AccountId,285 sponsor: <T as frame_system::Config>::AccountId,436 continue;423 continue;437 }424 }438425439 // Sender is the account who signed transaction440 let sender = ensure_signed(426 let sender = ensure_signed(441 <<T as Config>::Origin as From<T::PalletsOrigin>>::from(s.origin.clone())427 <<T as Config>::Origin as From<T::PalletsOrigin>>::from(s.origin.clone())442 .into(),428 .into(),452 // );438 // );453 // }439 // }454440455 // Execute transaction via chain default pipeline456 let r = T::CallExecutor::dispatch_call(sender, call.clone());441 let r = T::CallExecutor::dispatch_call(sender, call.clone());457442458 let mut actual_call_weight: Weight = item_weight;443 let mut actual_call_weight: Weight = item_weight;497 Agenda::<T>::append(wake, Some(s));482 Agenda::<T>::append(wake, Some(s));498 }483 }499 }484 }500 /// Weight should be 0, because transaction already paid 501 0485 0486 //total_weight502 }487 }503 }488 }504489