Skip to content

Commit

Permalink
Add BIP352 test vectors as unit tests
Browse files Browse the repository at this point in the history
Use the test vectors to test sending and receiving. A few cases are not
covered here, namely anything that requires testing specific to the
wallet. For example:

* Taproot script path spending is not tested, as that is better tested in
  a wallets coin selection / signing logic
* Re-computing outputs during RBF is not tested, as that is better
  tested in a wallets RBF logic

The unit tests are written in such a way that adding new test cases is
as easy as updating the JSON file.
  • Loading branch information
josibake committed Jul 21, 2023
1 parent a5c2d48 commit db0ab56
Show file tree
Hide file tree
Showing 4 changed files with 1,917 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Makefile.test.include
Expand Up @@ -17,6 +17,7 @@ FUZZ_BINARY=test/fuzz/fuzz$(EXEEXT)
JSON_TEST_FILES = \
test/data/script_tests.json \
test/data/bip341_wallet_vectors.json \
test/data/bip352_send_and_receive_vectors.json \
test/data/base58_encode_decode.json \
test/data/blockfilters.json \
test/data/key_io_valid.json \
Expand Down Expand Up @@ -182,6 +183,7 @@ BITCOIN_TESTS += \
wallet/test/ismine_tests.cpp \
wallet/test/rpc_util_tests.cpp \
wallet/test/scriptpubkeyman_tests.cpp \
wallet/test/silentpayment_tests.cpp \
wallet/test/walletload_tests.cpp \
wallet/test/group_outputs_tests.cpp

Expand Down

0 comments on commit db0ab56

Please sign in to comment.