From 2a0ccffbe43d947f5d49e0d441c7e4fff149883b Mon Sep 17 00:00:00 2001 From: Satoshi Qazi Muhammed Date: Sun, 12 Jul 2026 13:45:55 -0700 Subject: [PATCH] fix: correct transcription error in BitcoinTransactionTest's BIP143 fixture Input 0's sequence was set to 0xeeffffffL, but BIP143's doc shows "eeffffff" as the on-wire (little-endian) bytes, not the integer value - the correct value whose LE encoding is eeffffff is 0xffffffee, not 0xeeffffff. Caught by CI: 83/84 common module tests passed, only bip143Sighash failed. Isolated by building a standalone Kotlin+JDK repro outside Gradle/Android (no JDK available in this environment) - every other intermediate value (hashPrevouts, outpoint, scriptCode, hashOutputs) matched BIP143 exactly; only hashSequence was wrong, narrowing it to this one transcription error rather than the implementation. --- .../nova/common/utils/BitcoinTransactionTest.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/src/test/java/io/novafoundation/nova/common/utils/BitcoinTransactionTest.kt b/common/src/test/java/io/novafoundation/nova/common/utils/BitcoinTransactionTest.kt index 6e2c4d27..2ff58486 100644 --- a/common/src/test/java/io/novafoundation/nova/common/utils/BitcoinTransactionTest.kt +++ b/common/src/test/java/io/novafoundation/nova/common/utils/BitcoinTransactionTest.kt @@ -22,7 +22,10 @@ class BitcoinTransactionTest { private val input0Txid = "9f96ade4b41d5433f4eda31e1738ec2b36f6e7d1420d94a6af99801a88f7f7ff".fromHex() private val input1Txid = "8ac60eb9575db5b2d987e29f301b5b819ea83a5c6579d282d189cc04b8e151ef".fromHex() - private val input0 = BitcoinInput(txid = input0Txid, vout = 0, valueSat = 625_000_000L, sequence = 0xeeffffffL) + // sequence is the *value* that gets LE-encoded, NOT the wire bytes - the doc shows input 0's on-wire + // sequence bytes as "eeffffff", which as a little-endian integer is 0xffffffee, not 0xeeffffff (a + // transcription of this exact off-by-reversal was caught by a failing CI run before this fix). + private val input0 = BitcoinInput(txid = input0Txid, vout = 0, valueSat = 625_000_000L, sequence = 0xffffffeeL) private val input1 = BitcoinInput(txid = input1Txid, vout = 1, valueSat = 600_000_000L, sequence = 0xffffffffL) private val output0 = BitcoinOutput(