2024-10-27 automated rustfmt nightly
This commit is contained in:
parent
b11bd9a6b5
commit
39f46a16bc
|
@ -49,19 +49,15 @@ impl Decodable for Witness {
|
||||||
let element_size_len = compact_size::encoded_size(element_size);
|
let element_size_len = compact_size::encoded_size(element_size);
|
||||||
let required_len = cursor
|
let required_len = cursor
|
||||||
.checked_add(element_size)
|
.checked_add(element_size)
|
||||||
.ok_or(encode::Error::Parse(
|
.ok_or(encode::Error::Parse(encode::ParseError::OversizedVectorAllocation {
|
||||||
encode::ParseError::OversizedVectorAllocation {
|
requested: usize::MAX,
|
||||||
requested: usize::MAX,
|
max: MAX_VEC_SIZE,
|
||||||
max: MAX_VEC_SIZE,
|
}))?
|
||||||
},
|
|
||||||
))?
|
|
||||||
.checked_add(element_size_len)
|
.checked_add(element_size_len)
|
||||||
.ok_or(encode::Error::Parse(
|
.ok_or(encode::Error::Parse(encode::ParseError::OversizedVectorAllocation {
|
||||||
encode::ParseError::OversizedVectorAllocation {
|
requested: usize::MAX,
|
||||||
requested: usize::MAX,
|
max: MAX_VEC_SIZE,
|
||||||
max: MAX_VEC_SIZE,
|
}))?;
|
||||||
},
|
|
||||||
))?;
|
|
||||||
|
|
||||||
if required_len > MAX_VEC_SIZE + witness_index_space {
|
if required_len > MAX_VEC_SIZE + witness_index_space {
|
||||||
return Err(encode::ParseError::OversizedVectorAllocation {
|
return Err(encode::ParseError::OversizedVectorAllocation {
|
||||||
|
|
|
@ -61,7 +61,7 @@ pub enum DecodeError<E> {
|
||||||
/// Data unconsumed error.
|
/// Data unconsumed error.
|
||||||
Unconsumed,
|
Unconsumed,
|
||||||
/// Other decoding error.
|
/// Other decoding error.
|
||||||
Other(E), // Yielded by the inner iterator.
|
Other(E), // Yielded by the inner iterator.
|
||||||
}
|
}
|
||||||
|
|
||||||
internals::impl_from_infallible!(DecodeError<E>);
|
internals::impl_from_infallible!(DecodeError<E>);
|
||||||
|
|
|
@ -359,8 +359,7 @@ impl<D: fmt::Display> serde::de::Expected for DisplayExpected<D> {
|
||||||
// not a trait impl because we panic on some variants
|
// not a trait impl because we panic on some variants
|
||||||
fn consensus_error_into_serde<E: serde::de::Error>(error: ParseError) -> E {
|
fn consensus_error_into_serde<E: serde::de::Error>(error: ParseError) -> E {
|
||||||
match error {
|
match error {
|
||||||
ParseError::MissingData =>
|
ParseError::MissingData => E::custom("missing data (early end of file or slice too short)"),
|
||||||
E::custom("missing data (early end of file or slice too short)"),
|
|
||||||
ParseError::OversizedVectorAllocation { requested, max } => E::custom(format_args!(
|
ParseError::OversizedVectorAllocation { requested, max } => E::custom(format_args!(
|
||||||
"the requested allocation of {} items exceeds maximum of {}",
|
"the requested allocation of {} items exceeds maximum of {}",
|
||||||
requested, max
|
requested, max
|
||||||
|
|
|
@ -147,7 +147,8 @@ impl fmt::Display for Error {
|
||||||
ConsensusEncoding(ref e) => write_err!(f, "bitcoin consensus encoding error"; e),
|
ConsensusEncoding(ref e) => write_err!(f, "bitcoin consensus encoding error"; e),
|
||||||
ConsensusDeserialize(ref e) =>
|
ConsensusDeserialize(ref e) =>
|
||||||
write_err!(f, "bitcoin consensus deserializaton error"; e),
|
write_err!(f, "bitcoin consensus deserializaton error"; e),
|
||||||
ConsensusParse(ref e) => write_err!(f, "error parsing bitcoin consensus encoded object"; e),
|
ConsensusParse(ref e) =>
|
||||||
|
write_err!(f, "error parsing bitcoin consensus encoded object"; e),
|
||||||
NegativeFee => f.write_str("PSBT has a negative fee which is not allowed"),
|
NegativeFee => f.write_str("PSBT has a negative fee which is not allowed"),
|
||||||
FeeOverflow => f.write_str("integer overflow in fee calculation"),
|
FeeOverflow => f.write_str("integer overflow in fee calculation"),
|
||||||
InvalidPublicKey(ref e) => write_err!(f, "invalid public key"; e),
|
InvalidPublicKey(ref e) => write_err!(f, "invalid public key"; e),
|
||||||
|
|
|
@ -27,7 +27,9 @@ use crate::{Script, ScriptBuf};
|
||||||
pub use crate::crypto::taproot::{SigFromSliceError, Signature};
|
pub use crate::crypto::taproot::{SigFromSliceError, Signature};
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use merkle_branch::TaprootMerkleBranch;
|
pub use merkle_branch::TaprootMerkleBranch;
|
||||||
pub use primitives::taproot::{TapLeafTag, TapLeafHash, TapBranchTag, TapNodeHash, TapTweakTag, TapTweakHash};
|
pub use primitives::taproot::{
|
||||||
|
TapBranchTag, TapLeafHash, TapLeafTag, TapNodeHash, TapTweakHash, TapTweakTag,
|
||||||
|
};
|
||||||
|
|
||||||
crate::internal_macros::define_extension_trait! {
|
crate::internal_macros::define_extension_trait! {
|
||||||
/// Extension functionality for the [`TapTweakHash`] type.
|
/// Extension functionality for the [`TapTweakHash`] type.
|
||||||
|
|
|
@ -58,8 +58,8 @@ pub use self::{
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
pub use self::{
|
pub use self::{
|
||||||
locktime::{absolute, relative},
|
locktime::{absolute, relative},
|
||||||
witness::Witness,
|
|
||||||
transaction::{TxIn, TxOut},
|
transaction::{TxIn, TxOut},
|
||||||
|
witness::Witness,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
|
|
Loading…
Reference in New Issue