What changed, and why it matters
This commit is a routine cleanup that swaps deprecated type names for their newer replacements in test files only. It does not change any production code, behavior, or security properties.
No security action needed. Treat as normal maintenance/refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates three test files in the units crate to stop importing and using deprecated types (BlockInterval, BlockMtp, relative Height, relative Time) and instead use the newly introduced non-deprecated equivalents (BlockHeightInterval, BlockMtpInterval, etc.). No logic changes; only identifiers in tests are renamed.
Changed components
units/tests/api.rsunits/tests/serde.rsunits/tests/str.rsInspect captured patch +8 / −9
diff --git a/units/tests/api.rs b/units/tests/api.rs
index 68fc495c..79b0a7f3 100644
--- a/units/tests/api.rs
+++ b/units/tests/api.rs
@@ -158,7 +158,7 @@ fn api_can_use_modules_from_crate_root() {
#[test]
fn api_can_use_types_from_crate_root() {
use bitcoin_units::{
- Amount, BlockHeight, BlockHeightInterval, BlockInterval, BlockMtp, BlockMtpInterval,
+ Amount, BlockHeight, BlockHeightInterval, BlockMtp, BlockMtpInterval,
BlockTime, FeeRate, NumOpResult, SignedAmount, Weight,
};
}
@@ -210,8 +210,7 @@ fn api_can_use_all_types_from_module_locktime_relative() {
InvalidHeightError as _, InvalidTimeError as _, TimeOverflowError as _,
};
use bitcoin_units::locktime::relative::{
- Height, InvalidHeightError, InvalidTimeError, NumberOf512Seconds, NumberOfBlocks, Time,
- TimeOverflowError,
+ InvalidHeightError, InvalidTimeError, NumberOf512Seconds, NumberOfBlocks, TimeOverflowError,
};
}
diff --git a/units/tests/serde.rs b/units/tests/serde.rs
index e5ce48b4..e2169df5 100644
--- a/units/tests/serde.rs
+++ b/units/tests/serde.rs
@@ -7,7 +7,7 @@
use bincode::serialize;
use bitcoin_units::{
- amount, fee_rate, Amount, BlockHeight, BlockInterval, FeeRate, SignedAmount, Weight,
+ amount, fee_rate, Amount, BlockHeight, BlockHeightInterval, FeeRate, SignedAmount, Weight,
};
use serde::{Deserialize, Serialize};
@@ -46,7 +46,7 @@ struct Serde {
opt_kwu: Option<FeeRate>,
a: BlockHeight,
- b: BlockInterval,
+ b: BlockHeightInterval,
c: Weight,
}
@@ -75,7 +75,7 @@ impl Serde {
opt_kwu: Some(FeeRate::BROADCAST_MIN),
a: BlockHeight::MAX,
- b: BlockInterval::MAX,
+ b: BlockHeightInterval::MAX,
c: Weight::MAX,
}
}
diff --git a/units/tests/str.rs b/units/tests/str.rs
index 713fc15c..b0774d0c 100644
--- a/units/tests/str.rs
+++ b/units/tests/str.rs
@@ -4,7 +4,7 @@
use bitcoin_units::amount::Denomination;
use bitcoin_units::locktime::{absolute, relative};
-use bitcoin_units::{Amount, BlockHeight, BlockInterval, SignedAmount, Weight};
+use bitcoin_units::{Amount, BlockHeight, BlockHeightInterval, SignedAmount, Weight};
macro_rules! check {
($($test_name:ident, $ty:path, $val:path, $str:literal);* $(;)?) => {
@@ -34,8 +34,8 @@ check! {
block_height_min, BlockHeight, BlockHeight::MIN, "0";
block_height_max, BlockHeight, BlockHeight::MAX, "4294967295";
- block_interval_min, BlockInterval, BlockInterval::MIN, "0";
- block_interval_max, BlockInterval, BlockInterval::MAX, "4294967295";
+ block_interval_min, BlockHeightInterval, BlockHeightInterval::MIN, "0";
+ block_interval_max, BlockHeightInterval, BlockHeightInterval::MAX, "4294967295";
lock_by_height_absolute_min, absolute::Height, absolute::Height::MIN, "0";
lock_by_height_absolute_max, absolute::Height, absolute::Height::MAX, "499999999";
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.