Skip to content

Commit

Permalink
Add additional re-exports
Browse files Browse the repository at this point in the history
As we do for other types add two new alias' at the crate root of
`primitives`:

- `BlockVersion`

We have a bunch of alias' already e.g., `block::Header as BlockHeader`.

- `TxVersion`

This could equally be `TransactionVersion` to match other alias' but
we also have `TxIn`, `TxOut` so there is an argument for `Tx`. In
light of the fact that there are arguments on both sides opt for the
more terse. Another solution would be adding both?

Also re-export them from the crate root of `bitcoin`.
  • Loading branch information
tcharding committed Feb 25, 2025
1 parent aebda6e commit b989043
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 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},
sequence::{self, Sequence}, // No `sequence` module outside of `primitives`.
transaction::{OutPoint, Transaction, TxIn, TxOut, Txid, Wtxid},
transaction::{OutPoint, Transaction, TxIn, TxOut, Txid, Version as TxVersion, Wtxid},
witness::Witness,
};
#[doc(inline)]
Expand Down
4 changes: 2 additions & 2 deletions primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ pub use self::{
};
#[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 b989043

Please sign in to comment.