pub fn path_length_from_key(key: u64, num_leaves: u64) -> u64 
Expand description

Calculates the length of the path to a leaf

Additional Information

WARNING: This function will be private when https://github.com/FuelLabs/sway/issues/5765 is resolved.

Arguments

  • key: [u64] - The key or index of the leaf.
  • num_leaves: [u64] - The total number of leaves in the Merkle Tree.

Returns

  • [u64] - The length from the leaf to a root.