--- a/pallets/collator-selection/src/lib.rs +++ b/pallets/collator-selection/src/lib.rs @@ -285,7 +285,7 @@ impl Pallet { /// Add a collator to the list of invulnerable (fixed) collators. #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::add_invulnerable(T::MaxCollators::get()))] // todo:collator weight + #[pallet::weight(T::WeightInfo::add_invulnerable(T::MaxCollators::get()))] pub fn add_invulnerable( origin: OriginFor, new: T::AccountId, @@ -315,7 +315,7 @@ /// Remove a collator from the list of invulnerable (fixed) collators. #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::remove_invulnerable(T::MaxCollators::get()))] // todo:collator weight + #[pallet::weight(T::WeightInfo::remove_invulnerable(T::MaxCollators::get()))] pub fn remove_invulnerable( origin: OriginFor, who: T::AccountId, @@ -344,7 +344,7 @@ /// /// This call is not available to `Invulnerable` collators. #[pallet::call_index(2)] - #[pallet::weight(T::WeightInfo::get_license(T::MaxCollators::get()))] // todo:collator weight + #[pallet::weight(T::WeightInfo::get_license(T::MaxCollators::get()))] pub fn get_license(origin: OriginFor) -> DispatchResultWithPostInfo { // register_as_candidate let who = ensure_signed(origin)?; @@ -377,7 +377,7 @@ /// /// This call is not available to `Invulnerable` collators. #[pallet::call_index(3)] - #[pallet::weight(T::WeightInfo::onboard(T::MaxCollators::get()))] // todo:collator weight + #[pallet::weight(T::WeightInfo::onboard(T::MaxCollators::get()))] pub fn onboard(origin: OriginFor) -> DispatchResultWithPostInfo { // register_as_candidate let who = ensure_signed(origin)?; @@ -423,27 +423,27 @@ /// Deregister `origin` as a collator candidate. Note that the collator can only leave on /// session change. The license to `onboard` later at any other time will remain. #[pallet::call_index(4)] - #[pallet::weight(T::WeightInfo::offboard(T::MaxCollators::get()))] // todo:collator weight + #[pallet::weight(T::WeightInfo::offboard(T::MaxCollators::get()))] pub fn offboard(origin: OriginFor) -> DispatchResultWithPostInfo { // leave_intent let who = ensure_signed(origin)?; let current_count = Self::try_remove_candidate(&who)?; - Ok(Some(T::WeightInfo::offboard(current_count as u32)).into()) // todo:collator weight + Ok(Some(T::WeightInfo::offboard(current_count as u32)).into()) } /// Forfeit `origin`'s own license. The `LicenseBond` will be unreserved immediately. /// /// This call is not available to `Invulnerable` collators. #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::release_license(T::MaxCollators::get()))] // todo:collator weight + #[pallet::weight(T::WeightInfo::release_license(T::MaxCollators::get()))] pub fn release_license(origin: OriginFor) -> DispatchResultWithPostInfo { // leave_intent let who = ensure_signed(origin)?; let current_count = Self::try_remove_candidate_and_release_license(&who, false, true)?; - Ok(Some(T::WeightInfo::release_license(current_count as u32)).into()) // todo:collator weight + Ok(Some(T::WeightInfo::release_license(current_count as u32)).into()) } /// Force deregister `origin` as a collator candidate as a governing authority, and revoke its license. @@ -452,7 +452,7 @@ /// /// This call is, of course, not applicable to `Invulnerable` collators. #[pallet::call_index(6)] - #[pallet::weight(T::WeightInfo::force_release_license(T::MaxCollators::get()))] // todo:collator weight + #[pallet::weight(T::WeightInfo::force_release_license(T::MaxCollators::get()))] pub fn force_release_license( origin: OriginFor, who: T::AccountId, @@ -462,7 +462,7 @@ let current_count = Self::try_remove_candidate_and_release_license(&who, false, true)?; - Ok(Some(T::WeightInfo::force_release_license(current_count as u32)).into()) // todo:collator weight + Ok(Some(T::WeightInfo::force_release_license(current_count as u32)).into()) } } --- 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; --- 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 ::RuntimeEvent: codec::Encode }