pub fn finalize_proof<F>(
plan: &ProofPlan,
leaf: u64,
lookup: F,
) -> Result<(B256, B256, Vec<B256>), &'static str>Expand description
Given a resolved map from LevelAndLeaf → hash (fetched from log
scan + partials), walk the proof path and return (send, root, proof_vec) ready for ABI encoding.
lookup is the client-supplied closure that maps each node
position to its hash (from logs or from accumulator partial state).