Add mmr_root() to pallet-mmr API to expose root from state (companion for substrate#11183) (#5276)

* Add mmr_root() to pallet-mmr API to expose root from state

* use the right MmrApi primitives

* bridges: use correct mmr primitives

* rococo: beefy-mmr deposit mmr root digest

* fix lockfile

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Adrian Catangiu
2022-04-13 13:55:18 +03:00
committed by GitHub
parent ff18cabbc5
commit a46237cebb
20 changed files with 262 additions and 220 deletions
@@ -44,7 +44,6 @@ pallet-beefy = { git = "https://github.com/paritytech/substrate", branch = "mast
pallet-beefy-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -57,6 +56,7 @@ sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch =
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -114,6 +114,7 @@ std = [
"sp-core/std",
"sp-finality-grandpa/std",
"sp-inherents/std",
"sp-mmr-primitives/std",
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
@@ -39,7 +39,7 @@ use bridge_runtime_common::messages::{
use pallet_grandpa::{
fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList,
};
use pallet_mmr_primitives::{
use sp_mmr_primitives::{
DataOrHash, EncodableOpaqueLeaf, Error as MmrError, LeafDataProvider, Proof as MmrProof,
};
use pallet_transaction_payment::{FeeDetails, Multiplier, RuntimeDispatchInfo};
@@ -680,7 +680,7 @@ impl_runtime_apis! {
}
}
impl pallet_mmr_primitives::MmrApi<Block, MmrHash> for Runtime {
impl sp_mmr_primitives::MmrApi<Block, MmrHash> for Runtime {
fn generate_proof(leaf_index: u64)
-> Result<(EncodableOpaqueLeaf, MmrProof<MmrHash>), MmrError>
{