src/signature/merkle/merkle.js
function getProof(index, layers) {
  let i = index;
  const proof = layers.reduce((current, layer) => {
    const pair = getPair(i, layer);
    if (pair) {
      current.push(pair);
    }
    i = Math.floor(i / 2); // finds the index of the parent of the current node
    return current;
  }, []);
  return proof;
}
function getProof(index, layers) {
  let i = index;
  const proof = layers.reduce((current, layer) => {
    const pair = getPair(i, layer);
    if (pair) {
      current.push(pair);
    }
    i = Math.floor(i / 2); // finds the index of the parent of the current node
    return current;
  }, []);
  return proof;
}
function getProof ( index , layers ) { let i = index ; const proof = layers . reduce ( ( current , layer ) => { const pair = getPair ( i , layer ) ; if ( pair ) { current . push ( pair ) ; } i = Math . floor ( i / 2 ) ; // finds the index of the parent of the current node return current ; } , [ ] ) ; return proof ; }
Finds all the "uncle" nodes required to prove a given element in the merkle tree

@param {*} index
@param {*} layers
Finds all the uncle nodes required to prove a given element in the merkle tree