90fd044766
- snowbridge-pezpallet-* → pezsnowbridge-pezpallet-* (201 refs) - pallet/ directories → pezpallet/ (4 locations) - Fixed pezpallet.rs self-include recursion bug - Fixed sc-chain-spec hardcoded crate name in derive macro - Reverted .pezpallet_by_name() to .pallet_by_name() (subxt API) - Added BizinikiwiConfig type alias for zombienet tests - Deleted obsolete session state files Verified: pezsnowbridge-pezpallet-*, pezpallet-staking, pezpallet-staking-async, pezframe-benchmarking-cli all pass cargo check
17 lines
448 B
Rust
17 lines
448 B
Rust
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
|
//! Helpers for implementing runtime api
|
|
|
|
use pezsnowbridge_core::AgentId;
|
|
use xcm::{prelude::*, VersionedLocation};
|
|
|
|
use crate::{agent_id_of, Config};
|
|
|
|
pub fn agent_id<Runtime>(location: VersionedLocation) -> Option<AgentId>
|
|
where
|
|
Runtime: Config,
|
|
{
|
|
let location: Location = location.try_into().ok()?;
|
|
agent_id_of::<Runtime>(&location).ok()
|
|
}
|