Merge rust-bitcoin/rust-bitcoin#1617: Do not export unusual hash types at crate root

aae03999a5 Do not export unusual hash types at crate root (Tobin C. Harding)

Pull request description:

  Currently we use a wildcard to export all the hash types in `hash_types`. We are moving to a world were we only export normal/standard types from the crate root.

  Remove the reexport of the following hash types:

  - `FilterHash`
  - `FilterHeader`
  - `TxMerkleNode`
  - `WitnessCommitment`
  - `WitnessMerkleNode`
  - `XpubIdentifier`

  Fix: #1541

ACKs for top commit:
  Kixunil:
    ACK aae03999a5
  apoelstra:
    ACK aae03999a5

Tree-SHA512: 957b5af9fe582b4c94e73be5cd8fa957112c3eddda09ae45c7f735e4618e130031dd2aec446b721c4f393bbfc8584c64f57eb4957cf5411ea00a752bc8ed0e64
This commit is contained in:
Andrew Poelstra 2023-02-06 13:51:20 +00:00
commit 51acce8358
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
4 changed files with 7 additions and 5 deletions

View File

@ -376,9 +376,9 @@ mod test {
use crate::blockdata::locktime::absolute;
use crate::consensus::encode::{deserialize, serialize};
use crate::hashes::hex::FromHex;
use crate::hash_types::TxMerkleNode;
use crate::{
CompactTarget, OutPoint, ScriptBuf, Sequence, Transaction, TxIn, TxMerkleNode, TxOut, Txid,
Witness,
CompactTarget, OutPoint, ScriptBuf, Sequence, Transaction, TxIn, TxOut, Txid, Witness,
};
fn dummy_tx(nonce: &[u8]) -> Transaction {

View File

@ -568,7 +568,8 @@ impl<E> EncodeSigningDataResult<E> {
///
/// ```rust
/// # use bitcoin::consensus::deserialize;
/// # use bitcoin::{Transaction, Sighash};
/// # use bitcoin::Transaction;
/// # use bitcoin::hash_types::Sighash;
/// # use bitcoin_hashes::{Hash, hex::FromHex};
/// # let mut writer = Sighash::engine();
/// # let input_index = 0;

View File

@ -137,7 +137,7 @@ pub use crate::consensus::encode::VarInt;
pub use crate::crypto::key::{self, PrivateKey, PublicKey};
pub use crate::crypto::{ecdsa, schnorr};
pub use crate::error::Error;
pub use crate::hash_types::*;
pub use crate::hash_types::{Txid, Wtxid, BlockHash, PubkeyHash, ScriptHash, WPubkeyHash, WScriptHash};
pub use crate::merkle_tree::MerkleBlock;
pub use crate::network::constants::Network;
pub use crate::pow::{CompactTarget, Target, Work};

View File

@ -12,12 +12,13 @@ use core::borrow::Borrow;
use core::ops::{Deref, DerefMut};
use core::{fmt, str};
use crate::{io, Script, ScriptBuf, Transaction, TxIn, TxOut, Sequence, Sighash};
use crate::{io, Script, ScriptBuf, Transaction, TxIn, TxOut, Sequence};
use crate::blockdata::transaction::EncodeSigningDataResult;
use crate::blockdata::witness::Witness;
use crate::consensus::{encode, Encodable};
use crate::error::impl_std_error;
use crate::hashes::{sha256, sha256d, Hash};
use crate::hash_types::Sighash;
use crate::prelude::*;
use crate::taproot::{LeafVersion, TapLeafHash, TapSighashHash, TAPROOT_ANNEX_PREFIX};