Skip to content

Commit 72760bb

Browse files
committed
Merge rust-bitcoin#3606: Deprecate function
eacb1e7 Deprecate function (yancy) Pull request description: closes rust-bitcoin#3602 ACKs for top commit: tcharding: ACK eacb1e7 apoelstra: ACK eacb1e7; successfully ran local tests; lol Tree-SHA512: 9da7881ee62e1808d83c92e232cef42055cce6e3ba03dc1001472948380c16a1968da1d4ce4f7ad13d78d1d70e143851f2635ba167c4df34be61ecf3f2fdee4e
2 parents 431581a + eacb1e7 commit 72760bb

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

bitcoin/src/blockdata/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ crate::internal_macros::define_extension_trait! {
8686
/// Base weight excludes the witness and script.
8787
// We need to use this const here but do not want to make it public in `primitives::TxIn`.
8888
const TX_IN_BASE_WEIGHT: Weight =
89-
Weight::from_vb_unwrap(OutPoint::SIZE as u64 + Sequence::SIZE as u64);
89+
Weight::from_vb_unchecked(OutPoint::SIZE as u64 + Sequence::SIZE as u64);
9090

9191
crate::internal_macros::define_extension_trait! {
9292
/// Extension functionality for the [`TxIn`] type.

units/src/weight.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ impl Weight {
6868
/// # Panics
6969
///
7070
/// If the conversion from virtual bytes overflows.
71+
#[deprecated(since = "TBD", note = "use `from_vb_unchecked` instead")]
7172
pub const fn from_vb_unwrap(vb: u64) -> Weight {
7273
match vb.checked_mul(Self::WITNESS_SCALE_FACTOR) {
7374
Some(weight) => Weight(weight),
@@ -272,12 +273,6 @@ mod tests {
272273
assert_eq!(None, w);
273274
}
274275

275-
#[test]
276-
fn from_vb_const() {
277-
const WU: Weight = Weight::from_vb_unwrap(1);
278-
assert_eq!(Weight(4), WU);
279-
}
280-
281276
#[test]
282277
fn from_vb_unchecked() {
283278
let w = Weight::from_vb_unchecked(1);

0 commit comments

Comments
 (0)