-
Notifications
You must be signed in to change notification settings - Fork 6
AnnotatedCodec #74
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
AnnotatedCodec #74
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 PR introduces AnnotatedCodec
to the typed-protocols
library, which enables retaining the original bytes received from the network during message decoding. This is particularly useful for cryptographic applications where the exact received bytes must be preserved for signature verification.
Key changes include:
- Generalization of the
Codec
type toCodecF
with type aliases for backward compatibility - Creation of a new
codec-properties
library for testing utilities - Addition of comprehensive QuickCheck properties for the new annotated codec functionality
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
typed-protocols/typed-protocols.cabal | Version bump to 1.1.0.0 and addition of new codec-properties library |
typed-protocols/src/Network/TypedProtocol/Codec.hs | Core implementation of CodecF generalization and AnnotatedCodec type |
typed-protocols/properties/Network/TypedProtocol/Codec/Properties.hs | New comprehensive QuickCheck properties for codec testing |
typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs | Example implementation of annotated codec for ReqResp protocol |
typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs | Test integration for the new annotated codec properties |
a959766
to
fcb0a53
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.
lgtm - with some minor comments.
Moved `prop_codec` properties to a sublibrary. All properties return QuickCheck's `Property` type.
fcb0a53
to
ee05d80
Compare
This PR provides
AnnotatedCodec
totyped-protocols
which allows to retainbytes received from the network. It also includes new quickcheck properties
for the new codec as well as an example implementation for
ReqResp
mini-protocol.