git.delta.rocks / unique-network / refs/commits / cbfc871bee98

difftreelog

feat(collator-selection) benchmarks for collator-selection and data-management + cargo fmt

Fahrrader2022-12-27parent: #9206f91.patch.diff
in: master

21 files changed

modifiedMakefilediffbeforeafterboth
127127
128.PHONY: bench-foreign-assets128.PHONY: bench-foreign-assets
129bench-foreign-assets:129bench-foreign-assets:
130 make _bench PALLET=foreign-assets 130 make _bench PALLET=foreign-assets
131131
132.PHONY: bench-collator-selection
133bench-collator-selection:
134 make _bench PALLET=collator-selection
135
132.PHONY: bench-app-promotion136.PHONY: bench-app-promotion
133bench-app-promotion:137bench-app-promotion:
134 make _bench PALLET=app-promotion PALLET_DIR=app-promotion138 make _bench PALLET=app-promotion PALLET_DIR=app-promotion
135 139
136.PHONY: bench140.PHONY: bench
137<<<<<<< HEAD
138bench: bench-data-management bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equip bench-foreign-assets
139=======
140# Disabled: bench-scheduler, bench-rmrk-core, bench-rmrk-equip141# Disabled: bench-scheduler, bench-rmrk-core, bench-rmrk-equip
141bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-foreign-assets142bench: bench-data-management bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-foreign-assets
142>>>>>>> develop
143143
modifiedpallets/collator-selection/src/benchmarking.rsdiffbeforeafterboth
45use frame_system::{EventRecord, RawOrigin};45use frame_system::{EventRecord, RawOrigin};
46use pallet_authorship::EventHandler;46use pallet_authorship::EventHandler;
47use pallet_session::{self as session, SessionManager};47use pallet_session::{self as session, SessionManager};
48use sp_std::prelude::*;48use pallet_configuration::{
49
50pub type BalanceOf<T> =49 self as configuration, BalanceOf,
51 <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;50 CollatorSelectionDesiredCollatorsOverride as DesiredCollators,
51 CollatorSelectionLicenseBondOverride as LicenseBond,
52};
53use sp_std::prelude::*;
54
55/*pub type BalanceOf<T> =
56<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;*/
5257
53const SEED: u32 = 0;58const SEED: u32 = 0;
5459
111 validators.into_iter().map(|(who, _)| who).collect()116 validators.into_iter().map(|(who, _)| who).collect()
112}117}
113118
114fn register_candidates<T: Config>(count: u32) {119fn register_candidates<T: Config + configuration::Config>(count: u32) {
115 let candidates = (0..count)120 let candidates = (0..count)
116 .map(|c| account("candidate", c, SEED))121 .map(|c| account("candidate", c, SEED))
117 .collect::<Vec<_>>();122 .collect::<Vec<_>>();
122127
123 for who in candidates {128 for who in candidates {
124 T::Currency::make_free_balance_be(&who, <LicenseBond<T>>::get() * 2u32.into());129 T::Currency::make_free_balance_be(&who, <LicenseBond<T>>::get() * 2u32.into());
130 <CollatorSelection<T>>::get_license(RawOrigin::Signed(who.clone()).into()).unwrap();
125 <CollatorSelection<T>>::register_as_candidate(RawOrigin::Signed(who).into()).unwrap();131 <CollatorSelection<T>>::onboard(RawOrigin::Signed(who).into()).unwrap();
126 }132 }
127}133}
128134
129benchmarks! {135benchmarks! {
130 where_clause { where T: pallet_authorship::Config + session::Config }136 where_clause { where T: pallet_authorship::Config + session::Config + configuration::Config }
131137
132 set_invulnerables {138 add_invulnerable {
133 let b in 1 .. T::MaxCollators::get();139 let b in 1 .. T::MaxCollators::get();
134 let new_invulnerables = register_validators::<T>(b);140 let new_invulnerable = register_validators::<T>(b)[0].clone();
135 let origin = T::UpdateOrigin::successful_origin();141 let origin = T::UpdateOrigin::successful_origin();
136 }: {142 }: {
137 assert_ok!(143 assert_ok!(
138 <CollatorSelection<T>>::set_invulnerables(origin, new_invulnerables.clone())144 <CollatorSelection<T>>::add_invulnerable(origin, new_invulnerable.clone())
139 );145 );
140 }146 }
141 verify {147 verify {
142 assert_last_event::<T>(Event::NewInvulnerables{invulnerables: new_invulnerables}.into());148 assert_last_event::<T>(Event::InvulnerableAdded{invulnerable: new_invulnerable}.into());
143 }149 }
144150
145 set_desired_collators {151 remove_invulnerable {
146 let max: u32 = 999;152 let b in 1 .. T::MaxCollators::get();
153 let new_invulnerable = register_validators::<T>(b)[0].clone();
147 let origin = T::UpdateOrigin::successful_origin();154 let origin = T::UpdateOrigin::successful_origin();
155 assert_ok!(
156 <CollatorSelection<T>>::add_invulnerable(origin.clone(), new_invulnerable.clone())
157 );
148 }: {158 }: {
149 assert_ok!(159 assert_ok!(
150 <CollatorSelection<T>>::set_desired_collators(origin, max.clone())160 <CollatorSelection<T>>::remove_invulnerable(origin, new_invulnerable.clone())
151 );161 );
152 }162 }
153 verify {163 verify {
154 assert_last_event::<T>(Event::NewDesiredCollators{desired_collators: max}.into());164 assert_last_event::<T>(Event::InvulnerableRemoved{invulnerable: new_invulnerable}.into());
155 }165 }
156166
157 set_license_bond {167 /*set_desired_collators {
168 let max: u32 = 999;
169 let origin = T::UpdateOrigin::successful_origin();
170 }: {
171 assert_ok!(
172 <CollatorSelection<T>>::set_desired_collators(origin, max.clone())
173 );
174 }
175 verify {
176 assert_last_event::<T>(Event::NewDesiredCollators{desired_collators: max}.into());
177 }
178
179 set_license_bond {
180 let bond_amount: BalanceOf<T> = T::Currency::minimum_balance() * 10u32.into();
181 let origin = T::UpdateOrigin::successful_origin();
182 }: {
183 assert_ok!(
184 <CollatorSelection<T>>::set_license_bond(origin, bond_amount.clone())
185 );
186 }
187 verify {
188 assert_last_event::<T>(Event::NewLicenseBond{bond_amount}.into());
189 }*/
190
191 get_license {
158 let bond_amount: BalanceOf<T> = T::Currency::minimum_balance() * 10u32.into();192 let c in 1 .. T::MaxCollators::get();
193
194 <LicenseBond<T>>::put(T::Currency::minimum_balance());
195 <DesiredCollators<T>>::put(c + 1);
196
197 register_validators::<T>(c);
198 register_candidates::<T>(c);
199
200 let caller: T::AccountId = whitelisted_caller();
201 let bond: BalanceOf<T> = T::Currency::minimum_balance() * 2u32.into();
159 let origin = T::UpdateOrigin::successful_origin();202 T::Currency::make_free_balance_be(&caller, bond.clone());
160 }: {203
161 assert_ok!(
162 <CollatorSelection<T>>::set_license_bond(origin, bond_amount.clone())204 <session::Pallet<T>>::set_keys(
205 RawOrigin::Signed(caller.clone()).into(),
206 keys::<T>(c + 1),
207 Vec::new()
163 );208 ).unwrap();
164 }209
210 }: _(RawOrigin::Signed(caller.clone()))
165 verify {211 verify {
166 assert_last_event::<T>(Event::NewLicenseBond{bond_amount}.into());212 assert_last_event::<T>(Event::LicenseObtained{account_id: caller, deposit: bond / 2u32.into()}.into());
167 }213 }
168214
169 // worse case is when we have all the max-candidate slots filled except one, and we fill that215 // worst case is when we have all the max-candidate slots filled except one, and we fill that
170 // one.216 // one.
171 register_as_candidate {217 onboard {
172 let c in 1 .. T::MaxCollators::get();218 let c in 1 .. T::MaxCollators::get();
173219
174 <LicenseBond<T>>::put(T::Currency::minimum_balance());220 <LicenseBond<T>>::put(T::Currency::minimum_balance());
181 let bond: BalanceOf<T> = T::Currency::minimum_balance() * 2u32.into();227 let bond: BalanceOf<T> = T::Currency::minimum_balance() * 2u32.into();
182 T::Currency::make_free_balance_be(&caller, bond.clone());228 T::Currency::make_free_balance_be(&caller, bond.clone());
229
230 let origin = RawOrigin::Signed(caller.clone());
183231
184 <session::Pallet<T>>::set_keys(232 <session::Pallet<T>>::set_keys(
185 RawOrigin::Signed(caller.clone()).into(),233 origin.clone().into(),
186 keys::<T>(c + 1),234 keys::<T>(c + 1),
187 Vec::new()235 Vec::new()
188 ).unwrap();236 ).unwrap();
189237
238 assert_ok!(
239 <CollatorSelection<T>>::get_license(origin.clone().into())
240 );
190 }: _(RawOrigin::Signed(caller.clone()))241 }: _(origin)
191 verify {242 verify {
192 assert_last_event::<T>(Event::CandidateAdded{account_id: caller, deposit: bond / 2u32.into()}.into());243 assert_last_event::<T>(Event::CandidateAdded{account_id: caller}.into());
193 }244 }
194245
195 // worse case is the last candidate leaving.246 // worst case is the last candidate leaving.
196 leave_intent {247 offboard {
197 let c in (T::MinCandidates::get() + 1) .. T::MaxCollators::get();248 let c in 1 .. T::MaxCollators::get();
198 <LicenseBond<T>>::put(T::Currency::minimum_balance());249 <LicenseBond<T>>::put(T::Currency::minimum_balance());
199 <DesiredCollators<T>>::put(c);250 <DesiredCollators<T>>::put(c);
200251
201 register_validators::<T>(c);252 register_validators::<T>(c);
202 register_candidates::<T>(c);253 register_candidates::<T>(c);
203254
204 let leaving = <Candidates<T>>::get().last().unwrap().who.clone();255 let leaving = <Candidates<T>>::get().last().unwrap().clone();
205 whitelist!(leaving);256 whitelist!(leaving);
206 }: _(RawOrigin::Signed(leaving.clone()))257 }: _(RawOrigin::Signed(leaving.clone()))
258 verify {
259 assert_last_event::<T>(Event::CandidateRemoved{account_id: leaving}.into());
260 }
261
262 // worst case is the last candidate leaving.
263 release_license {
264 let c in 1 .. T::MaxCollators::get();
265 let bond = T::Currency::minimum_balance();
266 <LicenseBond<T>>::put(bond);
267 <DesiredCollators<T>>::put(c);
268
269 register_validators::<T>(c);
270 register_candidates::<T>(c);
271
272 let leaving = <Candidates<T>>::get().last().unwrap().clone();
273 whitelist!(leaving);
274 }: _(RawOrigin::Signed(leaving.clone()))
207 verify {275 verify {
208 // todo:collator verify these
209 assert_last_event::<T>(Event::CandidateRemoved{account_id: leaving, deposit_returned: bond / 2u32.into() }.into());276 assert_last_event::<T>(Event::LicenseReleased{account_id: leaving, deposit_returned: bond}.into());
210 }277 }
278
279 // worst case is the last candidate leaving.
280 force_release_license {
281 let c in 1 .. T::MaxCollators::get();
282 let bond = T::Currency::minimum_balance();
283 <LicenseBond<T>>::put(bond);
284 <DesiredCollators<T>>::put(c);
285
286 register_validators::<T>(c);
287 register_candidates::<T>(c);
288
289 let leaving = <Candidates<T>>::get().last().unwrap().clone();
290 whitelist!(leaving);
291 let origin = T::UpdateOrigin::successful_origin();
292 }: {
293 assert_ok!(
294 <CollatorSelection<T>>::force_release_license(origin, leaving.clone())
295 );
296 }
297 verify {
298 assert_last_event::<T>(Event::LicenseReleased{account_id: leaving, deposit_returned: bond}.into());
299 }
211300
212 // worse case is paying a non-existing candidate account.301 // worst case is paying a non-existing candidate account.
213 note_author {302 note_author {
214 <LicenseBond<T>>::put(T::Currency::minimum_balance());303 <LicenseBond<T>>::put(T::Currency::minimum_balance());
215 T::Currency::make_free_balance_be(304 T::Currency::make_free_balance_be(
247 let non_removals = c.saturating_sub(r);336 let non_removals = c.saturating_sub(r);
248337
249 for i in 0..c {338 for i in 0..c {
250 <LastAuthoredBlock<T>>::insert(candidates[i as usize].who.clone(), zero_block);339 <LastAuthoredBlock<T>>::insert(candidates[i as usize].clone(), zero_block);
251 }340 }
252341
253 if non_removals > 0 {342 if non_removals > 0 {
254 for i in 0..non_removals {343 for i in 0..non_removals {
255 <LastAuthoredBlock<T>>::insert(candidates[i as usize].who.clone(), new_block);344 <LastAuthoredBlock<T>>::insert(candidates[i as usize].clone(), new_block);
256 }345 }
257 } else {346 } else {
258 for i in 0..c {347 for i in 0..c {
259 <LastAuthoredBlock<T>>::insert(candidates[i as usize].who.clone(), new_block);348 <LastAuthoredBlock<T>>::insert(candidates[i as usize].clone(), new_block);
260 }349 }
261 }350 }
262351
268 }: {357 }: {
269 <CollatorSelection<T> as SessionManager<_>>::new_session(0)358 <CollatorSelection<T> as SessionManager<_>>::new_session(0)
270 } verify {359 } verify {
271 if c > r && non_removals >= T::MinCandidates::get() {360 if c > r {
272 assert!(<Candidates<T>>::get().len() < pre_length);361 assert!(<Candidates<T>>::get().len() < pre_length);
273 } else if c > r && non_removals < T::MinCandidates::get() {362 } else {
274 assert!(<Candidates<T>>::get().len() == T::MinCandidates::get() as usize);
275 } else {
276 assert!(<Candidates<T>>::get().len() == pre_length);363 assert!(<Candidates<T>>::get().len() == pre_length);
277 }364 }
278 }365 }
modifiedpallets/collator-selection/src/lib.rsdiffbeforeafterboth
235 account_id: T::AccountId,235 account_id: T::AccountId,
236 deposit: BalanceOf<T>,236 deposit: BalanceOf<T>,
237 },237 },
238 LicenseForfeited {238 LicenseReleased {
239 account_id: T::AccountId,239 account_id: T::AccountId,
240 deposit_returned: BalanceOf<T>,240 deposit_returned: BalanceOf<T>,
241 },241 },
285 impl<T: Config> Pallet<T> {285 impl<T: Config> Pallet<T> {
286 /// Add a collator to the list of invulnerable (fixed) collators.286 /// Add a collator to the list of invulnerable (fixed) collators.
287 #[pallet::call_index(0)]287 #[pallet::call_index(0)]
288 #[pallet::weight(T::WeightInfo::set_invulnerables(1u32))] // todo:collator weight288 #[pallet::weight(T::WeightInfo::add_invulnerable(T::MaxCollators::get()))] // todo:collator weight
289 pub fn add_invulnerable(289 pub fn add_invulnerable(
290 origin: OriginFor<T>,290 origin: OriginFor<T>,
291 new: T::AccountId,291 new: T::AccountId,
315315
316 /// Remove a collator from the list of invulnerable (fixed) collators.316 /// Remove a collator from the list of invulnerable (fixed) collators.
317 #[pallet::call_index(1)]317 #[pallet::call_index(1)]
318 #[pallet::weight(T::WeightInfo::set_invulnerables(1))] // todo:collator weight318 #[pallet::weight(T::WeightInfo::remove_invulnerable(T::MaxCollators::get()))] // todo:collator weight
319 pub fn remove_invulnerable(319 pub fn remove_invulnerable(
320 origin: OriginFor<T>,320 origin: OriginFor<T>,
321 who: T::AccountId,321 who: T::AccountId,
344 ///344 ///
345 /// This call is not available to `Invulnerable` collators.345 /// This call is not available to `Invulnerable` collators.
346 #[pallet::call_index(2)]346 #[pallet::call_index(2)]
347 #[pallet::weight(T::WeightInfo::register_as_candidate(T::MaxCollators::get()))] // todo:collator weight347 #[pallet::weight(T::WeightInfo::get_license(T::MaxCollators::get()))] // todo:collator weight
348 pub fn get_license(origin: OriginFor<T>) -> DispatchResultWithPostInfo {348 pub fn get_license(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
349 // register_as_candidate349 // register_as_candidate
350 let who = ensure_signed(origin)?;350 let who = ensure_signed(origin)?;
377 ///377 ///
378 /// This call is not available to `Invulnerable` collators.378 /// This call is not available to `Invulnerable` collators.
379 #[pallet::call_index(3)]379 #[pallet::call_index(3)]
380 #[pallet::weight(T::WeightInfo::register_as_candidate(T::MaxCollators::get()))] // todo:collator weight380 #[pallet::weight(T::WeightInfo::onboard(T::MaxCollators::get()))] // todo:collator weight
381 pub fn onboard(origin: OriginFor<T>) -> DispatchResultWithPostInfo {381 pub fn onboard(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
382 // register_as_candidate382 // register_as_candidate
383 let who = ensure_signed(origin)?;383 let who = ensure_signed(origin)?;
417 })?;417 })?;
418418
419 Self::deposit_event(Event::CandidateAdded { account_id: who });419 Self::deposit_event(Event::CandidateAdded { account_id: who });
420 Ok(Some(T::WeightInfo::register_as_candidate(current_count as u32)).into())420 Ok(Some(T::WeightInfo::onboard(current_count as u32)).into())
421 }421 }
422422
423 /// Deregister `origin` as a collator candidate. Note that the collator can only leave on423 /// Deregister `origin` as a collator candidate. Note that the collator can only leave on
424 /// session change. The license to `onboard` later at any other time will remain.424 /// session change. The license to `onboard` later at any other time will remain.
425 #[pallet::call_index(4)]425 #[pallet::call_index(4)]
426 #[pallet::weight(T::WeightInfo::leave_intent(T::MaxCollators::get()))] // todo:collator weight426 #[pallet::weight(T::WeightInfo::offboard(T::MaxCollators::get()))] // todo:collator weight
427 pub fn offboard(origin: OriginFor<T>) -> DispatchResultWithPostInfo {427 pub fn offboard(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
428 // leave_intent428 // leave_intent
429 let who = ensure_signed(origin)?;429 let who = ensure_signed(origin)?;
430 let current_count = Self::try_remove_candidate(&who)?;430 let current_count = Self::try_remove_candidate(&who)?;
431431
432 Ok(Some(T::WeightInfo::leave_intent(current_count as u32)).into()) // todo:collator weight432 Ok(Some(T::WeightInfo::offboard(current_count as u32)).into()) // todo:collator weight
433 }433 }
434434
435 /// Forfeit `origin`'s own license. The `LicenseBond` will be unreserved immediately.435 /// Forfeit `origin`'s own license. The `LicenseBond` will be unreserved immediately.
436 ///436 ///
437 /// This call is not available to `Invulnerable` collators.437 /// This call is not available to `Invulnerable` collators.
438 #[pallet::call_index(5)]438 #[pallet::call_index(5)]
439 #[pallet::weight(T::WeightInfo::leave_intent(T::MaxCollators::get()))] // todo:collator weight439 #[pallet::weight(T::WeightInfo::release_license(T::MaxCollators::get()))] // todo:collator weight
440 pub fn release_license(origin: OriginFor<T>) -> DispatchResultWithPostInfo {440 pub fn release_license(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
441 // leave_intent441 // leave_intent
442 let who = ensure_signed(origin)?;442 let who = ensure_signed(origin)?;
443443
444 let current_count = Self::try_remove_candidate_and_release_license(&who, false, true)?;444 let current_count = Self::try_remove_candidate_and_release_license(&who, false, true)?;
445445
446 Ok(Some(T::WeightInfo::leave_intent(current_count as u32)).into()) // todo:collator weight446 Ok(Some(T::WeightInfo::release_license(current_count as u32)).into()) // todo:collator weight
447 }447 }
448448
449 /// Force deregister `origin` as a collator candidate as a governing authority, and revoke its license.449 /// Force deregister `origin` as a collator candidate as a governing authority, and revoke its license.
452 ///452 ///
453 /// This call is, of course, not applicable to `Invulnerable` collators.453 /// This call is, of course, not applicable to `Invulnerable` collators.
454 #[pallet::call_index(6)]454 #[pallet::call_index(6)]
455 #[pallet::weight(T::WeightInfo::leave_intent(T::MaxCollators::get()))] // todo:collator weight455 #[pallet::weight(T::WeightInfo::force_release_license(T::MaxCollators::get()))] // todo:collator weight
456 pub fn force_release_license(456 pub fn force_release_license(
457 origin: OriginFor<T>,457 origin: OriginFor<T>,
458 who: T::AccountId,458 who: T::AccountId,
462462
463 let current_count = Self::try_remove_candidate_and_release_license(&who, false, true)?;463 let current_count = Self::try_remove_candidate_and_release_license(&who, false, true)?;
464464
465 Ok(Some(T::WeightInfo::leave_intent(current_count as u32)).into()) // todo:collator weight465 Ok(Some(T::WeightInfo::force_release_license(current_count as u32)).into()) // todo:collator weight
466 }466 }
467 }467 }
468468
534 Err(Error::<T>::NoLicense.into())534 Err(Error::<T>::NoLicense.into())
535 }535 }
536 })?;536 })?;
537 Self::deposit_event(Event::LicenseForfeited {537 Self::deposit_event(Event::LicenseReleased {
538 account_id: who.clone(),538 account_id: who.clone(),
539 deposit_returned,539 deposit_returned,
540 });540 });
modifiedpallets/collator-selection/src/weights.rsdiffbeforeafterboth
44// todo:collator re-generate weights44// todo:collator re-generate weights
45// The weight info trait for `pallet_collator_selection`.45// The weight info trait for `pallet_collator_selection`.
46pub trait WeightInfo {46pub trait WeightInfo {
47 fn set_invulnerables(_b: u32) -> Weight;47 fn add_invulnerable(_b: u32) -> Weight;
48 fn set_desired_collators() -> Weight;48 fn remove_invulnerable(_b: u32) -> Weight;
49 fn set_license_bond() -> Weight;49 fn get_license(_c: u32) -> Weight;
50 fn register_as_candidate(_c: u32) -> Weight;50 fn onboard(_c: u32) -> Weight;
51 fn leave_intent(_c: u32) -> Weight;51 fn offboard(_c: u32) -> Weight;
52 fn release_license(_c: u32) -> Weight;
53 fn force_release_license(_c: u32) -> Weight;
52 fn note_author() -> Weight;54 fn note_author() -> Weight;
53 fn new_session(_c: u32, _r: u32) -> Weight;55 fn new_session(_c: u32, _r: u32) -> Weight;
54}56}
5557
56/// Weights for pallet_collator_selection using the Substrate node and recommended hardware.58/// Weights for pallet_collator_selection using the Substrate node and recommended hardware.
57pub struct SubstrateWeight<T>(PhantomData<T>);59pub struct SubstrateWeight<T>(PhantomData<T>);
58impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {60impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
59 fn set_invulnerables(b: u32) -> Weight {61 fn add_invulnerable(b: u32) -> Weight {
60 Weight::from_ref_time(18_563_000 as u64)62 Weight::from_ref_time(18_563_000 as u64)
61 // Standard Error: 063 // Standard Error: 0
62 .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64))64 .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64))
63 .saturating_add(T::DbWeight::get().writes(1 as u64))65 .saturating_add(T::DbWeight::get().writes(1 as u64))
64 }66 }
65 fn set_desired_collators() -> Weight {67 fn remove_invulnerable(b: u32) -> Weight {
66 Weight::from_ref_time(16_363_000 as u64).saturating_add(T::DbWeight::get().writes(1 as u64))68 Weight::from_ref_time(18_563_000 as u64)
69 // Standard Error: 0
70 .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64))
71 .saturating_add(T::DbWeight::get().writes(1 as u64))
67 }72 }
68 fn set_license_bond() -> Weight {73 fn get_license(c: u32) -> Weight {
69 Weight::from_ref_time(16_840_000 as u64).saturating_add(T::DbWeight::get().writes(1 as u64))74 Weight::from_ref_time(71_196_000 as u64)
75 // Standard Error: 0
76 .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64))
77 .saturating_add(T::DbWeight::get().reads(4 as u64))
78 .saturating_add(T::DbWeight::get().writes(2 as u64))
70 }79 }
71 fn register_as_candidate(c: u32) -> Weight {80 fn onboard(c: u32) -> Weight {
72 Weight::from_ref_time(71_196_000 as u64)81 Weight::from_ref_time(71_196_000 as u64)
73 // Standard Error: 082 // Standard Error: 0
74 .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64))83 .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64))
75 .saturating_add(T::DbWeight::get().reads(4 as u64))84 .saturating_add(T::DbWeight::get().reads(4 as u64))
76 .saturating_add(T::DbWeight::get().writes(2 as u64))85 .saturating_add(T::DbWeight::get().writes(2 as u64))
77 }86 }
78 fn leave_intent(c: u32) -> Weight {87 fn offboard(c: u32) -> Weight {
79 Weight::from_ref_time(55_336_000 as u64)88 Weight::from_ref_time(55_336_000 as u64)
80 // Standard Error: 089 // Standard Error: 0
81 .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64))90 .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64))
82 .saturating_add(T::DbWeight::get().reads(1 as u64))91 .saturating_add(T::DbWeight::get().reads(1 as u64))
83 .saturating_add(T::DbWeight::get().writes(2 as u64))92 .saturating_add(T::DbWeight::get().writes(2 as u64))
84 }93 }
94 fn release_license(c: u32) -> Weight {
95 Weight::from_ref_time(55_336_000 as u64)
96 // Standard Error: 0
97 .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64))
98 .saturating_add(T::DbWeight::get().reads(1 as u64))
99 .saturating_add(T::DbWeight::get().writes(2 as u64))
100 }
101 fn force_release_license(c: u32) -> Weight {
102 Weight::from_ref_time(55_336_000 as u64)
103 // Standard Error: 0
104 .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64))
105 .saturating_add(T::DbWeight::get().reads(1 as u64))
106 .saturating_add(T::DbWeight::get().writes(2 as u64))
107 }
85 fn note_author() -> Weight {108 fn note_author() -> Weight {
86 Weight::from_ref_time(71_461_000 as u64)109 Weight::from_ref_time(71_461_000 as u64)
87 .saturating_add(T::DbWeight::get().reads(3 as u64))110 .saturating_add(T::DbWeight::get().reads(3 as u64))
102125
103// For backwards compatibility and tests126// For backwards compatibility and tests
104impl WeightInfo for () {127impl WeightInfo for () {
105 fn set_invulnerables(b: u32) -> Weight {128 fn add_invulnerable(b: u32) -> Weight {
106 Weight::from_ref_time(18_563_000 as u64)129 Weight::from_ref_time(18_563_000 as u64)
107 // Standard Error: 0130 // Standard Error: 0
108 .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64))131 .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64))
109 .saturating_add(RocksDbWeight::get().writes(1 as u64))132 .saturating_add(RocksDbWeight::get().writes(1 as u64))
110 }133 }
111 fn set_desired_collators() -> Weight {134 fn remove_invulnerable(b: u32) -> Weight {
112 Weight::from_ref_time(16_363_000 as u64)135 Weight::from_ref_time(18_563_000 as u64)
136 // Standard Error: 0
137 .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64))
113 .saturating_add(RocksDbWeight::get().writes(1 as u64))138 .saturating_add(RocksDbWeight::get().writes(1 as u64))
114 }139 }
115 fn set_license_bond() -> Weight {140 fn get_license(c: u32) -> Weight {
116 Weight::from_ref_time(16_840_000 as u64)141 Weight::from_ref_time(71_196_000 as u64)
142 // Standard Error: 0
143 .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64))
144 .saturating_add(RocksDbWeight::get().reads(4 as u64))
117 .saturating_add(RocksDbWeight::get().writes(1 as u64))145 .saturating_add(RocksDbWeight::get().writes(2 as u64))
118 }146 }
119 fn register_as_candidate(c: u32) -> Weight {147 fn onboard(c: u32) -> Weight {
120 Weight::from_ref_time(71_196_000 as u64)148 Weight::from_ref_time(71_196_000 as u64)
121 // Standard Error: 0149 // Standard Error: 0
122 .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64))150 .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64))
123 .saturating_add(RocksDbWeight::get().reads(4 as u64))151 .saturating_add(RocksDbWeight::get().reads(4 as u64))
124 .saturating_add(RocksDbWeight::get().writes(2 as u64))152 .saturating_add(RocksDbWeight::get().writes(2 as u64))
125 }153 }
126 fn leave_intent(c: u32) -> Weight {154 fn offboard(c: u32) -> Weight {
127 Weight::from_ref_time(55_336_000 as u64)155 Weight::from_ref_time(55_336_000 as u64)
128 // Standard Error: 0156 // Standard Error: 0
129 .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64))157 .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64))
130 .saturating_add(RocksDbWeight::get().reads(1 as u64))158 .saturating_add(RocksDbWeight::get().reads(1 as u64))
131 .saturating_add(RocksDbWeight::get().writes(2 as u64))159 .saturating_add(RocksDbWeight::get().writes(2 as u64))
132 }160 }
161 fn release_license(c: u32) -> Weight {
162 Weight::from_ref_time(55_336_000 as u64)
163 // Standard Error: 0
164 .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64))
165 .saturating_add(RocksDbWeight::get().reads(1 as u64))
166 .saturating_add(RocksDbWeight::get().writes(2 as u64))
167 }
168 fn force_release_license(c: u32) -> Weight {
169 Weight::from_ref_time(55_336_000 as u64)
170 // Standard Error: 0
171 .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64))
172 .saturating_add(RocksDbWeight::get().reads(1 as u64))
173 .saturating_add(RocksDbWeight::get().writes(2 as u64))
174 }
133 fn note_author() -> Weight {175 fn note_author() -> Weight {
134 Weight::from_ref_time(71_461_000 as u64)176 Weight::from_ref_time(71_461_000 as u64)
135 .saturating_add(RocksDbWeight::get().reads(3 as u64))177 .saturating_add(RocksDbWeight::get().reads(3 as u64))
modifiedpallets/data-management/src/benchmarking.rsdiffbeforeafterboth
64 let logs = (0..b).map(|_| <T as Config>::RuntimeEvent::from(crate::Event::<T>::TestEvent).encode()).collect::<Vec<_>>();64 let logs = (0..b).map(|_| <T as Config>::RuntimeEvent::from(crate::Event::<T>::TestEvent).encode()).collect::<Vec<_>>();
65 }: _(RawOrigin::Root, logs)65 }: _(RawOrigin::Root, logs)
66
67 set_identities {
68 let b in 0..600;
69 use frame_benchmarking::account;
70 use pallet_identity::{BalanceOf, Registration, IdentityInfo};
71 let identities = (0..b).map(|i| (
72 account("caller", i, 0),
73 Some(Registration::<BalanceOf<T>, T::MaxRegistrars, T::MaxAdditionalFields> {
74 judgements: Default::default(),
75 deposit: Default::default(),
76 info: IdentityInfo {
77 additional: Default::default(),
78 display: Default::default(),
79 legal: Default::default(),
80 web: Default::default(),
81 riot: Default::default(),
82 email: Default::default(),
83 pgp_fingerprint: None,
84 image: Default::default(),
85 twitter: Default::default(),
86 },
87 }),
88 )).collect::<Vec<_>>();
89 }: _(RawOrigin::Root, identities)
66}90}
6791
modifiedpallets/data-management/src/lib.rsdiffbeforeafterboth
153153
154 /// Insert or remove identities.154 /// Insert or remove identities.
155 #[pallet::call_index(5)]155 #[pallet::call_index(5)]
156 #[pallet::weight(<SelfWeightOf<T>>::insert_events(identities.len() as u32))] // todo:collator weight156 #[pallet::weight(<SelfWeightOf<T>>::set_identities(identities.len() as u32))] // todo:collator weight
157 pub fn set_identities(157 pub fn set_identities(
158 origin: OriginFor<T>,158 origin: OriginFor<T>,
159 identities: Vec<(159 identities: Vec<(
160 T::AccountId,160 T::AccountId,
161 Option<Registration<pallet_identity::BalanceOf<T>, T::MaxRegistrars, T::MaxAdditionalFields>>,161 Option<
162 Registration<
163 pallet_identity::BalanceOf<T>,
164 T::MaxRegistrars,
165 T::MaxAdditionalFields,
166 >,
167 >,
162 )>,168 )>,
163 ) -> DispatchResult {169 ) -> DispatchResult {
modifiedpallets/data-management/src/weights.rsdiffbeforeafterboth
39 fn finish(b: u32, ) -> Weight;39 fn finish(b: u32, ) -> Weight;
40 fn insert_eth_logs(b: u32, ) -> Weight;40 fn insert_eth_logs(b: u32, ) -> Weight;
41 fn insert_events(b: u32, ) -> Weight;41 fn insert_events(b: u32, ) -> Weight;
42 fn set_identities(b: u32, ) -> Weight;
42}43}
4344
44/// Weights for pallet_data_management using the Substrate node and recommended hardware.45/// Weights for pallet_data_management using the Substrate node and recommended hardware.
80 // Standard Error: 1_22781 // Standard Error: 1_227
81 .saturating_add(Weight::from_ref_time(1_311_481 as u64).saturating_mul(b as u64))82 .saturating_add(Weight::from_ref_time(1_311_481 as u64).saturating_mul(b as u64))
82 }83 }
84 fn set_identities(b: u32, ) -> Weight {
85 Weight::from_ref_time(10_936_376 as u64)
86 // Standard Error: 1_227
87 .saturating_add(Weight::from_ref_time(1_311_481 as u64).saturating_mul(b as u64))
88 }
83}89}
8490
85// For backwards compatibility and tests91// For backwards compatibility and tests
120 // Standard Error: 1_227126 // Standard Error: 1_227
121 .saturating_add(Weight::from_ref_time(1_311_481 as u64).saturating_mul(b as u64))127 .saturating_add(Weight::from_ref_time(1_311_481 as u64).saturating_mul(b as u64))
122 }128 }
129 fn set_identities(b: u32, ) -> Weight {
130 Weight::from_ref_time(10_936_376 as u64)
131 // Standard Error: 1_227
132 .saturating_add(Weight::from_ref_time(1_311_481 as u64).saturating_mul(b as u64))
133 }
123}134}
124135
modifiedpallets/identity/src/benchmarking.rsdiffbeforeafterboth

no syntactic changes

modifiedpallets/identity/src/lib.rsdiffbeforeafterboth
367 id.judgements.retain(|j| j.1.is_sticky());397 id.judgements.retain(|j| j.1.is_sticky());
368 id.info = *info;398 id.info = *info;
369 id399 id
370 },400 }
371 None => Registration {401 None => Registration {
372 info: *info,402 info: *info,
373 judgements: BoundedVec::default(),403 judgements: BoundedVec::default(),
516549
517 Self::deposit_event(Event::IdentityCleared { who: sender, deposit });550 Self::deposit_event(Event::IdentityCleared {
551 who: sender,
552 deposit,
553 });
518554
519 Ok(Some(T::WeightInfo::clear_identity(555 Ok(Some(T::WeightInfo::clear_identity(
568604
569 let item = (reg_index, Judgement::FeePaid(registrar.fee));605 let item = (reg_index, Judgement::FeePaid(registrar.fee));
570 match id.judgements.binary_search_by_key(&reg_index, |x| x.0) {606 match id.judgements.binary_search_by_key(&reg_index, |x| x.0) {
571 Ok(i) =>607 Ok(i) => {
572 if id.judgements[i].1.is_sticky() {608 if id.judgements[i].1.is_sticky() {
573 return Err(Error::<T>::StickyJudgement.into())609 return Err(Error::<T>::StickyJudgement.into());
574 } else {610 } else {
575 id.judgements[i] = item611 id.judgements[i] = item
576 },612 }
613 }
577 Err(i) =>614 Err(i) => id
578 id.judgements.try_insert(i, item).map_err(|_| Error::<T>::TooManyRegistrars)?,615 .judgements
616 .try_insert(i, item)
629 let fee = if let Judgement::FeePaid(fee) = id.judgements.remove(pos).1 {671 let fee = if let Judgement::FeePaid(fee) = id.judgements.remove(pos).1 {
630 fee672 fee
631 } else {673 } else {
632 return Err(Error::<T>::JudgementGiven.into())674 return Err(Error::<T>::JudgementGiven.into());
633 };675 };
634676
635 let err_amount = T::Currency::unreserve(&sender, fee);677 let err_amount = T::Currency::unreserve(&sender, fee);
810 let mut id = <IdentityOf<T>>::get(&target).ok_or(Error::<T>::InvalidTarget)?;856 let mut id = <IdentityOf<T>>::get(&target).ok_or(Error::<T>::InvalidTarget)?;
811857
812 if T::Hashing::hash_of(&id.info) != identity {858 if T::Hashing::hash_of(&id.info) != identity {
813 return Err(Error::<T>::JudgementForDifferentIdentity.into())859 return Err(Error::<T>::JudgementForDifferentIdentity.into());
814 }860 }
815861
816 let item = (reg_index, judgement);862 let item = (reg_index, judgement);
826 .map_err(|_| Error::<T>::JudgementPaymentFailed)?;872 .map_err(|_| Error::<T>::JudgementPaymentFailed)?;
827 }873 }
828 id.judgements[position] = item874 id.judgements[position] = item
829 },875 }
830 Err(position) => id876 Err(position) => id
831 .judgements877 .judgements
832 .try_insert(position, item)878 .try_insert(position, item)
838 <IdentityOf<T>>::insert(&target, id);884 <IdentityOf<T>>::insert(&target, id);
839 Self::deposit_event(Event::JudgementGiven { target, registrar_index: reg_index });885 Self::deposit_event(Event::JudgementGiven {
886 target,
887 registrar_index: reg_index,
888 });
840889
841 Ok(Some(T::WeightInfo::provide_judgement(judgements as u32, extra_fields as u32))890 Ok(Some(T::WeightInfo::provide_judgement(
887939
888 Self::deposit_event(Event::IdentityKilled { who: target, deposit });940 Self::deposit_event(Event::IdentityKilled {
941 who: target,
942 deposit,
943 });
889944
890 Ok(Some(T::WeightInfo::kill_identity(945 Ok(Some(T::WeightInfo::kill_identity(
932 Self::deposit_event(Event::SubIdentityAdded { sub, main: sender.clone(), deposit });995 Self::deposit_event(Event::SubIdentityAdded {
996 sub,
997 main: sender.clone(),
998 deposit,
999 });
933 Ok(())1000 Ok(())
934 })1001 })
978 Self::deposit_event(Event::SubIdentityRemoved { sub, main: sender, deposit });1054 Self::deposit_event(Event::SubIdentityRemoved {
1055 sub,
1056 main: sender,
1057 deposit,
1058 });
979 });1059 });
980 Ok(())1060 Ok(())
10241104
1025 /// Check if the account has corresponding identity information by the identity field.1105 /// Check if the account has corresponding identity information by the identity field.
1026 pub fn has_identity(who: &T::AccountId, fields: u64) -> bool {1106 pub fn has_identity(who: &T::AccountId, fields: u64) -> bool {
1027 IdentityOf::<T>::get(who)1107 IdentityOf::<T>::get(who).map_or(false, |registration| {
1028 .map_or(false, |registration| (registration.info.fields().0.bits() & fields) == fields)1108 (registration.info.fields().0.bits() & fields) == fields
1109 })
1029 }1110 }
1030}1111}
10311112
modifiedpallets/identity/src/tests.rsdiffbeforeafterboth

no syntactic changes

modifiedpallets/identity/src/types.rsdiffbeforeafterboth
87 .expect("bound checked in match arm condition; qed");87 .expect("bound checked in match arm condition; qed");
88 input.read(&mut r[..])?;88 input.read(&mut r[..])?;
89 Data::Raw(r)89 Data::Raw(r)
90 },90 }
91 34 => Data::BlakeTwo256(<[u8; 32]>::decode(input)?),91 34 => Data::BlakeTwo256(<[u8; 32]>::decode(input)?),
92 35 => Data::Sha256(<[u8; 32]>::decode(input)?),92 35 => Data::Sha256(<[u8; 32]>::decode(input)?),
93 36 => Data::Keccak256(<[u8; 32]>::decode(input)?),93 36 => Data::Keccak256(<[u8; 32]>::decode(input)?),
106 let mut r = vec![l as u8 + 1; l + 1];106 let mut r = vec![l as u8 + 1; l + 1];
107 r[1..].copy_from_slice(&x[..l as usize]);107 r[1..].copy_from_slice(&x[..l as usize]);
108 r108 r
109 },109 }
110 Data::BlakeTwo256(ref h) => once(34u8).chain(h.iter().cloned()).collect(),110 Data::BlakeTwo256(ref h) => once(34u8).chain(h.iter().cloned()).collect(),
111 Data::Sha256(ref h) => once(35u8).chain(h.iter().cloned()).collect(),111 Data::Sha256(ref h) => once(35u8).chain(h.iter().cloned()).collect(),
112 Data::Keccak256(ref h) => once(36u8).chain(h.iter().cloned()).collect(),112 Data::Keccak256(ref h) => once(36u8).chain(h.iter().cloned()).collect(),
417 self.judgements428 + self
429 .judgements
418 .iter()430 .iter()
419 .map(|(_, ref j)| if let Judgement::FeePaid(fee) = j { *fee } else { Zero::zero() })431 .map(|(_, ref j)| {
432 if let Judgement::FeePaid(fee) = j {
433 *fee
434 } else {
435 Zero::zero()
436 }
437 })
420 .fold(Zero::zero(), |a, i| a + i)438 .fold(Zero::zero(), |a, i| a + i)
421 }439 }
422}440}
432 Ok(Self { judgements, deposit, info })450 Ok(Self {
451 judgements,
452 deposit,
453 info,
454 })
433 }455 }
434}456}
modifiedruntime/common/config/pallets/collator_selection.rsdiffbeforeafterboth
54}54}
5555
56parameter_types! {56parameter_types! {
57 // These do not matter as we forbid non-sudo operations with the identity pallet
57 pub const BasicDeposit: Balance = 10 * UNIQUE; // todo:collator58 pub const BasicDeposit: Balance = 10 * UNIQUE;
58 pub const FieldDeposit: Balance = 25 * MILLIUNIQUE;59 pub const FieldDeposit: Balance = 25 * MILLIUNIQUE;
59 pub const SubAccountDeposit: Balance = 2 * UNIQUE; // end todo60 pub const SubAccountDeposit: Balance = 2 * UNIQUE;
60 pub const MaxSubAccounts: u32 = 100;61 pub const MaxSubAccounts: u32 = 100;
61 pub const MaxAdditionalFields: u32 = 100;62 pub const MaxAdditionalFields: u32 = 100;
62 pub const MaxRegistrars: u32 = 20;63 pub const MaxRegistrars: u32 = 20;
89 type TreasuryAccountId = TreasuryAccountId;90 type TreasuryAccountId = TreasuryAccountId;
90 type PotId = PotId;91 type PotId = PotId;
91 type MaxCollators = MaxCollators;92 type MaxCollators = MaxCollators;
92 // todo:collator kick threshold should be in storage and configured only by root -- or rather UpdateOrigin
93 type SlashRatio = SlashRatio;93 type SlashRatio = SlashRatio;
94 type ValidatorId = <Self as frame_system::Config>::AccountId;94 type ValidatorId = <Self as frame_system::Config>::AccountId;
95 type ValidatorIdOf = pallet_collator_selection::IdentityCollator;95 type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
modifiedruntime/common/runtime_apis.rsdiffbeforeafterboth
705 #[cfg(feature = "rmrk")]705 #[cfg(feature = "rmrk")]
706 list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip);706 list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip);
707707
708 // todo:collator check benchmarks
709 #[cfg(feature = "collator-selection")]708 #[cfg(feature = "collator-selection")]
710 list_benchmark!(list, extra, pallet_collator_selection, CollatorSelection);709 list_benchmark!(list, extra, pallet_collator_selection, CollatorSelection);
711710
772 #[cfg(feature = "rmrk")]771 #[cfg(feature = "rmrk")]
773 add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip);772 add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip);
774773
775 // todo:collator check benchmarks
776 #[cfg(feature = "collator-selection")]774 #[cfg(feature = "collator-selection")]
777 add_benchmark!(params, batches, pallet_collator_selection, CollatorSelection);775 add_benchmark!(params, batches, pallet_collator_selection, CollatorSelection);
778776
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
39 'pallet-unique/runtime-benchmarks',39 'pallet-unique/runtime-benchmarks',
40 'pallet-inflation/runtime-benchmarks',40 'pallet-inflation/runtime-benchmarks',
41 'pallet-app-promotion/runtime-benchmarks',41 'pallet-app-promotion/runtime-benchmarks',
42 'pallet-collator-selection/runtime-benchmarks',
42 'pallet-unique-scheduler-v2/runtime-benchmarks',43 'pallet-unique-scheduler-v2/runtime-benchmarks',
43 'pallet-xcm/runtime-benchmarks',44 'pallet-xcm/runtime-benchmarks',
44 'sp-runtime/runtime-benchmarks',45 'sp-runtime/runtime-benchmarks',
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
38 'pallet-unique/runtime-benchmarks',38 'pallet-unique/runtime-benchmarks',
39 'pallet-foreign-assets/runtime-benchmarks',39 'pallet-foreign-assets/runtime-benchmarks',
40 'pallet-inflation/runtime-benchmarks',40 'pallet-inflation/runtime-benchmarks',
41 'pallet-collator-selection/runtime-benchmarks',
41 'pallet-app-promotion/runtime-benchmarks',42 'pallet-app-promotion/runtime-benchmarks',
42 'pallet-xcm/runtime-benchmarks',43 'pallet-xcm/runtime-benchmarks',
43 'sp-runtime/runtime-benchmarks',44 'sp-runtime/runtime-benchmarks',
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
38 'pallet-unique/runtime-benchmarks',38 'pallet-unique/runtime-benchmarks',
39 'pallet-foreign-assets/runtime-benchmarks',39 'pallet-foreign-assets/runtime-benchmarks',
40 'pallet-inflation/runtime-benchmarks',40 'pallet-inflation/runtime-benchmarks',
41 'pallet-collator-selection/runtime-benchmarks',
41 'pallet-app-promotion/runtime-benchmarks',42 'pallet-app-promotion/runtime-benchmarks',
42 'pallet-xcm/runtime-benchmarks',43 'pallet-xcm/runtime-benchmarks',
43 'sp-runtime/runtime-benchmarks',44 'sp-runtime/runtime-benchmarks',
modifiedtests/src/interfaces/augment-api-events.tsdiffbeforeafterboth
105 CandidateRemoved: AugmentedEvent<ApiType, [accountId: AccountId32], { accountId: AccountId32 }>;105 CandidateRemoved: AugmentedEvent<ApiType, [accountId: AccountId32], { accountId: AccountId32 }>;
106 InvulnerableAdded: AugmentedEvent<ApiType, [invulnerable: AccountId32], { invulnerable: AccountId32 }>;106 InvulnerableAdded: AugmentedEvent<ApiType, [invulnerable: AccountId32], { invulnerable: AccountId32 }>;
107 InvulnerableRemoved: AugmentedEvent<ApiType, [invulnerable: AccountId32], { invulnerable: AccountId32 }>;107 InvulnerableRemoved: AugmentedEvent<ApiType, [invulnerable: AccountId32], { invulnerable: AccountId32 }>;
108 LicenseForfeited: AugmentedEvent<ApiType, [accountId: AccountId32, depositReturned: u128], { accountId: AccountId32, depositReturned: u128 }>;
109 LicenseObtained: AugmentedEvent<ApiType, [accountId: AccountId32, deposit: u128], { accountId: AccountId32, deposit: u128 }>;108 LicenseObtained: AugmentedEvent<ApiType, [accountId: AccountId32, deposit: u128], { accountId: AccountId32, deposit: u128 }>;
109 LicenseReleased: AugmentedEvent<ApiType, [accountId: AccountId32, depositReturned: u128], { accountId: AccountId32, depositReturned: u128 }>;
110 /**110 /**
111 * Generic event111 * Generic event
112 **/112 **/
modifiedtests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth
312 * Create substrate events312 * Create substrate events
313 **/313 **/
314 insertEvents: AugmentedSubmittable<(events: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Bytes>]>;314 insertEvents: AugmentedSubmittable<(events: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Bytes>]>;
315 /**
316 * Insert or remove identities.
317 **/
318 insertIdentities: AugmentedSubmittable<(identities: Vec<ITuple<[AccountId32, Option<PalletIdentityRegistration>]>> | ([AccountId32 | string | Uint8Array, Option<PalletIdentityRegistration> | null | Uint8Array | PalletIdentityRegistration | { judgements?: any; deposit?: any; info?: any } | string])[]) => SubmittableExtrinsic<ApiType>, [Vec<ITuple<[AccountId32, Option<PalletIdentityRegistration>]>>]>;
319 /**315 /**
320 * Insert items into contract storage, this method can be called316 * Insert items into contract storage, this method can be called
321 * multiple times317 * multiple times
322 **/318 **/
323 setData: AugmentedSubmittable<(address: H160 | string | Uint8Array, data: Vec<ITuple<[H256, H256]>> | ([H256 | string | Uint8Array, H256 | string | Uint8Array])[]) => SubmittableExtrinsic<ApiType>, [H160, Vec<ITuple<[H256, H256]>>]>;319 setData: AugmentedSubmittable<(address: H160 | string | Uint8Array, data: Vec<ITuple<[H256, H256]>> | ([H256 | string | Uint8Array, H256 | string | Uint8Array])[]) => SubmittableExtrinsic<ApiType>, [H160, Vec<ITuple<[H256, H256]>>]>;
320 /**
321 * Insert or remove identities.
322 **/
323 setIdentities: AugmentedSubmittable<(identities: Vec<ITuple<[AccountId32, Option<PalletIdentityRegistration>]>> | ([AccountId32 | string | Uint8Array, Option<PalletIdentityRegistration> | null | Uint8Array | PalletIdentityRegistration | { judgements?: any; deposit?: any; info?: any } | string])[]) => SubmittableExtrinsic<ApiType>, [Vec<ITuple<[AccountId32, Option<PalletIdentityRegistration>]>>]>;
324 /**324 /**
325 * Generic tx325 * Generic tx
326 **/326 **/
modifiedtests/src/interfaces/default/types.tsdiffbeforeafterboth
1283 readonly accountId: AccountId32;1283 readonly accountId: AccountId32;
1284 readonly deposit: u128;1284 readonly deposit: u128;
1285 } & Struct;1285 } & Struct;
1286 readonly isLicenseForfeited: boolean;1286 readonly isLicenseReleased: boolean;
1287 readonly asLicenseForfeited: {1287 readonly asLicenseReleased: {
1288 readonly accountId: AccountId32;1288 readonly accountId: AccountId32;
1289 readonly depositReturned: u128;1289 readonly depositReturned: u128;
1290 } & Struct;1290 } & Struct;
1296 readonly asCandidateRemoved: {1296 readonly asCandidateRemoved: {
1297 readonly accountId: AccountId32;1297 readonly accountId: AccountId32;
1298 } & Struct;1298 } & Struct;
1299 readonly type: 'InvulnerableAdded' | 'InvulnerableRemoved' | 'LicenseObtained' | 'LicenseForfeited' | 'CandidateAdded' | 'CandidateRemoved';1299 readonly type: 'InvulnerableAdded' | 'InvulnerableRemoved' | 'LicenseObtained' | 'LicenseReleased' | 'CandidateAdded' | 'CandidateRemoved';
1300}1300}
13011301
1302/** @name PalletCommonError */1302/** @name PalletCommonError */
1477 readonly asInsertEvents: {1477 readonly asInsertEvents: {
1478 readonly events: Vec<Bytes>;1478 readonly events: Vec<Bytes>;
1479 } & Struct;1479 } & Struct;
1480 readonly isInsertIdentities: boolean;1480 readonly isSetIdentities: boolean;
1481 readonly asInsertIdentities: {1481 readonly asSetIdentities: {
1482 readonly identities: Vec<ITuple<[AccountId32, Option<PalletIdentityRegistration>]>>;1482 readonly identities: Vec<ITuple<[AccountId32, Option<PalletIdentityRegistration>]>>;
1483 } & Struct;1483 } & Struct;
1484 readonly type: 'Begin' | 'SetData' | 'Finish' | 'InsertEthLogs' | 'InsertEvents' | 'InsertIdentities';1484 readonly type: 'Begin' | 'SetData' | 'Finish' | 'InsertEthLogs' | 'InsertEvents' | 'SetIdentities';
1485}1485}
14861486
1487/** @name PalletDataManagementError */1487/** @name PalletDataManagementError */
modifiedtests/src/interfaces/lookup.tsdiffbeforeafterboth
198 accountId: 'AccountId32',198 accountId: 'AccountId32',
199 deposit: 'u128',199 deposit: 'u128',
200 },200 },
201 LicenseForfeited: {201 LicenseReleased: {
202 accountId: 'AccountId32',202 accountId: 'AccountId32',
203 depositReturned: 'u128',203 depositReturned: 'u128',
204 },204 },
modifiedtests/src/interfaces/types-lookup.tsdiffbeforeafterboth
212 readonly accountId: AccountId32;212 readonly accountId: AccountId32;
213 readonly deposit: u128;213 readonly deposit: u128;
214 } & Struct;214 } & Struct;
215 readonly isLicenseForfeited: boolean;215 readonly isLicenseReleased: boolean;
216 readonly asLicenseForfeited: {216 readonly asLicenseReleased: {
217 readonly accountId: AccountId32;217 readonly accountId: AccountId32;
218 readonly depositReturned: u128;218 readonly depositReturned: u128;
219 } & Struct;219 } & Struct;
225 readonly asCandidateRemoved: {225 readonly asCandidateRemoved: {
226 readonly accountId: AccountId32;226 readonly accountId: AccountId32;
227 } & Struct;227 } & Struct;
228 readonly type: 'InvulnerableAdded' | 'InvulnerableRemoved' | 'LicenseObtained' | 'LicenseForfeited' | 'CandidateAdded' | 'CandidateRemoved';228 readonly type: 'InvulnerableAdded' | 'InvulnerableRemoved' | 'LicenseObtained' | 'LicenseReleased' | 'CandidateAdded' | 'CandidateRemoved';
229 }229 }
230230
231 /** @name PalletSessionEvent (31) */231 /** @name PalletSessionEvent (31) */
3513 readonly asInsertEvents: {3513 readonly asInsertEvents: {
3514 readonly events: Vec<Bytes>;3514 readonly events: Vec<Bytes>;
3515 } & Struct;3515 } & Struct;
3516 readonly isInsertIdentities: boolean;3516 readonly isSetIdentities: boolean;
3517 readonly asInsertIdentities: {3517 readonly asSetIdentities: {
3518 readonly identities: Vec<ITuple<[AccountId32, Option<PalletIdentityRegistration>]>>;3518 readonly identities: Vec<ITuple<[AccountId32, Option<PalletIdentityRegistration>]>>;
3519 } & Struct;3519 } & Struct;
3520 readonly type: 'Begin' | 'SetData' | 'Finish' | 'InsertEthLogs' | 'InsertEvents' | 'InsertIdentities';3520 readonly type: 'Begin' | 'SetData' | 'Finish' | 'InsertEthLogs' | 'InsertEvents' | 'SetIdentities';
3521 }3521 }
35223522
3523 /** @name PalletMaintenanceCall (418) */3523 /** @name PalletMaintenanceCall (418) */