test: add Taproot support to script_builder #34473

pull kannapoix wants to merge 1 commits into bitcoin:master from kannapoix:taproot-tests changing 2 files +100 −3
  1. kannapoix commented at 6:30 am on February 2, 2026: none

    Make the script_builder used in unit tests compatible with Taproot by adding a PushSchnorrSig helper. Add a few tests that cover boundary values for Taproot SIGHASH flags in SignatureHashSchnorr (including values at and above 84, which were not covered by existing unit tests). This slightly improves unit test coverage of SignatureHashSchnorr, as suggested in issue #23279. Current unit test coverage for src/script/interpreter.cpp can be seen here: https://maflcko.github.io/b-c-cov/test_bitcoin.coverage/src/script/interpreter.cpp.gcov.html

    We also have Taproot tests in bip341_keypath_test_vectors, but extending those tests would require preparing a test data. Making script_builder Taproot-compatible is a simpler way to add edge-case tests for SignatureHashSchnorr and to add more Taproot unit tests later.

  2. test: add Taproot support to script_builder
    Make the script_builder used in unit tests compatible with Taproot by
    adding a PushSchnorrSig helper. This is a simpler way to add edge-case
    tests than extending bip341_keypath_test_vectors, which would require
    preparing additional test data.
    
    Add tests for boundary values of Taproot SIGHASH flags in
    SignatureHashSchnorr, including cases where the SIGHASH value is
    greater than or equal to 84 that were not previously tested in unit tests.
    
    Addresses #23279.
    810228b76a
  3. DrahtBot added the label Tests on Feb 2, 2026
  4. DrahtBot commented at 6:31 am on February 2, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    LLM Linter (✨ experimental)

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • TestBuilder(CScript() « ToByteVector(keys.outputPubkey0.first), “Taproot key path spending”, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_TAPROOT, false, WitnessMode::TAPROOT, 1, 1) in src/test/script_tests.cpp
    • TestBuilder(CScript() « ToByteVector(keys.outputPubkey0.first), “Taproot key path spending with unknown sighash 0x04”, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_TAPROOT, false, WitnessMode::TAPROOT, 1, 1) in src/test/script_tests.cpp
    • TestBuilder(CScript() « ToByteVector(keys.outputPubkey0.first), “Taproot key path spending with unknown sighash 0x80”, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_TAPROOT, false, WitnessMode::TAPROOT, 1, 1) in src/test/script_tests.cpp
    • TestBuilder(CScript() « ToByteVector(keys.outputPubkey0.first), “Taproot key path spending with unknown sighash 0x84”, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_TAPROOT, false, WitnessMode::TAPROOT, 1, 1) in src/test/script_tests.cpp

    2026-02-02 06:31:33

  5. DrahtBot added the label Needs rebase on Feb 2, 2026
  6. DrahtBot commented at 7:17 am on February 2, 2026: contributor
    🐙 This pull request conflicts with the target branch and needs rebase.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-02-11 12:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me