Skip to content

Commit fa0c968

Browse files
committed
Move locktime and sequence code to units
Move the `sequence` module and the code from both locktime modules from `primitives` to `units`.
1 parent d20e586 commit fa0c968

File tree

14 files changed

+1412
-1460
lines changed

14 files changed

+1412
-1460
lines changed

bitcoin/src/blockdata/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ pub mod locktime {
3939

4040
pub use crate::consensus::encode::{self, Decodable, Encodable};
4141

42-
/// Re-export everything from the `primitives::locktime::absolute` module.
42+
/// Re-export everything from the `units::locktime::absolute` module.
4343
#[rustfmt::skip] // Keep public re-exports separate.
44-
pub use primitives::locktime::absolute::{ConversionError, Height, LockTime, ParseHeightError, ParseTimeError, MedianTimePast};
44+
pub use units::locktime::absolute::{ConversionError, Height, LockTime, ParseHeightError, ParseTimeError, MedianTimePast};
4545

4646
#[deprecated(since = "TBD", note = "use `MedianTimePast` instead")]
4747
#[doc(hidden)]
@@ -69,8 +69,8 @@ pub mod locktime {
6969
//! There are two types of lock time: lock-by-height and lock-by-time, distinguished by
7070
//! whether bit 22 of the `u32` consensus value is set.
7171
72-
/// Re-export everything from the `primitives::locktime::relative` module.
73-
pub use primitives::locktime::relative::{
72+
/// Re-export everything from the `units::locktime::relative` module.
73+
pub use units::locktime::relative::{
7474
DisabledLockTimeError, InvalidHeightError, InvalidTimeError, LockTime,
7575
NumberOf512Seconds, NumberOfBlocks, TimeOverflowError,
7676
};

primitives/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@ pub mod _export {
3838
}
3939

4040
pub mod block;
41-
pub mod locktime;
4241
pub mod merkle_tree;
4342
mod opcodes;
4443
pub mod pow;
4544
#[cfg(feature = "alloc")]
4645
pub mod script;
47-
pub mod sequence;
4846
pub mod transaction;
4947
#[cfg(feature = "alloc")]
5048
pub mod witness;
@@ -54,6 +52,8 @@ pub use units::{
5452
amount::{self, Amount, SignedAmount},
5553
block::{BlockHeight, BlockHeightInterval, BlockMtp, BlockMtpInterval},
5654
fee_rate::{self, FeeRate},
55+
locktime::{self, absolute, relative},
56+
sequence::{self, Sequence},
5757
time::{self, BlockTime},
5858
weight::{self, Weight},
5959
};
@@ -75,10 +75,8 @@ pub use self::{
7575
#[doc(inline)]
7676
pub use self::{
7777
block::{BlockHash, Header as BlockHeader, Version as BlockVersion, WitnessCommitment},
78-
locktime::{absolute, relative},
7978
merkle_tree::{TxMerkleNode, WitnessMerkleNode},
8079
pow::CompactTarget,
81-
sequence::Sequence,
8280
transaction::{OutPoint, Txid, Version as TransactionVersion, Wtxid},
8381
};
8482

0 commit comments

Comments
 (0)