git.delta.rocks / unique-network / refs/commits / 18b6b278d214

difftreelog

feature: add benchmarks for scheduler v2

Daniel Shiposha2022-10-19parent: #67ae8db.patch.diff
in: master

3 files changed

addedpallets/scheduler-v2/src/benchmarking.rsdiffbeforeafterboth

no changes

modifiedpallets/scheduler-v2/src/lib.rsdiffbeforeafterboth
143 }143 }
144 }144 }
145
146 /// Returns whether the image will require a lookup to be peeked.
147 pub fn lookup_needed(&self) -> bool {
148 match self {
149 Self::Inline(_) => false,
150 Self::PreimageLookup { .. } => true,
151 }
152 }
145153
146 fn decode(mut data: &[u8]) -> Result<<T as Config>::Call, DispatchError> {154 fn decode(mut data: &[u8]) -> Result<<T as Config>::Call, DispatchError> {
147 <T as Config>::Call::decode(&mut data)155 <T as Config>::Call::decode(&mut data)
154162
155 fn peek(call: &ScheduledCall<T>) -> Result<(<T as pallet::Config>::Call, Option<u32>), DispatchError>;163 fn peek(call: &ScheduledCall<T>) -> Result<(<T as pallet::Config>::Call, Option<u32>), DispatchError>;
164
165 /// Convert the given scheduled `call` value back into its original instance. If successful,
166 /// `drop` any data backing it. This will not break the realisability of independently
167 /// created instances of `ScheduledCall` which happen to have identical data.
168 fn realize(call: &ScheduledCall<T>) -> Result<(<T as pallet::Config>::Call, Option<u32>), DispatchError>;
156}169}
157170
158impl<T: Config, PP: PreimageRecipient<T::Hash>> SchedulerPreimages<T> for PP {171impl<T: Config, PP: PreimageRecipient<T::Hash>> SchedulerPreimages<T> for PP {
176 }189 }
177 }190 }
191
192 fn realize(call: &ScheduledCall<T>) -> Result<(<T as pallet::Config>::Call, Option<u32>), DispatchError> {
193 let r = Self::peek(call)?;
194 Self::drop(call);
195 Ok(r)
196 }
178}197}
179198
180pub type TaskName = [u8; 32];199pub type TaskName = [u8; 32];
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
42 'pallet-inflation/runtime-benchmarks',42 'pallet-inflation/runtime-benchmarks',
43 'pallet-app-promotion/runtime-benchmarks',43 'pallet-app-promotion/runtime-benchmarks',
44 'pallet-unique-scheduler/runtime-benchmarks',44 'pallet-unique-scheduler/runtime-benchmarks',
45 'pallet-unique-scheduler-v2/runtime-benchmarks',
45 'pallet-xcm/runtime-benchmarks',46 'pallet-xcm/runtime-benchmarks',
46 'sp-runtime/runtime-benchmarks',47 'sp-runtime/runtime-benchmarks',
47 'xcm-builder/runtime-benchmarks',48 'xcm-builder/runtime-benchmarks',