beefy: Add LOG_TARGET constant (#13222)

* LOG_TARGET const
* fmt
This commit is contained in:
Alejandro Martinez Andres
2023-01-24 15:55:42 +01:00
committed by GitHub
parent 14a4eed2aa
commit b9854171c0
10 changed files with 153 additions and 102 deletions
+8 -3
View File
@@ -35,6 +35,7 @@ use sc_consensus::{BlockCheckParams, BlockImport, BlockImportParams, ImportResul
use crate::{
communication::notification::BeefyVersionedFinalityProofSender,
justification::{decode_and_verify_finality_proof, BeefyVersionedFinalityProof},
LOG_TARGET,
};
/// A block-import handler for BEEFY.
@@ -138,16 +139,20 @@ where
(Some(encoded), ImportResult::Imported(_)) => {
if let Ok(proof) = self.decode_and_verify(&encoded, number, hash) {
// The proof is valid and the block is imported and final, we can import.
debug!(target: "beefy", "🥩 import justif {:?} for block number {:?}.", proof, number);
debug!(
target: LOG_TARGET,
"🥩 import justif {:?} for block number {:?}.", proof, number
);
// Send the justification to the BEEFY voter for processing.
self.justification_sender
.notify(|| Ok::<_, ()>(proof))
.expect("forwards closure result; the closure always returns Ok; qed.");
} else {
debug!(
target: "beefy",
target: LOG_TARGET,
"🥩 error decoding justification: {:?} for imported block {:?}",
encoded, number,
encoded,
number,
);
}
},