cardano-ledger-byron-0.1.0.0: The blockchain layer of Cardano during the Byron era
Safe Haskell None
Language Haskell2010

Cardano.Chain.Update.Validation.Interface

Description

Blockchain interface validation rules.

Synopsis

Environment

data Environment Source #

Constructors

Environment

Fields

State

data State Source #

Update interface state.

Constructors

State

Fields

Instances

Instances details
Eq State Source #
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

Show State Source #
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

Generic State Source #
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

NFData State Source #
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

ToCBOR State Source #
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

FromCBOR State Source #
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

NoThunks State Source #
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

type Rep State Source #
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

type Rep State = D1 (' MetaData "State" "Cardano.Chain.Update.Validation.Interface" "cardano-ledger-byron-0.1.0.0-1U5kXR8zMRrE7QjCz70XVD" ' False ) ( C1 (' MetaCons "State" ' PrefixI ' True ) ((( S1 (' MetaSel (' Just "currentEpoch") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 EpochNumber ) :*: S1 (' MetaSel (' Just "adoptedProtocolVersion") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ProtocolVersion )) :*: ( S1 (' MetaSel (' Just "adoptedProtocolParameters") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ProtocolParameters ) :*: ( S1 (' MetaSel (' Just "candidateProtocolUpdates") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 [ CandidateProtocolUpdate ]) :*: S1 (' MetaSel (' Just "appVersions") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ApplicationVersions )))) :*: (( S1 (' MetaSel (' Just "registeredProtocolUpdateProposals") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ProtocolUpdateProposals ) :*: ( S1 (' MetaSel (' Just "registeredSoftwareUpdateProposals") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 SoftwareUpdateProposals ) :*: S1 (' MetaSel (' Just "confirmedProposals") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Map UpId SlotNumber )))) :*: ( S1 (' MetaSel (' Just "proposalVotes") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Map UpId ( Set KeyHash ))) :*: ( S1 (' MetaSel (' Just "registeredEndorsements") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Set Endorsement )) :*: S1 (' MetaSel (' Just "proposalRegistrationSlot") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Map UpId SlotNumber )))))))

initialState :: Config -> State Source #

Initial update interface state

Signal

data Signal Source #

Signal combining signals from various rules

Error

Interface functions

registerUpdate :: MonadError Error m => Environment -> State -> Signal -> m State Source #

Group together the other registration rules in a single rule

This corresponds to the BUPI rule in the Byron chain specification.

registerProposal :: MonadError Error m => Environment -> State -> AProposal ByteString -> m State Source #

Register an update proposal.

This corresponds to the UPIREG rule in the Byron ledger specification.

registerVote :: MonadError Error m => Environment -> State -> AVote ByteString -> m State Source #

Register a vote for the given proposal.

This corresponds to the UPIVOTE rule in the Byron ledger

registerEndorsement :: MonadError Error m => Environment -> State -> Endorsement -> m State Source #

Register an endorsement.

An endorsement represents the fact that a genesis key is ready to start using the protocol version being endorsed. In the decentralized era only genesis key holders can endorse protocol versions.

This corresponds to the UPIEND rule in the Byron ledger specification.

registerEpoch Source #

Arguments

:: Environment
-> State
-> EpochNumber

Epoch seen on the block.

-> State

Register an epoch. Whenever an epoch number is seen on a block this epoch number should be passed to this function so that on epoch change the protocol parameters can be updated, provided that there is an update candidate that was accepted and endorsed by a majority of the genesis keys.

This corresponds to the UPIEC rules in the Byron ledger specification.