Skip to content

Commit

Permalink
primitives: Add additional re-exports
Browse files Browse the repository at this point in the history
We have a few types that can reasonably be re-exported at the root of
both `primitives` and `bitcoin`.

- `ScriptHash` and `WScriptHash` - we export all the other hash types
- `BlockVersion` alias to `block::Version`
- `TxVersion` alias to `transaction::Version`
  • Loading branch information
tcharding committed Feb 19, 2025
1 parent 38c8c90 commit 6b22b94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions bitcoin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,15 @@ pub mod taproot;
pub use primitives::{
block::{
Block, BlockHash, Checked as BlockChecked, Header as BlockHeader,
Unchecked as BlockUnchecked, Validation as BlockValidation, WitnessCommitment,
Unchecked as BlockUnchecked, Validation as BlockValidation, Version as BlockVersion,
WitnessCommitment,
},
merkle_tree::{TxMerkleNode, WitnessMerkleNode},
opcodes::Opcode,
pow::CompactTarget, // No `pow` module outside of `primitives`.
script::{Script, ScriptBuf},
script::{Script, ScriptBuf, ScriptHash, WScriptHash},
sequence::{self, Sequence}, // No `sequence` module outside of `primitives`.
transaction::{OutPoint, Transaction, TxIn, TxOut, Txid, Wtxid},
transaction::{OutPoint, Transaction, TxIn, TxOut, Txid, Verison as TxVersion, Wtxid},
witness::Witness,
};
#[doc(inline)]
Expand Down
6 changes: 3 additions & 3 deletions primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@ pub use self::{
block::{
Block, Checked as BlockChecked, Unchecked as BlockUnchecked, Validation as BlockValidation,
},
script::{Script, ScriptBuf},
script::{Script, ScriptBuf, ScriptHash, WScriptHash},
transaction::{Transaction, TxIn, TxOut},
witness::Witness,
};
#[doc(inline)]
pub use self::{
block::{BlockHash, Header as BlockHeader, WitnessCommitment},
block::{BlockHash, Header as BlockHeader, Version as BlockVersion, WitnessCommitment},
locktime::{absolute, relative},
merkle_tree::{TxMerkleNode, WitnessMerkleNode},
opcodes::Opcode,
pow::CompactTarget,
sequence::Sequence,
taproot::{TapBranchTag, TapLeafHash, TapLeafTag, TapNodeHash, TapTweakHash, TapTweakTag},
transaction::{OutPoint, Txid, Wtxid},
transaction::{OutPoint, Txid, Version as TxVersion, Wtxid},
};

#[rustfmt::skip]
Expand Down

0 comments on commit 6b22b94

Please sign in to comment.