more useful error message (#9014)

This commit is contained in:
Andronik Ordian authored and GitHub committed 2021-06-04 07:05:21 +00:00
1 parent 84811dae00
commit 003738b1c5
1 file changed
+4 -3
@@ -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(