Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion for substrate#12530: Consolidate and deduplicate MMR API methods #6167

Prev Previous commit
Next Next commit
make generate_batch_proof stub for historical
  • Loading branch information
Lederstrumpf committed Oct 18, 2022
commit b83d62ced324c41056b5f92adb73f511499f95fb
4 changes: 2 additions & 2 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,7 @@ sp_api::impl_runtime_apis! {
fn generate_proof(block_number: BlockNumber)
-> Result<(mmr::EncodableOpaqueLeaf, mmr::Proof<Hash>), mmr::Error>
{
Mmr::generate_batch_proof(vec![block_number])
Mmr::generate_historical_batch_proof(vec![block_number], None)
.and_then(|(leaves, proof)| Ok((
mmr::EncodableOpaqueLeaf::from_leaf(&leaves[0]),
mmr::BatchProof::into_single_leaf_proof(proof)?
Expand Down Expand Up @@ -1728,7 +1728,7 @@ sp_api::impl_runtime_apis! {
fn generate_batch_proof(block_numbers: Vec<BlockNumber>)
-> Result<(Vec<mmr::EncodableOpaqueLeaf>, mmr::BatchProof<Hash>), mmr::Error>
{
Mmr::generate_batch_proof(block_numbers)
Mmr::generate_historical_batch_proof(block_numbers, None)
.map(|(leaves, proof)| (leaves.into_iter().map(|leaf| mmr::EncodableOpaqueLeaf::from_leaf(&leaf)).collect(), proof))
}

Expand Down