Skip to content

Commit f1c33ee

Browse files
committed
tests: implement BIP341 test vectors
1 parent ac3037d commit f1c33ee

6 files changed

+577
-1
lines changed

src/Makefile.test.include

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ FUZZ_BINARY=test/fuzz/fuzz$(EXEEXT)
1616

1717
JSON_TEST_FILES = \
1818
test/data/script_tests.json \
19+
test/data/bip341_wallet_vectors.json \
1920
test/data/base58_encode_decode.json \
2021
test/data/blockfilters.json \
2122
test/data/key_io_valid.json \

src/script/interpreter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ template void PrecomputedTransactionData::Init(const CMutableTransaction& txTo,
14831483
template PrecomputedTransactionData::PrecomputedTransactionData(const CTransaction& txTo);
14841484
template PrecomputedTransactionData::PrecomputedTransactionData(const CMutableTransaction& txTo);
14851485

1486-
static const CHashWriter HASHER_TAPSIGHASH = TaggedHash("TapSighash");
1486+
const CHashWriter HASHER_TAPSIGHASH = TaggedHash("TapSighash");
14871487
const CHashWriter HASHER_TAPLEAF = TaggedHash("TapLeaf");
14881488
const CHashWriter HASHER_TAPBRANCH = TaggedHash("TapBranch");
14891489

src/script/interpreter.h

+1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ static constexpr size_t TAPROOT_CONTROL_NODE_SIZE = 32;
229229
static constexpr size_t TAPROOT_CONTROL_MAX_NODE_COUNT = 128;
230230
static constexpr size_t TAPROOT_CONTROL_MAX_SIZE = TAPROOT_CONTROL_BASE_SIZE + TAPROOT_CONTROL_NODE_SIZE * TAPROOT_CONTROL_MAX_NODE_COUNT;
231231

232+
extern const CHashWriter HASHER_TAPSIGHASH; //!< Hasher with tag "TapSighash" pre-fed to it.
232233
extern const CHashWriter HASHER_TAPLEAF; //!< Hasher with tag "TapLeaf" pre-fed to it.
233234
extern const CHashWriter HASHER_TAPBRANCH; //!< Hasher with tag "TapBranch" pre-fed to it.
234235

0 commit comments

Comments
 (0)