Remove InvalidParentHash in favor of assert! (#8300)

* Remove InvalidParentHash in favor of assert!

* Typo: assert test true case
This commit is contained in:
Wei Tang
2018-04-05 17:03:25 +08:00
committed by André Silva
parent 9d3771458d
commit e4168c2985
2 changed files with 3 additions and 7 deletions

View File

@@ -86,9 +86,6 @@ pub enum BlockError {
TemporarilyInvalid(OutOfBounds<u64>),
/// Log bloom header field is invalid.
InvalidLogBloom(Mismatch<Bloom>),
/// Parent hash field of header is invalid; this is an invalid error indicating a logic flaw in the codebase.
/// TODO: remove and favour an assert!/panic!.
InvalidParentHash(Mismatch<H256>),
/// Number field of header is invalid.
InvalidNumber(Mismatch<BlockNumber>),
/// Block number isn't sensible.
@@ -131,7 +128,6 @@ impl fmt::Display for BlockError {
InvalidTimestamp(ref oob) => format!("Invalid timestamp in header: {}", oob),
TemporarilyInvalid(ref oob) => format!("Future timestamp in header: {}", oob),
InvalidLogBloom(ref oob) => format!("Invalid log bloom in header: {}", oob),
InvalidParentHash(ref mis) => format!("Invalid parent hash: {}", mis),
InvalidNumber(ref mis) => format!("Invalid number in header: {}", mis),
RidiculousNumber(ref oob) => format!("Implausible block number. {}", oob),
UnknownParent(ref hash) => format!("Unknown parent: {}", hash),