Add unit tests for Taproot interpreter code

Add granular unittests for Taproot script interpreter code.
Not Available
$3,000.00
Check Out Task
Task Bounty Details

23279

Bitcoin Issue

Days

Estimated Effort

Not Available

Current Status

$3,000.00

Paid in USD or equivalent BTC upon acceptance

Bitcoin Issue

The Taproot upgrade adds significant complexity to Bitcoin's script interpreter. Some of the changes for Taproot are covered by functional tests, but are not covered by granular unittests.

This bounty involves adding unittest coverage for this important code.

From the original issue:

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:

- https://marcofalke.github.io/btc_cov/test_bitcoin.coverage/src/script/interpreter.cpp.gcov.html

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.

Prerequisite Skills

C++, Bitcoin Script

Code Guidelines

Repository Code Guidelines Page

Definition of Done

Get a PR merged that adds whole or partial coverage of src/script/interpreter.cpp for Taproot

Check Out Task