more useful error message (#9014)

This commit is contained in:
Andronik Ordian
2021-06-04 09:05:21 +02:00
committed by GitHub
parent 84811dae00
commit 003738b1c5
@@ -646,9 +646,10 @@ where
initial_sync: bool,
) -> Result<(), ConsensusError> {
if justification.0 != GRANDPA_ENGINE_ID {
return Err(ConsensusError::ClientImport(
"GRANDPA can only import GRANDPA Justifications.".into(),
));
return Err(ConsensusError::ClientImport(format!(
"Expected GRANDPA Justification, got {}.",
String::from_utf8_lossy(&justification.0)
)));
}
let justification = GrandpaJustification::decode_and_verify_finalizes(