Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

afg: more useful error message #9014

Merged
1 commit merged into from
Jun 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions client/finality-grandpa/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down