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
--- a/pallets/collator-selection/src/lib.rs
+++ b/pallets/collator-selection/src/lib.rs
@@ -285,7 +285,7 @@
 	impl<T: Config> Pallet<T> {
 		/// 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<T>,
 			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<T>,
 			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<T>) -> 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<T>) -> 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<T>) -> 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<T>) -> 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<T>,
 			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())
 		}
 	}
 
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
22use sp_core::{H160, H256};22use sp_core::{H160, H256};
23use sp_std::{vec::Vec, vec};23use sp_std::{vec::Vec, vec};
2424
25// todo:collator
26benchmarks! {25benchmarks! {
27 where_clause { where <T as Config>::RuntimeEvent: codec::Encode }26 where_clause { where <T as Config>::RuntimeEvent: codec::Encode }
2827