Do not export unusual hash types at crate root

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`
- `Sighash`

Fix: #1541
This commit is contained in:
Tobin C. Harding 2023-02-03 14:04:37 +11:00
parent 732dd038ff
commit aae03999a5
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
4 changed files with 7 additions and 5 deletions

View File

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

View File

@ -568,7 +568,8 @@ impl<E> EncodeSigningDataResult<E> {
/// ///
/// ```rust /// ```rust
/// # use bitcoin::consensus::deserialize; /// # use bitcoin::consensus::deserialize;
/// # use bitcoin::{Transaction, Sighash}; /// # use bitcoin::Transaction;
/// # use bitcoin::hash_types::Sighash;
/// # use bitcoin_hashes::{Hash, hex::FromHex}; /// # use bitcoin_hashes::{Hash, hex::FromHex};
/// # let mut writer = Sighash::engine(); /// # let mut writer = Sighash::engine();
/// # let input_index = 0; /// # 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::key::{self, PrivateKey, PublicKey};
pub use crate::crypto::{ecdsa, schnorr}; pub use crate::crypto::{ecdsa, schnorr};
pub use crate::error::Error; 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::merkle_tree::MerkleBlock;
pub use crate::network::constants::Network; pub use crate::network::constants::Network;
pub use crate::pow::{CompactTarget, Target, Work}; pub use crate::pow::{CompactTarget, Target, Work};

View File

@ -12,12 +12,13 @@ use core::borrow::Borrow;
use core::ops::{Deref, DerefMut}; use core::ops::{Deref, DerefMut};
use core::{fmt, str}; 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::transaction::EncodeSigningDataResult;
use crate::blockdata::witness::Witness; use crate::blockdata::witness::Witness;
use crate::consensus::{encode, Encodable}; use crate::consensus::{encode, Encodable};
use crate::error::impl_std_error; use crate::error::impl_std_error;
use crate::hashes::{sha256, sha256d, Hash}; use crate::hashes::{sha256, sha256d, Hash};
use crate::hash_types::Sighash;
use crate::prelude::*; use crate::prelude::*;
use crate::taproot::{LeafVersion, TapLeafHash, TapSighashHash, TAPROOT_ANNEX_PREFIX}; use crate::taproot::{LeafVersion, TapLeafHash, TapSighashHash, TAPROOT_ANNEX_PREFIX};