Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
-
data
Environment
=
Environment
{
- protocolMagic :: !( Annotated ProtocolMagicId ByteString )
- allowedDelegators :: !( Set KeyHash )
- k :: ! BlockCount
- currentEpoch :: ! EpochNumber
- currentSlot :: ! SlotNumber
-
data
State
=
State
{
- schedulingState :: ! State
- activationState :: ! 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 #
Environment | |
|
Instances
State shared between the blockchain and the ledger
State | |
|
Instances
Eq State Source # | |
Show State Source # | |
Generic State Source # | |
NFData State Source # | |
|
|
ToCBOR State Source # | |
FromCBOR 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-0.1.0.0-1U5kXR8zMRrE7QjCz70XVD" '
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