Skip to content

Conversation

@qnikst
Copy link
Contributor

@qnikst qnikst commented Nov 12, 2025

No description provided.

Copy link
Contributor

Copilot AI left a 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 mempack sublibrary in scls-format with version-specific compatibility shims
  • Moved and refactored ByteOrdered, MemPack utilities, and IsKey classes 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,
Copy link

Copilot AI Nov 12, 2025

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.

Copilot uses AI. Check for mistakes.
merkle-tree-incremental,
process,
scls-format,
scls-format:mempack,
Copy link

Copilot AI Nov 12, 2025

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.

Copilot uses AI. Check for mistakes.
@qnikst
Copy link
Contributor Author

qnikst commented Nov 13, 2025

Not stable yet, so lets not merge

@qnikst qnikst marked this pull request as draft November 13, 2025 16:35
@qnikst
Copy link
Contributor Author

qnikst commented Nov 26, 2025

Closing in favour of #139

@qnikst qnikst closed this Nov 26, 2025
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