Tweaked logging (#2695)

* Tweaked logging

* Debug for Statement
This commit is contained in:
Arkadiy Paronyan
2021-03-24 19:06:44 +01:00
committed by GitHub
parent e49b3e5ca9
commit de85c05102
3 changed files with 13 additions and 9 deletions
+10 -1
View File
@@ -44,7 +44,7 @@ pub mod approval;
/// it gives access to the commitments to validators who have not executed the candidate. This
/// is necessary to allow a block-producing validator to include candidates from outside of the para
/// it is assigned to.
#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)]
#[derive(Clone, PartialEq, Eq, Encode, Decode)]
pub enum Statement {
/// A statement that a validator seconds a candidate.
#[codec(index = 1)]
@@ -54,6 +54,15 @@ pub enum Statement {
Valid(CandidateHash),
}
impl std::fmt::Debug for Statement {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Statement::Seconded(seconded) => write!(f, "Seconded: {:?}", seconded.descriptor),
Statement::Valid(hash) => write!(f, "Valid: {:?}", hash),
}
}
}
impl Statement {
/// Get the candidate hash referenced by this statement.
///