Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cardano.Chain.Update.Validation.Voting
Description
Validation rules for registering votes and confirming proposals
This is an implementation of the rules defined in the Byron ledger specification
Synopsis
- data Environment = Environment {}
- data RegistrationEnvironment = RegistrationEnvironment {}
- data State = State {
- vsVotes ∷ !RegisteredVotes
- vsConfirmedProposals ∷ !(Map UpId SlotNumber)
- data Error
- registerVoteWithConfirmation ∷ MonadError Error m ⇒ Annotated ProtocolMagicId ByteString → Environment → State → AVote ByteString → m State
Documentation
data Environment Source #
Environment used to register votes and confirm proposals
Constructors
Environment | |
Instances
data RegistrationEnvironment Source #
Environment required to validate and register a vote
Constructors
RegistrationEnvironment | |
Fields |
Instances
State keeps track of registered votes and confirmed proposals
Constructors
State | |
Fields
|
Error captures the ways in which vote registration could fail
Constructors
VotingInvalidSignature | |
VotingProposalNotRegistered UpId | |
VotingVoterNotDelegate KeyHash | |
VotingVoteAlreadyCast KeyHash |
registerVoteWithConfirmation ∷ MonadError Error m ⇒ Annotated ProtocolMagicId ByteString → Environment → State → AVote ByteString → m State Source #
Register a vote and confirm the corresponding proposal if it passes the
voting threshold. This corresponds to the UPVOTE
rules in the spec.