Skip to content

Commit

Permalink
propagate error from StorageCommitmentTree::get_proof correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ftheirs committed Nov 25, 2024
1 parent e7d8f05 commit ca995ac
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/rpc/src/pathfinder/methods/get_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,9 @@ pub async fn get_proof(
// Generate a proof for this contract, creating a "non-membership" proof if the
// contract does not exist.
StorageCommitmentTree::get_proof(&tx, header.number, &input.contract_address, idx)
.unwrap_or_default()
.into_iter()
.map(|(node, _)| node)
.collect()
.map(|proof| proof.into_iter().map(|(node, _)| node).collect())
})
.transpose()?
.unwrap_or_default();

let contract_proof = ProofNodes(contract_proof);
Expand Down

0 comments on commit ca995ac

Please sign in to comment.