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 Sep 11, 2023
1 parent 3c9956f commit a54cdf3
Show file tree
Hide file tree
Showing 4 changed files with 1,911 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
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 @@ -183,6 +184,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
Loading

0 comments on commit a54cdf3

Please sign in to comment.