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

Cardano.Chain.Delegation.Validation.Interface

Synopsis

Blockchain Interface

data Environment Source #

Instances

Instances details
NFData Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Methods

rnf ∷ Environment → () #

Generic Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Associated Types

type Rep Environment 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

type Rep Environment = D1 ('MetaData "Environment" "Cardano.Chain.Delegation.Validation.Interface" "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 "k") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockCount) :*: (S1 ('MetaSel ('Just "currentEpoch") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNumber) :*: S1 ('MetaSel ('Just "currentSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNumber)))))
Show Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Eq Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

type Rep Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

type Rep Environment = D1 ('MetaData "Environment" "Cardano.Chain.Delegation.Validation.Interface" "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 "k") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockCount) :*: (S1 ('MetaSel ('Just "currentEpoch") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNumber) :*: S1 ('MetaSel ('Just "currentSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNumber)))))

data State Source #

State shared between the blockchain and the ledger

Constructors

State 

Instances

Instances details
FromCBOR State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

ToCBOR State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

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.Interface

EncCBOR State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Methods

encCBOR ∷ State → Encoding Source #

NFData State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Methods

rnf ∷ State → () #

Generic State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Associated Types

type Rep State 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

type Rep State = D1 ('MetaData "State" "Cardano.Chain.Delegation.Validation.Interface" "cardano-ledger-byron-1.3.0.1-inplace" 'False) (C1 ('MetaCons "State" 'PrefixI 'True) (S1 ('MetaSel ('Just "schedulingState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 State) :*: S1 ('MetaSel ('Just "activationState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 State)))

Methods

from ∷ State → Rep State x #

to ∷ Rep State x → State #

Show State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Methods

showsPrec ∷ Int → State → ShowS #

show ∷ State → String #

showList ∷ [State] → ShowS #

Eq State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Methods

(==) ∷ State → State → Bool #

(/=) ∷ State → State → Bool #

NoThunks State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

type Rep State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

type Rep State = D1 ('MetaData "State" "Cardano.Chain.Delegation.Validation.Interface" "cardano-ledger-byron-1.3.0.1-inplace" 'False) (C1 ('MetaCons "State" 'PrefixI 'True) (S1 ('MetaSel ('Just "schedulingState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 State) :*: S1 ('MetaSel ('Just "activationState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 State)))

activateDelegations ∷ SlotNumber → State → State Source #

Activate certificates up to this slot

delegates ∷ State → VerificationKey → VerificationKey → Bool Source #

Check whether a delegation is valid in the State

initialState ∷ MonadError Error m ⇒ Environment → GenesisDelegation → m State Source #

The initial state maps each genesis key to itself and overrides this using certificates from the genesis block.

tickDelegation ∷ EpochNumber → SlotNumber → State → State Source #

Perform delegation update without adding certificates

updateDelegation ∷ MonadError Error m ⇒ Environment → State → [ACertificate ByteString] → m State Source #

Update the State with a list of new Certificates

This corresponds to the DELEG rule from the Byron ledger specification