git.delta.rocks / unique-network / refs/commits / 37af826b8155

difftreelog

style(collator-selection) get rid of some todos

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

3 files changed

modifiedpallets/collator-selection/src/lib.rsdiffbeforeafterboth
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::add_invulnerable(T::MaxCollators::get()))] // todo:collator weight288 #[pallet::weight(T::WeightInfo::add_invulnerable(T::MaxCollators::get()))]
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::remove_invulnerable(T::MaxCollators::get()))] // todo:collator weight318 #[pallet::weight(T::WeightInfo::remove_invulnerable(T::MaxCollators::get()))]
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::get_license(T::MaxCollators::get()))] // todo:collator weight347 #[pallet::weight(T::WeightInfo::get_license(T::MaxCollators::get()))]
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::onboard(T::MaxCollators::get()))] // todo:collator weight380 #[pallet::weight(T::WeightInfo::onboard(T::MaxCollators::get()))]
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)?;
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::offboard(T::MaxCollators::get()))] // todo:collator weight426 #[pallet::weight(T::WeightInfo::offboard(T::MaxCollators::get()))]
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::offboard(current_count as u32)).into()) // todo:collator weight432 Ok(Some(T::WeightInfo::offboard(current_count as u32)).into())
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::release_license(T::MaxCollators::get()))] // todo:collator weight439 #[pallet::weight(T::WeightInfo::release_license(T::MaxCollators::get()))]
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::release_license(current_count as u32)).into()) // todo:collator weight446 Ok(Some(T::WeightInfo::release_license(current_count as u32)).into())
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::force_release_license(T::MaxCollators::get()))] // todo:collator weight455 #[pallet::weight(T::WeightInfo::force_release_license(T::MaxCollators::get()))]
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::force_release_license(current_count as u32)).into()) // todo:collator weight465 Ok(Some(T::WeightInfo::force_release_license(current_count as u32)).into())
466 }466 }
467 }467 }
468468
modifiedpallets/collator-selection/src/weights.rsdiffbeforeafterboth
--- a/pallets/collator-selection/src/weights.rs
+++ b/pallets/collator-selection/src/weights.rs
@@ -41,7 +41,6 @@
 };
 use sp_std::marker::PhantomData;
 
-// todo:collator re-generate weights
 // The weight info trait for `pallet_collator_selection`.
 pub trait WeightInfo {
 	fn add_invulnerable(_b: u32) -> Weight;
modifiedpallets/data-management/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/data-management/src/benchmarking.rs
+++ b/pallets/data-management/src/benchmarking.rs
@@ -22,7 +22,6 @@
 use sp_core::{H160, H256};
 use sp_std::{vec::Vec, vec};
 
-// todo:collator
 benchmarks! {
 	where_clause { where <T as Config>::RuntimeEvent: codec::Encode }