INNER CODE UNIT · Rust

account_id

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

        pub fn account_id() -> T::AccountId {
            T::PotId::get().into_account_truncating()
        }

        fn ensure_governance_or_caller(
            origin: T::RuntimeOrigin,
            who: &T::AccountId,
        ) -> DispatchResult {
            if T::GovernanceOrigin::ensure_origin(origin.clone()).is_err() {
                let caller = ensure_signed(origin.clone())?;
                ensure!(&caller == who, BadOrigin);
            }
            Ok(())
        }

        /// Checks if the account has a registered validator key.
        fn is_validator_registered(who: &T::AccountId) -> DispatchResult {
            let validator_key = T::ValidatorIdOf::convert(who.clone())

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…