Add comprehensive BIP-93 test suite#1
Open
kiwihodl wants to merge 3 commits into
Open
Conversation
Tests for codex32 share parsing and validation: - test_share_recovery.py: 2-of-n and 3-of-n recovery with BIP-93 vectors - test_validation.py: Input validation (checksum, length, empty, sanitization) - test_invalid_vectors.py: BIP-93 invalid test vectors rejection Also updates README with: - How to run tests (macOS/Linux/Windows) - Expected test output - Cross-platform setup instructions - Test file descriptions in codebase overview All tests use plain asserts with no external dependencies.
f0b3011 to
39fb0ac
Compare
- test_validation.py: Add 4 new edge case tests - test_invalid_bech32_characters_rejected - test_mixed_case_rejected - test_none_input_returns_empty_error - test_wrong_hrp_rejected - test_share_recovery.py: Add 5 new edge case tests - test_duplicate_share_rejected - test_empty_share_list_rejected - test_insufficient_shares_rejected - test_mismatched_identifiers_rejected - test_extra_shares_still_works (skip placeholder) - Add .gitignore for Python artifacts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused codex32_to_seed_bytes import from test_validation.py - Move Codex32InputError import to module level in test_share_recovery.py - Replace skip placeholder with real test_exact_threshold_shares_works - Add comments explaining corruption test positions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test files
test_share_recovery.py- Tests Lagrange interpolation recovers correct S-share and seedtest_validation.py- Tests edge cases and error handlingtest_invalid_vectors.py- Tests that malformed/invalid codex32 strings are rejectedHow to run
All tests pass against current master.