referrerpolicy=no-referrer-when-downgrade

build_collator_proof

Function build_collator_proof 

Source
pub fn build_collator_proof(
    keys: &[CollatorKey],
    collator_index: u32,
) -> Result<(H256, Vec<H256>), CollatorProofError>
Expand description

Build an unpadded Merkle tree and return its root and proof for collator_index.

Keys are hashed as leaves; unpaired nodes are promoted to the next level. Construction takes O(n) hashing work for n keys.

Returns an error for an empty set or an invalid index.