cardano-ledger-0.1.0.0: The blockchain layer of Cardano
Safe HaskellNone
LanguageHaskell2010

Cardano.Chain.Delegation.Validation.Scheduling

Contents

Synopsis

Scheduling

data Environment Source #

Instances

Instances details
Eq Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Show Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Generic Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Associated Types

type Rep Environment :: Type -> Type #

NFData Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

rnf :: Environment -> () #

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-0.1.0.0-LsmGdPmHvbsHmMt4VaqSe3" '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
Eq State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

(==) :: State -> State -> Bool #

(/=) :: State -> State -> Bool #

Show State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

showsPrec :: Int -> State -> ShowS #

show :: State -> String #

showList :: [State] -> ShowS #

Generic State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Associated Types

type Rep State :: Type -> Type #

Methods

from :: State -> Rep State x #

to :: Rep State x -> State #

NFData State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

rnf :: State -> () #

ToCBOR State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

toCBOR :: State -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy State -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [State] -> Size Source #

FromCBOR State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

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-0.1.0.0-LsmGdPmHvbsHmMt4VaqSe3" '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
Eq Error Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

(==) :: Error -> Error -> Bool #

(/=) :: Error -> Error -> Bool #

Show Error Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

ToCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

toCBOR :: Error -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy Error -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Error] -> Size Source #

FromCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

data ScheduledDelegation Source #

Instances

Instances details
Eq ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Show ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Generic ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Associated Types

type Rep ScheduledDelegation :: Type -> Type #

NFData ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

Methods

rnf :: ScheduledDelegation -> () #

ToCBOR ScheduledDelegation Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Scheduling

FromCBOR 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-0.1.0.0-LsmGdPmHvbsHmMt4VaqSe3" '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.