Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
{
- vreRegisteredUpdateProposal :: !( Set UpId )
- vreDelegationMap :: ! Map
-
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
Instances
data RegistrationEnvironment Source #
Environment required to validate and register a vote
Instances
Eq RegistrationEnvironment Source # | |
Defined in Cardano.Chain.Update.Validation.Voting |
|
Show RegistrationEnvironment Source # | |
Defined in Cardano.Chain.Update.Validation.Voting |
|
Generic RegistrationEnvironment Source # | |
Defined in Cardano.Chain.Update.Validation.Voting |
|
NFData RegistrationEnvironment Source # | |
Defined in Cardano.Chain.Update.Validation.Voting rnf :: RegistrationEnvironment -> () Source # |
|
type Rep RegistrationEnvironment Source # | |
Defined in Cardano.Chain.Update.Validation.Voting
type
Rep
RegistrationEnvironment
=
D1
('
MetaData
"RegistrationEnvironment" "Cardano.Chain.Update.Validation.Voting" "cardano-ledger-byron-0.1.0.0-1U5kXR8zMRrE7QjCz70XVD" '
False
) (
C1
('
MetaCons
"RegistrationEnvironment" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"vreRegisteredUpdateProposal") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
(
Set
UpId
))
:*:
S1
('
MetaSel
('
Just
"vreDelegationMap") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
Map
)))
|
State keeps track of registered votes and confirmed proposals
State | |
|
Error captures the ways in which vote registration could fail
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.