Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
-
data
Environment
=
Environment
{
- protocolMagic :: !( Annotated ProtocolMagicId ByteString )
- allowedDelegators :: !( Set KeyHash )
- currentEpoch :: ! EpochNumber
- currentSlot :: ! SlotNumber
- k :: ! BlockCount
-
data
State
=
State
{
- scheduledDelegations :: !( Seq ScheduledDelegation )
- keyEpochDelegations :: !( Set ( EpochNumber , KeyHash ))
- data Error
-
data
ScheduledDelegation
=
ScheduledDelegation
{
- sdSlot :: ! SlotNumber
- sdDelegator :: ! KeyHash
- sdDelegate :: ! KeyHash
- scheduleCertificate :: MonadError Error m => Environment -> State -> ACertificate ByteString -> m State
Scheduling
data Environment Source #
Environment | |
|
Instances
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.Scheduling
type
Rep
State
=
D1
('
MetaData
"State" "Cardano.Chain.Delegation.Validation.Scheduling" "cardano-ledger-byron-0.1.0.0-1U5kXR8zMRrE7QjCz70XVD" '
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
)))))
|
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 |
data ScheduledDelegation Source #
ScheduledDelegation | |
|
Instances
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.