cardano-ledger-byron-1.3.0.1: The blockchain layer of Cardano during the Byron era
Safe HaskellNone
LanguageHaskell2010

Cardano.Chain.Delegation.Validation.Scheduling

Contents

Synopsis

Scheduling

data Environment Source #

Instances

Instances details
NFData Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

rnf ∷ Environment → () #

Generic Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Associated Types

type Rep Environment 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

type Rep Environment = D1 ('MetaData "Environment" "Cardano.Chain.Delegation.Validation.Scheduling" "cardano-ledger-byron-1.3.0.1-inplace" 'False) (C1 ('MetaCons "Environment" 'PrefixI 'True) ((S1 ('MetaSel ('Just "protocolMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Annotated ProtocolMagicId ByteString)) :*: S1 ('MetaSel ('Just "allowedDelegators") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set KeyHash))) :*: (S1 ('MetaSel ('Just "currentEpoch") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNumber) :*: (S1 ('MetaSel ('Just "currentSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNumber) :*: S1 ('MetaSel ('Just "k") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockCount)))))
Show Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Eq Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

type Rep Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

type Rep Environment = D1 ('MetaData "Environment" "Cardano.Chain.Delegation.Validation.Scheduling" "cardano-ledger-byron-1.3.0.1-inplace" 'False) (C1 ('MetaCons "Environment" 'PrefixI 'True) ((S1 ('MetaSel ('Just "protocolMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Annotated ProtocolMagicId ByteString)) :*: S1 ('MetaSel ('Just "allowedDelegators") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set KeyHash))) :*: (S1 ('MetaSel ('Just "currentEpoch") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNumber) :*: (S1 ('MetaSel ('Just "currentSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNumber) :*: S1 ('MetaSel ('Just "k") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockCount)))))

data State Source #

Instances

Instances details
FromCBOR State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

ToCBOR State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

toCBOR ∷ State → Encoding Source #

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

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

DecCBOR State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

EncCBOR State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

encCBOR ∷ State → Encoding Source #

NFData State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

rnf ∷ State → () #

Generic State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Associated Types

type Rep State 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

type Rep State = D1 ('MetaData "State" "Cardano.Chain.Delegation.Validation.Scheduling" "cardano-ledger-byron-1.3.0.1-inplace" 'False) (C1 ('MetaCons "State" 'PrefixI 'True) (S1 ('MetaSel ('Just "scheduledDelegations") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Seq ScheduledDelegation)) :*: S1 ('MetaSel ('Just "keyEpochDelegations") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (EpochNumber, KeyHash)))))

Methods

from ∷ State → Rep State x #

to ∷ Rep State x → State #

Show State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

showsPrec ∷ Int → State → ShowS #

show ∷ State → String #

showList ∷ [State] → ShowS #

Eq State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

(==) ∷ State → State → Bool #

(/=) ∷ State → State → Bool #

NoThunks State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

type Rep State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

type Rep State = D1 ('MetaData "State" "Cardano.Chain.Delegation.Validation.Scheduling" "cardano-ledger-byron-1.3.0.1-inplace" 'False) (C1 ('MetaCons "State" 'PrefixI 'True) (S1 ('MetaSel ('Just "scheduledDelegations") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Seq ScheduledDelegation)) :*: S1 ('MetaSel ('Just "keyEpochDelegations") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (EpochNumber, KeyHash)))))

data Error Source #

Constructors

InvalidCertificate

The delegation certificate has an invalid signature

MultipleDelegationsForEpoch EpochNumber KeyHash

This delegator has already delegated for the given epoch

MultipleDelegationsForSlot SlotNumber KeyHash

This delegator has already delgated in this slot

NonGenesisDelegator KeyHash

This delegator is not one of the allowed genesis keys

WrongEpoch EpochNumber EpochNumber

This delegation is for a past or for a too future epoch

Instances

Instances details
FromCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

ToCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

toCBOR ∷ Error → Encoding Source #

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

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

DecCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

EncCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

encCBOR ∷ Error → Encoding Source #

Show Error Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

showsPrec ∷ Int → Error → ShowS #

show ∷ Error → String #

showList ∷ [Error] → ShowS #

Eq Error Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

(==) ∷ Error → Error → Bool #

(/=) ∷ Error → Error → Bool #

data ScheduledDelegation Source #

Instances

Instances details
FromCBOR ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

ToCBOR ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

DecCBOR ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

EncCBOR ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

NFData ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

rnf ∷ ScheduledDelegation → () #

Generic ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Associated Types

type Rep ScheduledDelegation 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

type Rep ScheduledDelegation = D1 ('MetaData "ScheduledDelegation" "Cardano.Chain.Delegation.Validation.Scheduling" "cardano-ledger-byron-1.3.0.1-inplace" 'False) (C1 ('MetaCons "ScheduledDelegation" 'PrefixI 'True) (S1 ('MetaSel ('Just "sdSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNumber) :*: (S1 ('MetaSel ('Just "sdDelegator") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KeyHash) :*: S1 ('MetaSel ('Just "sdDelegate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KeyHash))))
Show ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Eq ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

NoThunks ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

type Rep ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

type Rep ScheduledDelegation = D1 ('MetaData "ScheduledDelegation" "Cardano.Chain.Delegation.Validation.Scheduling" "cardano-ledger-byron-1.3.0.1-inplace" 'False) (C1 ('MetaCons "ScheduledDelegation" 'PrefixI 'True) (S1 ('MetaSel ('Just "sdSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNumber) :*: (S1 ('MetaSel ('Just "sdDelegator") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KeyHash) :*: S1 ('MetaSel ('Just "sdDelegate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KeyHash))))

scheduleCertificate ∷ MonadError Error m ⇒ Environment → State → ACertificate ByteString → m State Source #

Update the delegation State with a Certificate if it passes all the validation rules. This is an implementation of the delegation scheduling inference rule from the ledger specification.