Add non_exhaustive to _all_ errors
We are no using `non_exhaustive` on any error types unless we are _really_ sure there will be no additional variants required. There are only three error enums that do not have it in the codebase as of this commit, add it to all three.
This commit is contained in:
parent
9bac1a0b8b
commit
a37ab82503
|
@ -20,6 +20,7 @@ use crate::{Block, BlockHash, BlockHeader, Transaction};
|
||||||
|
|
||||||
/// A BIP-152 error
|
/// A BIP-152 error
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Copy, PartialOrd, Ord, Hash)]
|
#[derive(Clone, PartialEq, Eq, Debug, Copy, PartialOrd, Ord, Hash)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// An unknown version number was used.
|
/// An unknown version number was used.
|
||||||
UnknownVersion,
|
UnknownVersion,
|
||||||
|
|
|
@ -57,6 +57,7 @@ const M: u64 = 784931;
|
||||||
|
|
||||||
/// Errors for blockfilter
|
/// Errors for blockfilter
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// missing UTXO, can not calculate script filter
|
/// missing UTXO, can not calculate script filter
|
||||||
UtxoMissing(OutPoint),
|
UtxoMissing(OutPoint),
|
||||||
|
|
|
@ -55,6 +55,7 @@ use crate::{Block, BlockHeader};
|
||||||
|
|
||||||
/// An error when verifying the merkle block
|
/// An error when verifying the merkle block
|
||||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum MerkleBlockError {
|
pub enum MerkleBlockError {
|
||||||
/// When header merkle root don't match to the root calculated from the partial merkle tree
|
/// When header merkle root don't match to the root calculated from the partial merkle tree
|
||||||
MerkleRootMismatch,
|
MerkleRootMismatch,
|
||||||
|
|
Loading…
Reference in New Issue