-
Notifications
You must be signed in to change notification settings - Fork 217
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
Do some header decoding #245
Conversation
cb6ff72
to
a5db312
Compare
a5db312
to
6ce2341
Compare
data ConfigParam = ConfigParam | ||
deriving Show | ||
|
||
{-# ANN getBlockHeader ("HLint: ignore Use <$>" :: String) #-} |
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.
Didn't want to use applicative syntax. Wanted to keep the binary format separate from the BlockHeader
constructor and the ordering of its arguments.
-- | ||
-- Header | ||
-- | ||
data Block = Block BlockHeader [Message] |
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.
This is a different Block
from Cardano.Wallet.Primitive.Types.Bock
. Not sure how this will play out, but thinking we keep it here and can convert to Cardano.Wallet.Primitive.Types.Bock
in another place as required.
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.
Hmmm..... Okay. we will do some mapping then most probably. Although it'd be nice if this could just happen in the decoder itself.
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.
In that case we will ignore everything but Transaction
messages for now?
E.g. the initial protocol/config parameters, update proposals, and others?
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.
Indeed. As we'll most probably make our definition of Block
evolve when and if we take the others into consideration.
a73dd6b
to
a31b823
Compare
a31b823
to
5935a96
Compare
Thanks @KtorZ! Addressed. Should I have removed the stub for |
7c397d4
to
bacb66f
Compare
bors r+ |
245: Do some header decoding r=KtorZ a=Anviking # Issue Number #218 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - `getBlockHeader :: Get BlockHeader` with unit test - Scaffold for later (`getBlock`, `Message`, ...) # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
bacb66f
to
493f76c
Compare
Canceled |
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
Issue Number
#218
Overview
getBlockHeader :: Get BlockHeader
with unit testgetBlock
,Message
, ...)Comments