mirror of
https://gitlab.com/pezkuwichain/pezkuwi-sdk.git
synced 2026-11-05 18:31:09 +00:00
- 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
20 lines
548 B
Rust
20 lines
548 B
Rust
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
|
//! Helpers for implementing runtime api
|
|
|
|
use crate::{Config, MessageLeaves};
|
|
use pezframe_support::storage::StorageStreamIter;
|
|
use pezsnowbridge_merkle_tree::{merkle_proof, MerkleProof};
|
|
|
|
pub fn prove_message<T>(leaf_index: u64) -> Option<MerkleProof>
|
|
where
|
|
T: Config,
|
|
{
|
|
if !MessageLeaves::<T>::exists() {
|
|
return None;
|
|
}
|
|
let proof =
|
|
merkle_proof::<<T as Config>::Hashing, _>(MessageLeaves::<T>::stream_iter(), leaf_index);
|
|
Some(proof)
|
|
}
|