Skip to content

Commit 204ed3f

Browse files
committed
TEMPORARY: Revert this patch after bitcoin-io v0.1.4 merges
We want CI to pass on the io-0.1.x branch but `bitcoin` is currently borked and its breaking the build. Since we are only doing the `io` release add a patch that fixes the build, after we build and tag the patch before this one we can then revert this one. Ugly as sin I know.
1 parent 2f68a1c commit 204ed3f

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

bitcoin/src/blockdata/locktime/absolute.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,19 @@ impl LockTime {
284284
}
285285
}
286286

287-
units::impl_parse_str_from_int_infallible!(LockTime, u32, from_consensus);
287+
// REVERT THIS CHANGE SOON AS `bitcoin-io v0.1.4` IS RELEASED.
288+
//
289+
// This macro call is borked because `btcoin` does not have the `alloc` feature and the macro
290+
// contains feature gating `<insert usual rand about calling macros across crate boundries>`.
291+
//
292+
// units::impl_parse_str_from_int_infallible!(LockTime, u32, from_consensus);
293+
impl core::str::FromStr for LockTime {
294+
type Err = crate::error::ParseIntError;
295+
296+
fn from_str(s: &str) -> Result<Self, Self::Err> {
297+
units::parse::int::<u32, &str>(s).map(LockTime::from_consensus)
298+
}
299+
}
288300

289301
impl From<Height> for LockTime {
290302
#[inline]

bitcoin/src/blockdata/transaction.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,19 @@ impl fmt::Debug for Sequence {
526526
}
527527
}
528528

529-
units::impl_parse_str_from_int_infallible!(Sequence, u32, from_consensus);
529+
// REVERT THIS CHANGE SOON AS `bitcoin-io v0.1.4` IS RELEASED.
530+
//
531+
// This macro call is borked because `btcoin` does not have the `alloc` feature and the macro
532+
// contains feature gating `<insert usual rand about calling macros across crate boundries>`.
533+
//
534+
// units::impl_parse_str_from_int_infallible!(Sequence, u32, from_consensus);
535+
impl core::str::FromStr for Sequence {
536+
type Err = crate::error::ParseIntError;
537+
538+
fn from_str(s: &str) -> Result<Self, Self::Err> {
539+
units::parse::int::<u32, &str>(s).map(Sequence::from_consensus)
540+
}
541+
}
530542

531543
/// Bitcoin transaction output.
532544
///

0 commit comments

Comments
 (0)