Skip to content

Conversation

@refcell
Copy link
Owner

@refcell refcell commented Feb 2, 2026

Summary

  • Adds 15 comprehensive unit tests for DkgOutput type in the kora-dkg crate
  • Tests cover save/load roundtrip, file existence checks, and error handling
  • Tests verify JSON validation, hex encoding/decoding, and edge cases (missing files, invalid JSON, invalid hex, empty participant keys)
  • Adds tempfile dev-dependency for temporary directory testing

Test Coverage

Test Description
test_dkg_output_save_and_load_roundtrip Verifies save/load preserves all fields
test_dkg_output_exists_* Tests exists() with various file states
test_dkg_output_load_* Tests error handling for invalid inputs
test_dkg_output_clone/debug Verifies derive macros
test_serde_json_error_conversion Tests From<serde_json::Error> impl
test_dkg_output_save_creates_pretty_json Verifies pretty-print format

- Add 15 tests covering save/load roundtrip, exists checks, error cases
- Tests verify file persistence, JSON validation, hex encoding/decoding
- Tests edge cases: missing files, invalid JSON, invalid hex, empty keys
- Add tempfile dev-dependency for temporary directory testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants