prepopulated_leaves

Function prepopulated_leaves 

Source
pub fn prepopulated_leaves(
    levels: usize,
    seed: u64,
    exclude_indices: &[usize],
    fill_count: usize,
) -> Vec<FpBN256> 
Expand description

Build a pre-populated leaves vector of length 2^levels

Creates a vector of leaves for a Merkle tree, pre-populating some positions with random commitments while excluding specified indices. The excluded indices are reserved for overwriting with test case inputs.

§Arguments

  • levels - Number of tree levels
  • seed - Seed value for the random number generator
  • exclude_indices - Indices to leave empty (will be overwritten with test inputs)
  • fill_count - Number of random commitments to place in the tree for testing cases

§Returns

Returns a vector of scalar values representing the leaves, with zeros for empty positions and random commitments for filled positions.