| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Chain.Update.Vote
Synopsis
- data AVote a = UnsafeVote {
- voterVK :: !VerificationKey
- aProposalId :: !(Annotated UpId a)
- signature :: !(Signature (UpId, Bool))
- annotation :: !a
- type Vote = AVote ()
- type VoteId = Hash Vote
- mkVote :: ProtocolMagicId -> SigningKey -> UpId -> Bool -> Vote
- signVote :: ProtocolMagicId -> UpId -> Bool -> SafeSigner -> Vote
- signatureForVote :: ProtocolMagicId -> UpId -> Bool -> SafeSigner -> Signature (UpId, Bool)
- unsafeVote :: VerificationKey -> UpId -> Signature (UpId, Bool) -> Vote
- proposalId :: AVote a -> UpId
- recoverVoteId :: AVote ByteString -> VoteId
- recoverSignedBytes :: AVote ByteString -> Annotated (UpId, Bool) ByteString
- formatVoteShort :: Vote -> Builder
- shortVoteF :: Format r (Vote -> r)
Vote
Vote for update proposal
Invariant: The signature is valid.
Constructors
| UnsafeVote | |
Fields
| |
Instances
Vote Constructors
Arguments
| :: ProtocolMagicId | |
| -> SigningKey | The voter |
| -> UpId | Proposal which is voted for |
| -> Bool | Approval/rejection bit |
| -> Vote |
A safe constructor for UnsafeVote
Arguments
| :: ProtocolMagicId | |
| -> UpId | Proposal which is voted for |
| -> Bool | Approval/rejection bit |
| -> SafeSigner | The voter |
| -> Vote |
Create a vote for the given update proposal id, signing it with the provided safe signer.
signatureForVote :: ProtocolMagicId -> UpId -> Bool -> SafeSigner -> Signature (UpId, Bool) Source #
unsafeVote :: VerificationKey -> UpId -> Signature (UpId, Bool) -> Vote Source #
Create a vote for the given update proposal id using the provided signature.
For the meaning of the parameters see signVote.
Vote Accessors
proposalId :: AVote a -> UpId Source #
recoverVoteId :: AVote ByteString -> VoteId Source #
Vote Binary Serialization
recoverSignedBytes :: AVote ByteString -> Annotated (UpId, Bool) ByteString Source #