ghost-node/pallets/traits/src/merkle_tree.rs
Uncle Stretch d83ee59508
let the EXODUS begin...
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2026-08-29 14:48:50 +03:00

13 lines
499 B
Rust

use crate::converter::IdentifierConverter;
use sp_std::vec::Vec;
use sp_core::H256;
pub trait MerkleTree<A, E>: IdentifierConverter<A, E> {
type VerifyingShares;
type Hash;
fn merkle_build_tree(vs: &Self::VerifyingShares) -> Result<Vec<Self::Hash>, E>;
fn merkle_generate_proof_from_tree(vsm: &Self::VerifyingShares, t: &[Self::Hash], i: A) -> Result<(Vec<u8>, Vec<H256>), E>;
fn merkle_verify_proof(&self, vs: &[u8], p: &[Self::Hash], r: Self::Hash, i: A) -> Result<(), E>;
}