Feature/shapshot checksum #2
Merged
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.
Add Snapshot Serialization, Checksum Validation, and Reconstruction for
PriceLevelDescription
This pull request introduces snapshot-based serialization, deserialization, and checksum validation mechanisms for the
PriceLeveldata structure. The implementation ensures data integrity during persistence and transmission by leveraging SHA-256 checksums. Additionally, new methods enable reconstruction ofPriceLevelinstances from snapshots, snapshot packages, and JSON representations. Comprehensive error handling and test coverage have been added to validate correctness across different scenarios.Changes Made
Snapshot & Package Handling
PriceLevelSnapshotPackagestruct to encapsulate snapshots with checksum validation.PriceLevelSnapshotPackagein module exports.Checksum Validation
sha2crate.Reconstruction
PriceLevelfrom:PriceLevelSnapshotPriceLevelSnapshotPackageError Handling
PriceLevelError:SerializationErrorDeserializationErrorChecksumMismatchfmt::Displayfor better error reporting.Testing
Versioning & Dependencies
0.3.2.sha2as a new dependency.Testing
PriceLevelSnapshotandPriceLevelSnapshotPackage.PriceLevelfrom snapshots and JSON formats.Additional Notes
References
Checklist
0.4.0.