What changed, and why it matters
This commit only fixes a typo in documentation comments. The word 'Encodes' was changed to 'Decodes' in two Rust source files to accurately describe what the function does. No code behavior was changed.
No action required. This is a documentation-only correction with no security or functional implications.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies doc comments for a function that converts a PUSHNUM opcode to its numeric value (1-16). The previous comment incorrectly said ‘Encodes’ when the operation is actually a decode/extraction of the numeric value from the opcode. The function implementation is unchanged. Both the bitcoin crate and primitives crate copies of the opcode module were updated identically.
Changed components
bitcoin/src/blockdata/opcodes.rsprimitives/src/opcodes.rsInspect captured patch +2 / −2
diff --git a/bitcoin/src/blockdata/opcodes.rs b/bitcoin/src/blockdata/opcodes.rs
index e00e4098..57715765 100644
--- a/bitcoin/src/blockdata/opcodes.rs
+++ b/bitcoin/src/blockdata/opcodes.rs
@@ -415,7 +415,7 @@ impl Opcode {
#[inline]
pub const fn to_u8(self) -> u8 { self.code }
- /// Encodes PUSHNUM [`Opcode`] as a `u8` representing its number (1-16).
+ /// Decodes PUSHNUM [`Opcode`] as a `u8` representing its number (1-16).
///
/// Does not convert `OP_FALSE` to 0. Only `1` to `OP_PUSHNUM_16` are covered.
///
diff --git a/primitives/src/opcodes.rs b/primitives/src/opcodes.rs
index 80d595cc..09a97f17 100644
--- a/primitives/src/opcodes.rs
+++ b/primitives/src/opcodes.rs
@@ -417,7 +417,7 @@ impl Opcode {
#[inline]
pub const fn to_u8(self) -> u8 { self.code }
- /// Encodes PUSHNUM [`Opcode`] as a `u8` representing its number (1-16).
+ /// Decodes PUSHNUM [`Opcode`] as a `u8` representing its number (1-16).
///
/// Does not convert `OP_FALSE` to 0. Only `1` to `OP_PUSHNUM_16` are covered.
///
Why this scored 15/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.