Bump polkadot (#2585)

* Bump polkadot

* Another bump

* Fix for `GrandpaJustification` + `Debug`

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
This commit is contained in:
Tsvetomir Dimitrov
2023-05-16 16:31:23 +03:00
committed by GitHub
parent e98f9dfbef
commit 47858e90e4
2 changed files with 267 additions and 248 deletions
@@ -38,7 +38,7 @@ use sp_std::{
///
/// This particular proof is used to prove that headers on a bridged chain
/// (so not our chain) have been finalized correctly.
#[derive(Encode, Decode, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)]
#[derive(Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
pub struct GrandpaJustification<Header: HeaderT> {
/// The round (voting period) this justification is valid for.
pub round: u64,
@@ -49,6 +49,24 @@ pub struct GrandpaJustification<Header: HeaderT> {
pub votes_ancestries: Vec<Header>,
}
impl<Header: HeaderT> sp_std::fmt::Debug for GrandpaJustification<Header> {
fn fmt(&self, fmt: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
#[cfg(feature = "std")]
{
fmt.debug_struct("GrandpaJustification")
.field("round", &self.round)
.field("commit", &self.commit)
.field("votes_ancestries", &self.votes_ancestries)
.finish()
}
#[cfg(not(feature = "std"))]
{
fmt.write_str("<stripped>")
}
}
}
impl<H: HeaderT> GrandpaJustification<H> {
/// Returns reasonable size of justification using constants from the provided chain.
///