Skip to content

Commit e8f1100

Browse files
committed
units: Stop using deprecated types
Use the new non-deprecated types instead. Including removing the deprecated types from the API tests.
1 parent 4abc454 commit e8f1100

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

units/tests/api.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ fn api_can_use_modules_from_crate_root() {
158158
#[test]
159159
fn api_can_use_types_from_crate_root() {
160160
use bitcoin_units::{
161-
Amount, BlockHeight, BlockHeightInterval, BlockInterval, BlockMtp, BlockMtpInterval,
161+
Amount, BlockHeight, BlockHeightInterval, BlockMtp, BlockMtpInterval,
162162
BlockTime, FeeRate, NumOpResult, SignedAmount, Weight,
163163
};
164164
}
@@ -210,8 +210,7 @@ fn api_can_use_all_types_from_module_locktime_relative() {
210210
InvalidHeightError as _, InvalidTimeError as _, TimeOverflowError as _,
211211
};
212212
use bitcoin_units::locktime::relative::{
213-
Height, InvalidHeightError, InvalidTimeError, NumberOf512Seconds, NumberOfBlocks, Time,
214-
TimeOverflowError,
213+
InvalidHeightError, InvalidTimeError, NumberOf512Seconds, NumberOfBlocks, TimeOverflowError,
215214
};
216215
}
217216

units/tests/serde.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
use bincode::serialize;
99
use bitcoin_units::{
10-
amount, fee_rate, Amount, BlockHeight, BlockInterval, FeeRate, SignedAmount, Weight,
10+
amount, fee_rate, Amount, BlockHeight, BlockHeightInterval, FeeRate, SignedAmount, Weight,
1111
};
1212
use serde::{Deserialize, Serialize};
1313

@@ -46,7 +46,7 @@ struct Serde {
4646
opt_kwu: Option<FeeRate>,
4747

4848
a: BlockHeight,
49-
b: BlockInterval,
49+
b: BlockHeightInterval,
5050
c: Weight,
5151
}
5252

@@ -75,7 +75,7 @@ impl Serde {
7575
opt_kwu: Some(FeeRate::BROADCAST_MIN),
7676

7777
a: BlockHeight::MAX,
78-
b: BlockInterval::MAX,
78+
b: BlockHeightInterval::MAX,
7979
c: Weight::MAX,
8080
}
8181
}

units/tests/str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use bitcoin_units::amount::Denomination;
66
use bitcoin_units::locktime::{absolute, relative};
7-
use bitcoin_units::{Amount, BlockHeight, BlockInterval, SignedAmount, Weight};
7+
use bitcoin_units::{Amount, BlockHeight, BlockHeightInterval, SignedAmount, Weight};
88

99
macro_rules! check {
1010
($($test_name:ident, $ty:path, $val:path, $str:literal);* $(;)?) => {
@@ -34,8 +34,8 @@ check! {
3434
block_height_min, BlockHeight, BlockHeight::MIN, "0";
3535
block_height_max, BlockHeight, BlockHeight::MAX, "4294967295";
3636

37-
block_interval_min, BlockInterval, BlockInterval::MIN, "0";
38-
block_interval_max, BlockInterval, BlockInterval::MAX, "4294967295";
37+
block_interval_min, BlockHeightInterval, BlockHeightInterval::MIN, "0";
38+
block_interval_max, BlockHeightInterval, BlockHeightInterval::MAX, "4294967295";
3939

4040
lock_by_height_absolute_min, absolute::Height, absolute::Height::MIN, "0";
4141
lock_by_height_absolute_max, absolute::Height, absolute::Height::MAX, "499999999";

0 commit comments

Comments
 (0)