Skip to content

Commit c707b95

Browse files
committed
Rename timestamp module to time
We just re-named `Timestamp` to `BlockTime`. We have a `units::block` module but it currently holds abstractions (`BlockHeight` and `BlockInterval`) that are not onchain abstractions and therefore somewhat different from the `BlockTime`. Instead of making `block` a block 'utils' module instead re-name the `timestamp` module to `time`.
1 parent e2dee49 commit c707b95

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

bitcoin/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub use units::{
135135
amount::{Amount, Denomination, SignedAmount},
136136
block::{BlockHeight, BlockInterval},
137137
fee_rate::FeeRate,
138-
timestamp::{self, BlockTime},
138+
time::{self, BlockTime},
139139
weight::Weight,
140140
};
141141

primitives/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub use units::{
5858
amount::{self, Amount, SignedAmount},
5959
block::{BlockHeight, BlockInterval},
6060
fee_rate::{self, FeeRate},
61-
timestamp::{self, BlockTime},
61+
time::{self, BlockTime},
6262
weight::{self, Weight},
6363
};
6464

units/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub mod block;
3434
pub mod fee_rate;
3535
pub mod locktime;
3636
pub mod parse;
37-
pub mod timestamp;
37+
pub mod time;
3838
pub mod weight;
3939

4040
#[doc(inline)]
@@ -43,6 +43,6 @@ pub use self::{
4343
amount::{Amount, SignedAmount},
4444
block::{BlockHeight, BlockInterval},
4545
fee_rate::FeeRate,
46-
timestamp::BlockTime,
46+
time::BlockTime,
4747
weight::Weight
4848
};
File renamed without changes.

units/tests/api.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ struct Errors {
141141

142142
#[test]
143143
fn api_can_use_modules_from_crate_root() {
144-
use bitcoin_units::{amount, block, fee_rate, locktime, parse, timestamp, weight};
144+
use bitcoin_units::{amount, block, fee_rate, locktime, parse, time, weight};
145145
}
146146

147147
#[test]
@@ -189,8 +189,8 @@ fn api_can_use_all_types_from_module_parse() {
189189
}
190190

191191
#[test]
192-
fn api_can_use_all_types_from_module_timestamp() {
193-
use bitcoin_units::timestamp::BlockTime;
192+
fn api_can_use_all_types_from_module_time() {
193+
use bitcoin_units::time::BlockTime;
194194
}
195195

196196
#[test]

0 commit comments

Comments
 (0)