-
Notifications
You must be signed in to change notification settings - Fork 16
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
The vote-file
and proposal-file
options are Conway onwards only
#373
The vote-file
and proposal-file
options are Conway onwards only
#373
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.
Sorry I disagree here.
(pure emptyVotingProcedures) | ||
(\w -> firstExceptT TxCmdVoteError $ ExceptT (readVotingProceduresFiles w voteFiles)) | ||
eon | ||
case mfVoteFiles of |
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.
So we're now essentially pattern matching twice based on whether or not a feature is in an era.
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.
Can you clarify what you mean? Is the problem the case match n the Maybe
, once for voting procedures and once for proposals?
e5755e7
to
ca06a7c
Compare
inEonForEra | ||
(pure emptyVotingProcedures) | ||
(\w -> firstExceptT TxCmdVoteError $ ExceptT (readVotingProceduresFiles w voteFiles)) | ||
eon |
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 use of inEonForEra
is made unnecessary by using the Featured
type.
ca06a7c
to
3dfb7f0
Compare
eon | ||
liftMaybeFeatured mfVoteFiles $ \w voteFiles -> | ||
lift (readVotingProceduresFiles w voteFiles) | ||
& onLeft (left . TxCmdVoteError) |
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.
Using the new liftMaybeFeatured
function to make it easy to manipulate the value within the Featured
type.
readVotingProceduresFiles
takes a [VoteFile In]
and returns a VotingProcedures era
liftMaybeFeatured
takes that computation to convert a Maybe (Featured ConwayEraOnwards [VoteFile In])
to a Maybe (Featured ConwayEraOnwards [VotingProcedures era])
3dfb7f0
to
42313e9
Compare
42313e9
to
83ec504
Compare
vote-file
and proposal-file
options are Conway onwards onlyvote-file
and proposal-file
options are Shelley to Babbage only
vote-file
and proposal-file
options are Shelley to Babbage onlyvote-file
and proposal-file
options are Conway era onwards only
vote-file
and proposal-file
options are Conway era onwards onlyvote-file
and proposal-file
options Conway onwards only
vote-file
and proposal-file
options Conway onwards onlyvote-file
and proposal-file
options are Conway onwards only
83ec504
to
4def5e6
Compare
Changelog
Context
Use the
Featured
type to declare the--vote-files
and--proposal-files
flags intransaction build
andtransaction build-raw
commands should only exist from Conway era onwards.Because TxBody also uses
Featured
in the same way, the code that links the CLI types to the TxBody type is streamlined.Checklist
See Running tests for more details
.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-8.10.7
andghc-9.2.7