mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-29 12:15:22 +08:00
chore: add InvalidDifficulty variant
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user