Skip to content

Commit

Permalink
more useful error message (paritytech#9014)
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian authored Jun 4, 2021
1 parent a57bc44 commit 7d8a9b6
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 7d8a9b6

Please sign in to comment.