Merge rust-bitcoin/rust-bitcoin#4385: controlblock::decode unused variant
dedb42dd71
fix(taproot): remove unused error variant - clippy::enum_variant_names allow attribute added - cargo formatting changes reversed (aagbotemi) Pull request description: This PR removed unused variant from `TaprootError`, also allow `clippy::enum_variant_names` attribute for TapError (this will help to prevent Clippy Build Error). Another way to fix the clippy build error is to change the variants name, but I think the attribute is better Fixes #4360 ACKs for top commit: apoelstra: ACK dedb42dd7178774cea6ce92d25d7519de52c2526; successfully ran local tests Kixunil: ACKdedb42dd71
Tree-SHA512: ff4c2cb5a8e22a05147db15afc449494460ae788a9cb644cc1140cf1b30777a2ac7b5921113da0dc745471357c081793b32e879e6ff29f9bd5769d0ff9292dd8
This commit is contained in:
commit
561e3aa026
|
@ -1510,6 +1510,7 @@ impl From<InvalidMerkleTreeDepthError> for TaprootBuilderError {
|
|||
/// Detailed error type for Taproot utilities.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[non_exhaustive]
|
||||
#[allow(clippy::enum_variant_names)]
|
||||
pub enum TaprootError {
|
||||
/// Proof size must be a multiple of 32.
|
||||
InvalidMerkleBranchSize(InvalidMerkleBranchSizeError),
|
||||
|
@ -1523,8 +1524,6 @@ pub enum TaprootError {
|
|||
InvalidInternalKey(secp256k1::Error),
|
||||
/// Invalid control block hex
|
||||
InvalidControlBlockHex(HexToBytesError),
|
||||
/// Empty Taproot tree.
|
||||
EmptyTree,
|
||||
}
|
||||
|
||||
impl From<Infallible> for TaprootError {
|
||||
|
@ -1542,7 +1541,6 @@ impl fmt::Display for TaprootError {
|
|||
InvalidControlBlockSize(ref e) => write_err!(f, "invalid control block size"; e),
|
||||
InvalidControlBlockHex(ref e) => write_err!(f, "invalid control block hex"; e),
|
||||
InvalidInternalKey(ref e) => write_err!(f, "invalid internal x-only key"; e),
|
||||
EmptyTree => write!(f, "Taproot tree must contain at least one script"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1557,7 +1555,7 @@ impl std::error::Error for TaprootError {
|
|||
InvalidTaprootLeafVersion(ref e) => Some(e),
|
||||
InvalidMerkleTreeDepth(ref e) => Some(e),
|
||||
InvalidControlBlockHex(ref e) => Some(e),
|
||||
InvalidMerkleBranchSize(_) | InvalidControlBlockSize(_) | EmptyTree => None,
|
||||
InvalidMerkleBranchSize(_) | InvalidControlBlockSize(_) => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue