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

Cardano.Chain.Delegation.Validation.Interface

Synopsis

Blockchain Interface

data Environment Source #

Instances

Instances details
Eq Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Show Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Generic Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Associated Types

type Rep Environment :: Type -> Type #

NFData Environment Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Methods

rnf :: Environment -> () #

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

Defined in Cardano.Chain.Delegation.Validation.Interface

Methods

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

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

Show State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

Methods

showsPrec :: Int -> State -> ShowS #

show :: State -> String #

showList :: [State] -> ShowS #

Generic State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

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

Methods

rnf :: State -> () #

ToCBOR State Source # 
Instance details

Defined in Cardano.Chain.Delegation.Validation.Interface

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

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