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>;
}
