-
Notifications
You must be signed in to change notification settings - Fork 0
Implement a way to support both mempack-1 and mempack-2 #123
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
Conversation
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 pull request implements support for both mempack-1 (version 0.1.x) and mempack-2 (version 0.2.x) by introducing a sublibrary within scls-format that provides a compatibility layer. The implementation uses a Cabal flag to switch between the two mempack versions.
Key changes:
- Introduced a new internal
mempacksublibrary in scls-format with version-specific compatibility shims - Moved and refactored
ByteOrdered,MemPackutilities, andIsKeyclasses into the new sublibrary structure - Updated import statements across the codebase to use the new module structure
- Adjusted dependency version constraints for the cuddle package
Reviewed Changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| scls-format/scls-format.cabal | Added use-mempack-1 flag and new mempack sublibrary with conditional dependencies based on the flag; updated main library and test dependencies |
| scls-util/scls-util.cabal | Updated to depend on the new scls-format:mempack sublibrary |
| scls-cddl/scls-cddl.cabal | Relaxed cuddle dependency version constraint from >=0.5 to >=0.3 |
| scls-format/mempack-2.0/Data/MemPack/Extra.hs | Created compatibility module for mempack 2.0 with utilities like Entry, RawBytes, CBORTerm, and helper functions |
| scls-format/mempack-2.0/Data/MemPack/ByteOrdered.hs | Created module for byte ordering utilities compatible with mempack 2.0 |
| scls-format/mempack-2.0/Data/MemPack/IsKey.hs | Created IsKey class module for mempack 2.0 with appropriate type signatures |
| scls-format/mempack-1.0/Data/MemPack/Extra.hs | Created compatibility module for mempack 1.0 with same utilities adapted for the older API |
| scls-format/mempack-1.0/Data/MemPack/ByteOrdered.hs | Created module for byte ordering utilities compatible with mempack 1.0 |
| scls-format/mempack-1.0/Data/MemPack/IsKey.hs | Created IsKey class module for mempack 1.0 with appropriate type signatures |
| scls-format/src/Cardano/SCLS/Internal/Serializer/HasKey.hs | Added HasKey instance for RawBytes, moved from MemPack.Extra |
| scls-format/src/Cardano/SCLS/Internal/Entry.hs | Updated imports and removed duplicate IsKey instance definitions, now importing from the new module structure |
| scls-format/src/Cardano/SCLS/Internal/Frame.hs | Refactored to use new helper functions hPutBuffer and runDecode from the compatibility layer |
| scls-format/src/Cardano/SCLS/Internal/Record/Internal/Class.hs | Updated to use Unpack' type alias for cross-version compatibility |
| scls-format/src/Cardano/SCLS/Internal/Record/*.hs | Updated imports to use Data.MemPack.ByteOrdered instead of Cardano.Types.ByteOrdered |
| scls-format/src/Cardano/SCLS/Internal/Serializer/*.hs | Updated imports to use new Data.MemPack.Extra module |
| scls-format/src/Cardano/Types/SlotNo.hs | Updated import from Cardano.Types.ByteOrdered to Data.MemPack.ByteOrdered |
| scls-format/src/Cardano/SCLS/Internal/Version.hs | Updated import from Cardano.Types.ByteOrdered to Data.MemPack.ByteOrdered |
| scls-format/src/Cardano/SCLS/Internal/Reader.hs | Updated imports to use new module structure for mempack utilities |
| scls-format/test/*.hs | Updated test files to import from Data.MemPack.Extra instead of internal serializer modules |
| scls-util/src/Cardano/SCLS/Util/*.hs | Updated imports across utility modules to use the new compatibility layer |
| scls-util/test/*.hs | Updated test imports to use Data.MemPack.Extra for utility types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| random >=1.2, | ||
| scls-cddl, | ||
| scls-format, | ||
| scls-format:mempack, |
Copilot
AI
Nov 12, 2025
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.
The syntax for referencing an internal library should be scls-format:mempack without braces. The braces {mempack} are incorrect Cabal syntax for internal library references.
| merkle-tree-incremental, | ||
| process, | ||
| scls-format, | ||
| scls-format:mempack, |
Copilot
AI
Nov 12, 2025
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.
The syntax for referencing an internal library should be scls-format:mempack without braces. The braces {mempack} are incorrect Cabal syntax for internal library references.
|
Not stable yet, so lets not merge |
|
Closing in favour of #139 |
No description provided.