chore: add InvalidDifficulty variant

This commit is contained in:
Jude Nelson
2022-05-26 00:12:26 -04:00
parent 74cc416952
commit 04d2275aa0

View File

@@ -79,6 +79,8 @@ pub enum Error {
MissingHeader,
/// Invalid target
InvalidPoW,
/// Bad difficulty
InvalidDifficulty,
/// Wrong number of bytes for constructing an address
InvalidByteSequence,
/// Configuration error
@@ -107,6 +109,7 @@ impl fmt::Display for Error {
Error::NoncontiguousHeader => write!(f, "Non-contiguous header"),
Error::MissingHeader => write!(f, "Missing header"),
Error::InvalidPoW => write!(f, "Invalid proof of work"),
Error::InvalidDifficulty => write!(f, "Chain difficulty cannot decrease"),
Error::InvalidByteSequence => write!(f, "Invalid sequence of bytes"),
Error::ConfigError(ref e_str) => fmt::Display::fmt(e_str, f),
Error::BlockchainHeight => write!(f, "Value is beyond the end of the blockchain"),
@@ -133,6 +136,7 @@ impl error::Error for Error {
Error::NoncontiguousHeader => None,
Error::MissingHeader => None,
Error::InvalidPoW => None,
Error::InvalidDifficulty => None,
Error::InvalidByteSequence => None,
Error::ConfigError(ref _e_str) => None,
Error::BlockchainHeight => None,