Run formmater on bip152

Run the formmater on the newly moved `bip152` module. No changes other
than those introduced by `cargo +nightly fmt`.
This commit is contained in:
Tobin C. Harding 2022-10-19 06:41:10 +11:00
parent facd8ba556
commit 4057c26829
2 changed files with 8 additions and 11 deletions

View File

@ -382,7 +382,7 @@ mod psbt_sign {
use std::ops::Deref; use std::ops::Deref;
use bitcoin::psbt::{Input, Prevouts, Psbt, PsbtSighashType}; use bitcoin::psbt::{Input, Prevouts, Psbt, PsbtSighashType};
use bitcoin::sighash::{self, SighashCache, EcdsaSighashType, SchnorrSighashType}; use bitcoin::sighash::{self, EcdsaSighashType, SchnorrSighashType, SighashCache};
use bitcoin::util::taproot::TapLeafHash; use bitcoin::util::taproot::TapLeafHash;
use bitcoin::{EcdsaSig, EcdsaSigError, PrivateKey, Script, Transaction, TxOut}; use bitcoin::{EcdsaSig, EcdsaSigError, PrivateKey, Script, Transaction, TxOut};
use secp256k1::{Message, Secp256k1, Signing}; use secp256k1::{Message, Secp256k1, Signing};

View File

@ -5,18 +5,17 @@
//! Implementation of compact blocks data structure and algorithms. //! Implementation of compact blocks data structure and algorithms.
//! //!
use crate::prelude::*; use core::convert::TryFrom;
use core::{convert, fmt, mem};
use crate::io;
use core::{convert, convert::TryFrom, fmt, mem};
#[cfg(feature = "std")] #[cfg(feature = "std")]
use std::error; use std::error;
use crate::consensus::encode::{self, Decodable, Encodable, VarInt}; use crate::consensus::encode::{self, Decodable, Encodable, VarInt};
use crate::hashes::{sha256, siphash24, Hash}; use crate::hashes::{sha256, siphash24, Hash};
use crate::internal_macros::{impl_array_newtype, impl_bytes_newtype, impl_consensus_encoding}; use crate::internal_macros::{impl_array_newtype, impl_bytes_newtype, impl_consensus_encoding};
use crate::prelude::*;
use crate::util::endian; use crate::util::endian;
use crate::{Block, BlockHash, BlockHeader, Transaction}; use crate::{io, 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)]
@ -69,9 +68,7 @@ pub struct PrefilledTransaction {
} }
impl convert::AsRef<Transaction> for PrefilledTransaction { impl convert::AsRef<Transaction> for PrefilledTransaction {
fn as_ref(&self) -> &Transaction { fn as_ref(&self) -> &Transaction { &self.tx }
&self.tx
}
} }
impl Encodable for PrefilledTransaction { impl Encodable for PrefilledTransaction {
@ -376,8 +373,8 @@ mod test {
use crate::consensus::encode::{deserialize, serialize}; use crate::consensus::encode::{deserialize, serialize};
use crate::hashes::hex::FromHex; use crate::hashes::hex::FromHex;
use crate::{ use crate::{
Block, BlockHash, BlockHeader, BlockVersion, OutPoint, Script, Sequence, Transaction, TxIn, Block, BlockHash, BlockHeader, BlockVersion, CompactTarget, OutPoint, Script, Sequence,
TxMerkleNode, TxOut, Txid, Witness, CompactTarget, Transaction, TxIn, TxMerkleNode, TxOut, Txid, Witness,
}; };
fn dummy_tx(nonce: &[u8]) -> Transaction { fn dummy_tx(nonce: &[u8]) -> Transaction {