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`.
This commit is contained in:
Tobin C. Harding 2025-03-08 08:30:10 +11:00
parent e2dee4900f
commit c707b959b7
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
5 changed files with 7 additions and 7 deletions

View File

@ -135,7 +135,7 @@ pub use units::{
amount::{Amount, Denomination, SignedAmount},
block::{BlockHeight, BlockInterval},
fee_rate::FeeRate,
timestamp::{self, BlockTime},
time::{self, BlockTime},
weight::Weight,
};

View File

@ -58,7 +58,7 @@ pub use units::{
amount::{self, Amount, SignedAmount},
block::{BlockHeight, BlockInterval},
fee_rate::{self, FeeRate},
timestamp::{self, BlockTime},
time::{self, BlockTime},
weight::{self, Weight},
};

View File

@ -34,7 +34,7 @@ pub mod block;
pub mod fee_rate;
pub mod locktime;
pub mod parse;
pub mod timestamp;
pub mod time;
pub mod weight;
#[doc(inline)]
@ -43,6 +43,6 @@ pub use self::{
amount::{Amount, SignedAmount},
block::{BlockHeight, BlockInterval},
fee_rate::FeeRate,
timestamp::BlockTime,
time::BlockTime,
weight::Weight
};

View File

@ -141,7 +141,7 @@ struct Errors {
#[test]
fn api_can_use_modules_from_crate_root() {
use bitcoin_units::{amount, block, fee_rate, locktime, parse, timestamp, weight};
use bitcoin_units::{amount, block, fee_rate, locktime, parse, time, weight};
}
#[test]
@ -189,8 +189,8 @@ fn api_can_use_all_types_from_module_parse() {
}
#[test]
fn api_can_use_all_types_from_module_timestamp() {
use bitcoin_units::timestamp::BlockTime;
fn api_can_use_all_types_from_module_time() {
use bitcoin_units::time::BlockTime;
}
#[test]