INNER CODE UNIT · Rust

set_desired_candidates

AstarNetwork/Astar · pallets/collator-selection/src/lib.rs:389

        pub fn set_desired_candidates(
            origin: OriginFor<T>,
            max: u32,
        ) -> DispatchResultWithPostInfo {
            T::UpdateOrigin::ensure_origin(origin)?;
            // we trust origin calls, this is just a for more accurate benchmarking
            if max > T::MaxCandidates::get() {
                log::warn!("max > T::MaxCandidates; you might need to run benchmarks again");
            }
            <DesiredCandidates<T>>::put(max);
            Self::deposit_event(Event::NewDesiredCandidates(max));
            Ok(().into())
        }

        /// Set the candidacy bond amount.
        #[pallet::call_index(2)]
        #[pallet::weight(T::WeightInfo::set_candidacy_bond())]
        pub fn set_candidacy_bond(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…