Skip to content

Commit 17ce61c

Browse files
committed
Merge rust-bitcoin#3664: Release tracking PR: bitcoin 0.32.5
b334224 bitcoin: Bump version to 0.32.5 (Tobin C. Harding) ca3ebd7 bitcoin: Stop using impl_parse_str_from_int (Tobin C. Harding) 170b997 Remove nonsense feature gating (Tobin C. Harding) Pull request description: In preparation for release add a changelog entry, bump the version, and update the lock files - BOOM! ACKs for top commit: apoelstra: ACK b334224; tested last two commits; the first fails in the expected way (bad `alloc` cfg flag) and not in any unexpected ways. sanket1729: utACK b334224 Tree-SHA512: 76fa40ff9d0656af3f1bed37eaf33a9ace8205304ef94bddce1fcaeef8adacf68444a671121df40bb453e77da5dd978bc2c929285787deb55aa2501fbcbd5e2b
2 parents 1f84707 + b334224 commit 17ce61c

File tree

7 files changed

+81
-13
lines changed

7 files changed

+81
-13
lines changed

Cargo-minimal.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dependencies = [
4747

4848
[[package]]
4949
name = "bitcoin"
50-
version = "0.32.4"
50+
version = "0.32.5"
5151
dependencies = [
5252
"base58ck",
5353
"base64",

Cargo-recent.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies = [
4646

4747
[[package]]
4848
name = "bitcoin"
49-
version = "0.32.4"
49+
version = "0.32.5"
5050
dependencies = [
5151
"base58ck",
5252
"base64",

bitcoin/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 0.32.5 - 2024-11-27
2+
3+
- Backport - Re-export `bech32` crate [#3662](https://github.com/rust-bitcoin/rust-bitcoin/pull/3662)
4+
- Backport - Add API for extracting the inner payload of `RawNetworkMessage` [#3523](https://github.com/rust-bitcoin/rust-bitcoin/pull/3523)
5+
- Backport - Fix bug in witness stack getters [#3626](https://github.com/rust-bitcoin/rust-bitcoin/pull/3626)
6+
- Backport - address: Add `Address::into_unchecked` [#3655](https://github.com/rust-bitcoin/rust-bitcoin/pull/3655)
7+
18
# 0.32.4 - 2024-10-24
29

310
- Bound decode methods on `Read`, rather than `BufRead` [#3173](https://github.com/rust-bitcoin/rust-bitcoin/pull/3173)

bitcoin/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bitcoin"
3-
version = "0.32.4"
3+
version = "0.32.5"
44
authors = ["Andrew Poelstra <[email protected]>"]
55
license = "CC0-1.0"
66
repository = "https://github.com/rust-bitcoin/rust-bitcoin/"

bitcoin/src/blockdata/locktime/absolute.rs

+34-2
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@
88
99
use core::cmp::Ordering;
1010
use core::fmt;
11+
use core::str::FromStr;
1112

1213
use io::{Read, Write};
1314
#[cfg(all(test, mutate))]
1415
use mutagen::mutate;
15-
use units::parse;
16+
use units::parse::{self, ParseIntError};
1617

1718
#[cfg(doc)]
1819
use crate::absolute;
1920
use crate::consensus::encode::{self, Decodable, Encodable};
2021
use crate::error::{ContainsPrefixError, MissingPrefixError, PrefixedHexError, UnprefixedHexError};
22+
use crate::prelude::{Box, String};
2123

2224
#[rustfmt::skip] // Keep public re-exports separate.
2325
#[doc(inline)]
@@ -284,7 +286,37 @@ impl LockTime {
284286
}
285287
}
286288

287-
units::impl_parse_str_from_int_infallible!(LockTime, u32, from_consensus);
289+
impl FromStr for LockTime {
290+
type Err = ParseIntError;
291+
292+
fn from_str(s: &str) -> Result<Self, Self::Err> {
293+
parse::int::<u32, &str>(s).map(LockTime::from_consensus)
294+
}
295+
}
296+
297+
impl TryFrom<&str> for LockTime {
298+
type Error = ParseIntError;
299+
300+
fn try_from(s: &str) -> Result<Self, Self::Error> {
301+
LockTime::from_str(s)
302+
}
303+
}
304+
305+
impl TryFrom<String> for LockTime {
306+
type Error = ParseIntError;
307+
308+
fn try_from(s: String) -> Result<Self, Self::Error> {
309+
LockTime::from_str(&s)
310+
}
311+
}
312+
313+
impl TryFrom<Box<str>> for LockTime {
314+
type Error = ParseIntError;
315+
316+
fn try_from(s: Box<str>) -> Result<Self, Self::Error> {
317+
LockTime::from_str(&s)
318+
}
319+
}
288320

289321
impl From<Height> for LockTime {
290322
#[inline]

bitcoin/src/blockdata/transaction.rs

+34-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
//! This module provides the structures and functions needed to support transactions.
1212
//!
1313
14-
use core::{cmp, fmt, str};
14+
use core::{cmp, fmt};
15+
use core::str::FromStr;
1516

1617
use hashes::{sha256d, Hash};
1718
use internals::write_err;
1819
use io::{Read, Write};
19-
use units::parse;
20+
use units::parse::{self, ParseIntError};
2021

2122
use super::Weight;
2223
use crate::blockdata::locktime::absolute::{self, Height, Time};
@@ -527,7 +528,37 @@ impl fmt::Debug for Sequence {
527528
}
528529
}
529530

530-
units::impl_parse_str_from_int_infallible!(Sequence, u32, from_consensus);
531+
impl FromStr for Sequence {
532+
type Err = ParseIntError;
533+
534+
fn from_str(s: &str) -> Result<Self, Self::Err> {
535+
parse::int::<u32, &str>(s).map(Sequence::from_consensus)
536+
}
537+
}
538+
539+
impl TryFrom<&str> for Sequence {
540+
type Error = ParseIntError;
541+
542+
fn try_from(s: &str) -> Result<Self, Self::Error> {
543+
Sequence::from_str(s)
544+
}
545+
}
546+
547+
impl TryFrom<String> for Sequence {
548+
type Error = ParseIntError;
549+
550+
fn try_from(s: String) -> Result<Self, Self::Error> {
551+
Sequence::from_str(&s)
552+
}
553+
}
554+
555+
impl TryFrom<Box<str>> for Sequence {
556+
type Error = ParseIntError;
557+
558+
fn try_from(s: Box<str>) -> Result<Self, Self::Error> {
559+
Sequence::from_str(&s)
560+
}
561+
}
531562

532563
/// Bitcoin transaction output.
533564
///

units/src/parse.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,9 @@ macro_rules! impl_tryfrom_str_from_int_infallible {
149149
#[macro_export]
150150
macro_rules! impl_parse_str_from_int_infallible {
151151
($to:ident, $inner:ident, $fn:ident) => {
152-
#[cfg(all(feature = "alloc", not(feature = "std")))]
153-
$crate::impl_tryfrom_str_from_int_infallible!(&str, $to, $inner, $fn; alloc::string::String, $to, $inner, $fn; alloc::boxed::Box<str>, $to, $inner, $fn);
154-
#[cfg(feature = "std")]
155-
$crate::impl_tryfrom_str_from_int_infallible!(&str, $to, $inner, $fn; std::string::String, $to, $inner, $fn; std::boxed::Box<str>, $to, $inner, $fn);
152+
$crate::impl_tryfrom_str_from_int_infallible!(&str, $to, $inner, $fn);
153+
#[cfg(feature = "alloc")]
154+
$crate::impl_tryfrom_str_from_int_infallible!(alloc::string::String, $to, $inner, $fn; alloc::boxed::Box<str>, $to, $inner, $fn);
156155

157156
impl core::str::FromStr for $to {
158157
type Err = $crate::parse::ParseIntError;
@@ -161,7 +160,6 @@ macro_rules! impl_parse_str_from_int_infallible {
161160
$crate::parse::int::<$inner, &str>(s).map($to::$fn)
162161
}
163162
}
164-
165163
}
166164
}
167165

0 commit comments

Comments
 (0)