Rococo: add new pallet-beefy-mmr API (companion for substrate#11406) (#5516)

* Rococo: add new pallet-beefy-mmr API

* rename BeefyMmr exposed api

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Adrian Catangiu
2022-06-22 22:31:56 +03:00
committed by GitHub
parent f05b9b31d6
commit b9482cf788
2 changed files with 186 additions and 171 deletions
+175 -171
View File
File diff suppressed because it is too large Load Diff
+11
View File
@@ -681,6 +681,7 @@ impl paras_registrar::Config for Runtime {
impl pallet_beefy::Config for Runtime { impl pallet_beefy::Config for Runtime {
type BeefyId = BeefyId; type BeefyId = BeefyId;
type MaxAuthorities = MaxAuthorities; type MaxAuthorities = MaxAuthorities;
type OnNewValidatorSet = MmrLeaf;
} }
type MmrHash = <Keccak256 as sp_runtime::traits::Hash>::Output; type MmrHash = <Keccak256 as sp_runtime::traits::Hash>::Output;
@@ -1441,6 +1442,16 @@ sp_api::impl_runtime_apis! {
} }
} }
impl beefy_merkle_tree::BeefyMmrApi<Block, Hash> for RuntimeApi {
fn authority_set_proof() -> beefy_primitives::mmr::BeefyAuthoritySet<Hash> {
MmrLeaf::authority_set_proof()
}
fn next_authority_set_proof() -> beefy_primitives::mmr::BeefyNextAuthoritySet<Hash> {
MmrLeaf::next_authority_set_proof()
}
}
impl bp_rococo::RococoFinalityApi<Block> for Runtime { impl bp_rococo::RococoFinalityApi<Block> for Runtime {
fn best_finalized() -> (bp_rococo::BlockNumber, bp_rococo::Hash) { fn best_finalized() -> (bp_rococo::BlockNumber, bp_rococo::Hash) {
let header = BridgeRococoGrandpa::best_finalized(); let header = BridgeRococoGrandpa::best_finalized();