mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 04:41:03 +00:00
Support MMR Pruning (#9700)
* Use `0.3.2` * Replace `u64` with `NodeIndex` * Fix Typo * Add Pruning Logic * Fix Some Tests * Remove Comment * Log Only Under STD * Return while No Element to Append * Optimize Pruning Algorithm * Update Doc * Update Doc * Zero Copy Algorithm * Import Missing Type * Fix Merge Mistake * Import Missing Item * Make `verify` Off-Chain * `cargo fmt` * Avoid using NodeIndex in incorrect places. * Simplify pruning. * Format Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
This commit is contained in:
@@ -32,7 +32,7 @@ use sp_blockchain::HeaderBackend;
|
||||
use sp_core::Bytes;
|
||||
use sp_runtime::{generic::BlockId, traits::Block as BlockT};
|
||||
|
||||
pub use pallet_mmr_primitives::MmrApi as MmrRuntimeApi;
|
||||
pub use pallet_mmr_primitives::{LeafIndex, MmrApi as MmrRuntimeApi};
|
||||
|
||||
/// Retrieved MMR leaf and its proof.
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||
@@ -71,7 +71,7 @@ pub trait MmrApi<BlockHash> {
|
||||
#[rpc(name = "mmr_generateProof")]
|
||||
fn generate_proof(
|
||||
&self,
|
||||
leaf_index: u64,
|
||||
leaf_index: LeafIndex,
|
||||
at: Option<BlockHash>,
|
||||
) -> Result<LeafProof<BlockHash>>;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ where
|
||||
{
|
||||
fn generate_proof(
|
||||
&self,
|
||||
leaf_index: u64,
|
||||
leaf_index: LeafIndex,
|
||||
at: Option<<Block as BlockT>::Hash>,
|
||||
) -> Result<LeafProof<<Block as BlockT>::Hash>> {
|
||||
let api = self.client.runtime_api();
|
||||
|
||||
Reference in New Issue
Block a user