cardano-ledger-byron-1.0.2.0: The blockchain layer of Cardano during the Byron era
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Documentation

data Environment Source #

Environment used to register votes and confirm proposals

Instances

Instances details
Generic Environment Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

Associated Types

type Rep EnvironmentTypeType Source #

Show Environment Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

NFData Environment Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

Methods

rnfEnvironment → () Source #

Eq Environment Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

type Rep Environment Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

type Rep Environment = D1 ('MetaData "Environment" "Cardano.Chain.Update.Validation.Voting" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "Environment" 'PrefixI 'True) (S1 ('MetaSel ('Just "veCurrentSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlotNumber) :*: (S1 ('MetaSel ('Just "veConfirmationThreshold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "veVotingRegistrationEnvironment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RegistrationEnvironment))))

data RegistrationEnvironment Source #

Environment required to validate and register a vote

Instances

Instances details
Generic RegistrationEnvironment Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

Associated Types

type Rep RegistrationEnvironmentTypeType Source #

Show RegistrationEnvironment Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

NFData RegistrationEnvironment Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

Eq RegistrationEnvironment Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

type Rep RegistrationEnvironment Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

type Rep RegistrationEnvironment = D1 ('MetaData "RegistrationEnvironment" "Cardano.Chain.Update.Validation.Voting" "cardano-ledger-byron-1.0.2.0-inplace" '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)))

data State Source #

State keeps track of registered votes and confirmed proposals

Constructors

State 

Fields

data Error Source #

Error captures the ways in which vote registration could fail

Instances

Instances details
Show Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

FromCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

ToCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

Methods

toCBORErrorEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ErrorSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Error] → Size Source #

DecCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

EncCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

Methods

encCBORErrorEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy ErrorSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Error] → Size Source #

Eq Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Voting

Methods

(==)ErrorErrorBool Source #

(/=)ErrorErrorBool Source #

registerVoteWithConfirmationMonadError Error m ⇒ Annotated ProtocolMagicId ByteStringEnvironmentStateAVote 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.