Trait incrementalmerkletree::testing::Frontier

source ·
pub trait Frontier<H> {
    // Required methods
    fn append(&mut self, value: H) -> bool;
    fn root(&self) -> H;
}
Available on crate feature test-dependencies only.
Expand description

A possibly-empty incremental Merkle frontier.

Required Methods§

source

fn append(&mut self, value: H) -> bool

Appends a new value to the frontier at the next available slot. Returns true if successful and false if the frontier would exceed the maximum allowed depth.

source

fn root(&self) -> H

Obtains the current root of this Merkle frontier by hashing against empty nodes up to the maximum height of the pruned tree that the frontier represents.

Implementors§

source§

impl<H: Hashable + Clone, const DEPTH: u8> Frontier<H> for Frontier<H, DEPTH>