Add unit tests for Taproot code in src/script/interpreter.cpp #23279

issue practicalswift opened this issue on October 14, 2021
  1. practicalswift commented at 12:48 PM on October 14, 2021: contributor

    The Taproot code in src/script/interpreter.cpp is covered by our functional tests (test/functional/feature_taproot.py and test/functional/wallet_taproot.py), but we don't have any unit test coverage for this code.

    Unit test coverage for src/script/interpreter.cpp can be found here:

    These functions in src/script/interpreter.cpp are currently not covered by our unit tests:

    • EvalChecksigTapscript
    • HandleMissingData
    • SignatureHashSchnorr
    • GenericTransactionSignatureChecker<T>::VerifySchnorrSignature
    • GenericTransactionSignatureChecker<T>::CheckSchnorrSignature
    • ComputeTaprootMerkleRoot
    • SigVersion::TAPSCRIPT code paths in ExecuteWitnessScript
    • Taproot code paths in VerifyWitnessProgram

    It would be nice to have C++ unit tests covering this code in addition to the Python functional tests.

  2. fanquake added the label Tests on Oct 14, 2021
  3. maflcko commented at 12:53 PM on October 14, 2021: member
  4. david-bakin commented at 3:47 PM on April 11, 2022: contributor

    I'm working on this ... updates shortly.

  5. sipa commented at 3:51 PM on April 11, 2022: member
  6. david-bakin commented at 2:05 AM on May 3, 2022: contributor

    ... still working on this ... PR shortly ...

  7. david-bakin referenced this in commit 5807b4c1b3 on May 4, 2022
  8. david-bakin referenced this in commit d34cbcef50 on May 9, 2022
  9. david-bakin referenced this in commit d692ae7b31 on May 21, 2022
  10. david-bakin referenced this in commit fedc037dba on May 24, 2022
  11. david-bakin referenced this in commit 5d6148b4e4 on Jun 5, 2022
  12. david-bakin referenced this in commit 376afb4b60 on Jun 5, 2022
  13. david-bakin referenced this in commit 047a9f0774 on Jun 5, 2022
  14. david-bakin referenced this in commit eeefec3435 on Jun 5, 2022
  15. billymcbip commented at 5:15 PM on November 27, 2025: contributor

    EvalChecksigTapscript

    I've added a unit test for the empty pubkey error in Tapscript signature validation: #33961.

  16. kannapoix referenced this in commit 810228b76a on Feb 2, 2026
  17. kannapoix referenced this in commit b7371682a4 on Feb 17, 2026
  18. pinheadmz commented at 2:19 PM on May 5, 2026: member

    Was this closed by #23394 ? Note that PR was merged despite github's "closed" label: https://github.com/bitcoin/bitcoin/commit/5ccab7187b35142e03c15dd55390e45b3d233c52

    I also note that the specific functions named in the issue are covered according to the (new!) CoreCheck master branch coverage report: https://bitcoin-coverage-data-default.s3.eu-west-3.amazonaws.com/master/d7ed2840acc0f065620fdd3d45480169f06a266c/coverage-report/coverage/tmp/bitcoin/src/script/interpreter.cpp.html

  19. maflcko commented at 2:34 PM on May 5, 2026: member

    CoreCheck runs the functional tests as well, so you'd have to use https://maflcko.github.io/b-c-cov/test_bitcoin.coverage/src/script/interpreter.cpp.gcov.html

    Though I guess https://github.com/bitcoin-core/qa-assets/commits/main/unit_test_data/script_assets_test.json covers most of this, though, not all of it?

    Maybe this can be closed for now?

  20. maflcko closed this on May 5, 2026


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-05-19 06:53 UTC