-
Notifications
You must be signed in to change notification settings - Fork 13
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
Read and write VotingProcedures
files instead of VotingEntry
files
#203
Read and write VotingProcedures
files instead of VotingEntry
files
#203
Conversation
f51b4f6
to
620ab70
Compare
VotingProcedures
files instead of VotingEntry
files
620ab70
to
f13871d
Compare
$ Ledger.VotingProcedures | ||
$ Map.unionWith (Map.unionWith const) | ||
(Ledger.unVotingProcedures (unVotingProcedures vpsa)) | ||
(Ledger.unVotingProcedures (unVotingProcedures vpsb)) |
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 above three functions can be moved into cardano-api
. Having it here proves it works and is useful.
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.
We can leave them here in this PR but we should move them to cardano-api
so others can use them without depending on cardano-cli
.
585ba7d
to
c634daa
Compare
Ledger.DRepVoter cred -> | ||
VoterDRep (VotingCredential cred) | ||
Ledger.StakePoolVoter kh -> | ||
VoterSpo (StakePoolKeyHash kh) |
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 can be deleted when votingProceduresToTxVotes
is deleted.
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 can be deleted in a follow up PR 👍
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! 👍
@@ -31,41 +32,34 @@ runGovernanceCreateVoteCmd | |||
-> ExceptT GovernanceCmdError IO () | |||
runGovernanceCreateVoteCmd anyEra vChoice vType (govActionTxId, govActionIndex) votingStakeCred oFp = do |
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.
We should deprecate this command (in a separate PR) as we are maintaining two vote creation commands and this one doesn't allow vote creation for DReps or committee members.
let voter = Ledger.DRepVoter (unVotingCredential votingCred) | ||
govActIdentifier = createGovernanceActionId govActionTxId govActionIndex | ||
voteProcedure = createVotingProcedure sbe vChoice Nothing | ||
votingProcedures = singletonVotingProcedures sbe voter govActIdentifier (unVotingProcedure voteProcedure) |
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.
Not for this PR but there is no reason why we shouldn't allow multiple voting files to be added to a tx.
$ Ledger.VotingProcedures | ||
$ Map.unionWith (Map.unionWith const) | ||
(Ledger.unVotingProcedures (unVotingProcedures vpsa)) | ||
(Ledger.unVotingProcedures (unVotingProcedures vpsb)) |
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.
We can leave them here in this PR but we should move them to cardano-api
so others can use them without depending on cardano-cli
.
Ledger.DRepVoter cred -> | ||
VoterDRep (VotingCredential cred) | ||
Ledger.StakePoolVoter kh -> | ||
VoterSpo (StakePoolKeyHash kh) |
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 can be deleted in a follow up PR 👍
c634daa
to
ae987a9
Compare
…VotingProcedures, readVotingProceduresFiles and readVotingProceduresFile
ae987a9
to
89af843
Compare
89af843
to
fc76402
Compare
Changelog
Context
Using
VotingProcedures
as the serialisation types allows us to use ledger's serialisation rather than our own.This PR converts the IO code to use
VotingProcedures
. The conversion is not complete becauseTxBodyContent
still has aTxVotes
member.A subsequent PR in
cardano-api
will switch that out.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