INNER CODE UNIT · Rust

set_invulnerables

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

        pub fn set_invulnerables(
            origin: OriginFor<T>,
            new: Vec<T::AccountId>,
        ) -> DispatchResultWithPostInfo {
            T::UpdateOrigin::ensure_origin(origin)?;
            // we trust origin calls, this is just a for more accurate benchmarking
            if (new.len() as u32) > T::MaxInvulnerables::get() {
                log::warn!(
                    "invulnerables > T::MaxInvulnerables; you might need to run benchmarks again"
                );
            }

            // check if the invulnerables have associated validator keys before they are set
            for account_id in &new {
                Self::is_validator_registered(account_id)?;
            }

            <Invulnerables<T>>::put(&new);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…