Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cardano.Chain.Delegation.Validation.Interface
Contents
Synopsis
- data Environment = Environment {}
- data State = State {}
- activateDelegations ∷ SlotNumber → State → State
- delegates ∷ State → VerificationKey → VerificationKey → Bool
- delegationMap ∷ State → Map
- initialState ∷ MonadError Error m ⇒ Environment → GenesisDelegation → m State
- tickDelegation ∷ EpochNumber → SlotNumber → State → State
- updateDelegation ∷ MonadError Error m ⇒ Environment → State → [ACertificate ByteString] → m State
Blockchain Interface
data Environment Source #
Constructors
Environment | |
Fields |
Instances
Generic Environment Source # | |
Defined in Cardano.Chain.Delegation.Validation.Interface Associated Types type Rep Environment ∷ Type → Type # | |
Show Environment Source # | |
Defined in Cardano.Chain.Delegation.Validation.Interface Methods showsPrec ∷ Int → Environment → ShowS # show ∷ Environment → String # showList ∷ [Environment] → ShowS # | |
NFData Environment Source # | |
Defined in Cardano.Chain.Delegation.Validation.Interface Methods rnf ∷ Environment → () # | |
Eq Environment Source # | |
type Rep Environment Source # | |
Defined in Cardano.Chain.Delegation.Validation.Interface type Rep Environment = D1 ('MetaData "Environment" "Cardano.Chain.Delegation.Validation.Interface" "cardano-ledger-byron-1.1.0.0-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))))) |
State shared between the blockchain and the ledger
Constructors
State | |
Fields |
Instances
Generic State Source # | |
Show State Source # | |
FromCBOR State Source # | |
ToCBOR State Source # | |
DecCBOR State Source # | |
EncCBOR State Source # | |
NFData State Source # | |
Eq State Source # | |
NoThunks State Source # | |
type Rep State Source # | |
Defined in Cardano.Chain.Delegation.Validation.Interface type Rep State = D1 ('MetaData "State" "Cardano.Chain.Delegation.Validation.Interface" "cardano-ledger-byron-1.1.0.0-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
delegationMap ∷ State → Map Source #
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 Certificate
s
This corresponds to the DELEG
rule from the Byron ledger specification