What changed, and why it matters
This commit adds missing public re-exports of types in the main 'bitcoin' crate so that downstream users can access types that are defined in the internal 'primitives' and 'units' crates. It is a build/API consistency fix with no apparent security relevance.
No security action required. Treat as a normal API/export fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates bitcoin/src/lib.rs and bitcoin/src/pow.rs to re-export additional types (e.g., AmountEncoder, AmountDecoder, AmountDecoderError, BadPositionError, CompactTargetEncoder, CompactTargetDecoder, CompactTargetDecoderError, ParseTargetError, ParseWorkError) from primitives and units into the bitcoin crate. The commit message frames this as satisfying a ‘bitcoin -> primitives -> units superset’ re-export requirement and fixing limitations in the re-export check scripts.
Changed components
bitcoin/src/lib.rsbitcoin/src/pow.rsInspect captured patch +12 / −10
diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs
index 8919d396..811e4f32 100644
--- a/bitcoin/src/lib.rs
+++ b/bitcoin/src/lib.rs
@@ -239,20 +239,20 @@ pub mod amount {
#[cfg(feature = "serde")]
pub use units::amount::serde;
#[doc(inline)]
- pub use units::amount::{Amount, SignedAmount};
+ pub use units::amount::{Amount, AmountDecoder, AmountEncoder, SignedAmount};
#[doc(no_inline)]
pub use units::amount::{
- Denomination, Display, OutOfRangeError, ParseAmountError, ParseDenominationError,
- ParseError,
+ AmountDecoderError, Denomination, Display, OutOfRangeError, ParseAmountError,
+ ParseDenominationError, ParseError,
};
/// Error types for bitcoin amounts.
pub mod error {
pub use units::amount::error::{
- InputTooLargeError, InvalidCharacterError, MissingDenominationError,
- MissingDigitsError, OutOfRangeError, ParseAmountError, ParseDenominationError,
- ParseError, PossiblyConfusingDenominationError, TooPreciseError,
- UnknownDenominationError,
+ AmountDecoderError, BadPositionError, InputTooLargeError, InvalidCharacterError,
+ MissingDenominationError, MissingDigitsError, OutOfRangeError, ParseAmountError,
+ ParseDenominationError, ParseError, PossiblyConfusingDenominationError,
+ TooPreciseError, UnknownDenominationError,
};
}
diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs
index fbfd5e35..abbd1b32 100644
--- a/bitcoin/src/pow.rs
+++ b/bitcoin/src/pow.rs
@@ -18,9 +18,11 @@ use crate::network::Params;
#[rustfmt::skip] // Keep public re-exports separate.
#[doc(inline)]
-pub use primitives::{CompactTarget, Target, Work};
-#[doc(inline)]
-pub use units::pow::error;
+pub use primitives::pow::{error, CompactTarget, CompactTargetEncoder, CompactTargetDecoder, Target, Work};
+#[doc(no_inline)]
+pub use self::error::CompactTargetDecoderError;
+#[doc(no_inline)]
+pub use primitives::pow::{ParseTargetError, ParseWorkError};
/// Extension functionality for the [`Work`] type.
// This can't be defined with the extension trait macro because it ignores the feature gate.
Why this scored 19/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.