mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 19:11:04 +00:00
Subscribe to justifications in Millau->Rialto headers sync (#394)
* maintain MillauHeadersToRialto sync by subscribing to Millau justifications * more tracing in maintain * Update relays/substrate/src/headers_maintain.rs Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> * Update relays/substrate/src/headers_maintain.rs Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> * -Please * -TODO * revert raise recursion limit * updated comment Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
This commit is contained in:
committed by
Bastian Köcher
parent
e2d9b6393d
commit
1b96e51679
@@ -44,6 +44,15 @@ pub enum Error {
|
||||
InvalidPrecommitAncestries,
|
||||
}
|
||||
|
||||
/// Decode justification target.
|
||||
pub fn decode_justification_target<Header: HeaderT>(
|
||||
raw_justification: &[u8],
|
||||
) -> Result<(Header::Hash, Header::Number), Error> {
|
||||
GrandpaJustification::<Header>::decode(&mut &raw_justification[..])
|
||||
.map(|justification| (justification.commit.target_hash, justification.commit.target_number))
|
||||
.map_err(|_| Error::JustificationDecode)
|
||||
}
|
||||
|
||||
/// Verify that justification, that is generated by given authority set, finalizes given header.
|
||||
pub fn verify_justification<Header: HeaderT>(
|
||||
finalized_target: (Header::Hash, Header::Number),
|
||||
|
||||
@@ -41,6 +41,8 @@ use sp_std::{marker::PhantomData, prelude::*};
|
||||
// Re-export since the node uses these when configuring genesis
|
||||
pub use storage::{AuthoritySet, ScheduledChange};
|
||||
|
||||
pub use justification::decode_justification_target;
|
||||
|
||||
mod justification;
|
||||
mod storage;
|
||||
mod storage_proof;
|
||||
|
||||
Reference in New Issue
Block a user