-
Notifications
You must be signed in to change notification settings - Fork 49
Enhance STM library readability - Golden tests #2642
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
base: main
Are you sure you want to change the base?
Conversation
Test Results 4 files ± 0 164 suites ±0 24m 9s ⏱️ +8s Results for commit 5dddb47. ± Comparison against base commit d7ce977. This pull request removes 1 and adds 10 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Co-authored-by: Jean-Philippe Raynaud <[email protected]>
dbd1bfd
to
377d0d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the Mithril STM library by adding golden tests across multiple modules to improve readability and maintainability. Golden tests are a form of regression testing that validate serialization/deserialization behavior by comparing against expected JSON outputs.
Key changes include:
- Implementation of golden tests for cryptographic components and data structures
- Addition of
PartialEq
implementation for theInitializer
struct - Extension of test dependencies to include
serde_json
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
mithril-stm/src/single_signature/signature_registered_party.rs | Adds golden tests for SingleSignatureWithRegisteredParty serialization |
mithril-stm/src/single_signature/signature.rs | Adds golden tests for SingleSignature serialization |
mithril-stm/src/participant/initializer.rs | Implements PartialEq and adds golden tests for Initializer |
mithril-stm/src/parameters.rs | Adds golden tests for Parameters serialization |
mithril-stm/src/bls_multi_signature/verification_key.rs | Adds golden tests for BLS verification key serialization |
mithril-stm/src/bls_multi_signature/signing_key.rs | Adds golden tests for BLS signing key serialization |
mithril-stm/src/bls_multi_signature/signature.rs | Adds golden tests for BLS signature serialization |
mithril-stm/src/bls_multi_signature/proof_of_possession.rs | Adds golden tests for BLS proof of possession serialization |
mithril-stm/Cargo.toml | Adds serde_json as test dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Content
This PR includes "golden" (de)serialization tests for several core types in the
mithril-stm
crate, ensuring that their JSON representations remain stable and correct:Note
This is a preliminary work that will help avoid introducing breaking changes in the protocol when the fields of the structures are renamed.
Pre-submit checklist
Issue(s)
Relates to #2568