-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bip: test vector creation #302
Comments
Adding some thoughts on this before starting work. FormatShould we use inline test vectors as text (JSON) in the mediawiki documents or link to one or more JSON files in the repo? Proposed general JSON format (taking the MuSig2/BIP-0327 vectors as a template/inspiration):
ContentWhere we don't already have unit tests where we can add code to export the test vectors as JSON files, we should make sure we cover at least the following states:
Back-porting test vectors to unit testsOnce we have generated JSON test vectors from existing unit tests (or manually where not possible), it would make sense to then start using the test vectors for the unit tests as well, potentially replacing the original tests with the file/vector based ones. Suggested task divisionSuggesting to split the tasks in the initial issue body in the following way: |
Thanks for sharing you plan Oli, it all sounds reasonable to me. I think that file based JSON makes more sense than inline. I'll try to find example test code for handling these JSON specifications. |
Actual files IMO. I also like that format from the musig2 BIP, I helped to generate some of those initial vectors using the contents of this commit: btcsuite/btcd@1da361b. So you add a flag, that optionally writes out to json. |
Fixed by #326 |
One final thing we want to do before we request the final BIP number sis request test vectors for all the relevant sub-BIPs.
I think one way we can automate a lot of this is leverage our existing TDD tests: they're all already induvidual test vectors, so we can add a new
-json
flag to output them in a formatted JSON output (written to a file).This is a master tracking issue to keep track of all the test vectors we'd want to add:
Test Vector Checklist
asset TLV encoding
addr encoding
proof file encoding
VPSBT encoding
positive + negative tests for VM validation
positive + negative tests for proof validation
MS-SMT tree tests
The text was updated successfully, but these errors were encountered: