introduce MissingParent Error, fixes #10699 (#10700)

This commit is contained in:
Lazaridis 2019-05-31 15:53:17 +03:00 committed by David
parent 7e89bab4aa
commit 33d3bfae8b
2 changed files with 4 additions and 1 deletions

View File

@ -731,7 +731,7 @@ impl AuthorityRound {
if !epoch_manager.zoom_to_after(&*client, &self.machine, &*self.validators, *header.parent_hash()) {
debug!(target: "engine", "Unable to zoom to epoch.");
return Err(EngineError::RequiresClient.into())
return Err(EngineError::MissingParent.into())
}
(CowLike::Owned(epoch_manager.validators().clone()), epoch_manager.epoch_transition_number)

View File

@ -89,6 +89,8 @@ pub enum EngineError {
InvalidEngine,
/// Requires signer ref, but none registered.
RequiresSigner,
/// Missing Parent Epoch
MissingParent,
/// Checkpoint is missing
CliqueMissingCheckpoint(H256),
/// Missing vanity data
@ -137,6 +139,7 @@ impl fmt::Display for EngineError {
RequiresClient => format!("Call requires client but none registered"),
RequiresSigner => format!("Call requires signer but none registered"),
InvalidEngine => format!("Invalid engine specification or implementation"),
MissingParent => format!("Parent Epoch is missing from database"),
};
f.write_fmt(format_args!("Engine error ({})", msg))