2025-04-27 automated rustfmt nightly
This commit is contained in:
parent
1bee39bfe7
commit
6737c3a0e5
|
@ -251,6 +251,7 @@ where
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use alloc::vec;
|
||||
|
||||
use hex::FromHex as _;
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -224,13 +224,11 @@ mod tests {
|
|||
let arbitrary_bytes = [0x00; 32];
|
||||
assert!(WitnessProgram::new(WitnessVersion::V1, &arbitrary_bytes)
|
||||
.expect("valid witness program")
|
||||
.is_p2tr()
|
||||
);
|
||||
.is_p2tr());
|
||||
|
||||
let p2a_bytes = [78, 115];
|
||||
assert!(WitnessProgram::new(WitnessVersion::V1, &p2a_bytes)
|
||||
.expect("valid witness program")
|
||||
.is_p2a()
|
||||
);
|
||||
.is_p2a());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -361,7 +361,8 @@ mod test {
|
|||
|
||||
#[test]
|
||||
fn consensus_serialize() {
|
||||
let el_0 = hex!("03d2e15674941bad4a996372cb87e1856d3652606d98562fe39c5e9e7e413f2105").to_vec();
|
||||
let el_0 =
|
||||
hex!("03d2e15674941bad4a996372cb87e1856d3652606d98562fe39c5e9e7e413f2105").to_vec();
|
||||
let el_1 = hex!("000000").to_vec();
|
||||
|
||||
let mut want_witness = Witness::default();
|
||||
|
|
|
@ -512,6 +512,8 @@ impl std::error::Error for MerkleBlockError {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use hex::{DisplayHex, FromHex};
|
||||
use hex_lit::hex;
|
||||
#[cfg(feature = "rand-std")]
|
||||
use {core::cmp, secp256k1::rand::prelude::*};
|
||||
|
||||
|
@ -519,8 +521,6 @@ mod tests {
|
|||
use crate::block::{BlockUncheckedExt as _, Unchecked};
|
||||
use crate::consensus::encode;
|
||||
use crate::hash_types::Txid;
|
||||
use hex::{DisplayHex, FromHex};
|
||||
use hex_lit::hex;
|
||||
|
||||
#[cfg(feature = "rand-std")]
|
||||
macro_rules! pmt_tests {
|
||||
|
|
|
@ -789,7 +789,9 @@ impl TryFrom<TaprootBuilder> for TapTree {
|
|||
///
|
||||
/// A [`TapTree`] iff the `builder` is complete, otherwise return [`IncompleteBuilderError`]
|
||||
/// error with the content of incomplete `builder` instance.
|
||||
fn try_from(builder: TaprootBuilder) -> Result<Self, Self::Error> { builder.try_into_tap_tree() }
|
||||
fn try_from(builder: TaprootBuilder) -> Result<Self, Self::Error> {
|
||||
builder.try_into_tap_tree()
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<NodeInfo> for TapTree {
|
||||
|
|
|
@ -223,7 +223,8 @@ impl fmt::Display for Header {
|
|||
self.time.to_u32().to_le_bytes().as_hex(),
|
||||
self.bits.to_consensus().to_le_bytes().as_hex(),
|
||||
self.nonce.to_le_bytes().as_hex(),
|
||||
).expect("total length of written objects is 160 characters");
|
||||
)
|
||||
.expect("total length of written objects is 160 characters");
|
||||
fmt::Display::fmt(&buf, f)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ use core::ops;
|
|||
use NumOpResult as R;
|
||||
|
||||
use super::{Amount, SignedAmount};
|
||||
use crate::internal_macros::{impl_div_assign, impl_mul_assign};
|
||||
use crate::{MathOp, NumOpError, NumOpResult, OptionExt};
|
||||
use crate::internal_macros::{impl_mul_assign, impl_div_assign};
|
||||
|
||||
impl From<Amount> for NumOpResult<Amount> {
|
||||
fn from(a: Amount) -> Self { Self::Valid(a) }
|
||||
|
|
|
@ -24,14 +24,10 @@ fn sat(sat: u64) -> Amount { Amount::from_sat(sat).unwrap() }
|
|||
fn ssat(ssat: i64) -> SignedAmount { SignedAmount::from_sat(ssat).unwrap() }
|
||||
|
||||
#[track_caller]
|
||||
fn res(n_sat: u64) -> NumOpResult<Amount>{
|
||||
NumOpResult::from(sat(n_sat))
|
||||
}
|
||||
fn res(n_sat: u64) -> NumOpResult<Amount> { NumOpResult::from(sat(n_sat)) }
|
||||
|
||||
#[track_caller]
|
||||
fn sres(n_sat: i64) -> NumOpResult<SignedAmount>{
|
||||
NumOpResult::from(ssat(n_sat))
|
||||
}
|
||||
fn sres(n_sat: i64) -> NumOpResult<SignedAmount> { NumOpResult::from(ssat(n_sat)) }
|
||||
|
||||
#[test]
|
||||
fn sanity_check() {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
//! Provides a monodic type returned by mathematical operations (`core::ops`).
|
||||
|
||||
use core::fmt;
|
||||
use core::convert::Infallible;
|
||||
use core::fmt;
|
||||
|
||||
use NumOpResult as R;
|
||||
|
||||
|
|
Loading…
Reference in New Issue