pallet-mmr: RPC and Runtime APIs work with block numbers (#6072)

* pallet-mmr: RPC API works with block numbers

* small fix

* update

* change types

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Sergej Sakac
2022-10-13 13:04:00 +02:00
committed by GitHub
parent 17730b85be
commit 0cc0867c45
8 changed files with 274 additions and 210 deletions
+5 -5
View File
@@ -1448,8 +1448,8 @@ sp_api::impl_runtime_apis! {
}
}
impl mmr::MmrApi<Block, Hash> for Runtime {
fn generate_proof(_leaf_index: u64)
impl mmr::MmrApi<Block, Hash, BlockNumber> for Runtime {
fn generate_proof(_block_number: BlockNumber)
-> Result<(mmr::EncodableOpaqueLeaf, mmr::Proof<Hash>), mmr::Error>
{
@@ -1477,15 +1477,15 @@ sp_api::impl_runtime_apis! {
Err(mmr::Error::PalletNotIncluded)
}
fn generate_batch_proof(_leaf_indices: Vec<u64>)
fn generate_batch_proof(_block_numbers: Vec<BlockNumber>)
-> Result<(Vec<mmr::EncodableOpaqueLeaf>, mmr::BatchProof<Hash>), mmr::Error>
{
Err(mmr::Error::PalletNotIncluded)
}
fn generate_historical_batch_proof(
_leaf_indices: Vec<u64>,
_leaves_count: u64,
_block_numbers: Vec<BlockNumber>,
_best_known_block_number: BlockNumber,
) -> Result<(Vec<mmr::EncodableOpaqueLeaf>, mmr::BatchProof<Hash>), mmr::Error> {
Err(mmr::Error::PalletNotIncluded)
}