Files
pezkuwi-sdk/pezbridges/pezsnowbridge/pezpallets/system/src/api.rs
T
pezkuwichain 6b597bebcf fix: EnsureOrigin try_successful_origin and snowbridge rename
- Fix pezpallet-welati EnsureOrigin implementations (3 fixes)
  - Remove incorrect #[cfg(not(feature = "runtime-benchmarks"))] blocks
  - Affects EnsureSerok, EnsureParlementer, EnsureDiwan

- Fix asset-hub-zagros governance origins macros (2 fixes)
  - Remove non-benchmark try_successful_origin from decl_unit_ensures!
  - Remove non-benchmark try_successful_origin from decl_ensure!

- Rename snowbridge -> pezsnowbridge for consistency

- Update WORKFLOW_PLAN.md with build status and package names
  - Correct package names: pezkuwi-teyrchain-bin, pezstaging-node-cli
  - Mark completed builds: pezkuwi, pezkuwi-teyrchain-bin,
    pezstaging-node-cli, teyrchain-template-node
2025-12-25 01:26:18 +03:00

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()
}