Safe Haskell | None |
---|---|
Language | Haskell2010 |
Hot key
Intended for qualified import
Synopsis
- type KESEvolution = Period
-
data
KESInfo
=
KESInfo
{
- kesStartPeriod :: ! KESPeriod
- kesEndPeriod :: ! KESPeriod
- kesEvolution :: ! KESEvolution
- kesAbsolutePeriod :: KESInfo -> KESPeriod
- data KESStatus
- kesStatus :: KESInfo -> KESPeriod -> KESStatus
-
data
HotKey
c m =
HotKey
{
- evolve :: KESPeriod -> m KESEvolutionInfo
- getInfo :: m KESInfo
- isPoisoned :: m Bool
- sign_ :: forall toSign. ( KESignable c toSign, HasCallStack ) => toSign -> m ( SignedKES c toSign)
- data KESEvolutionError
- type KESEvolutionInfo = UpdateInfo KESInfo KESEvolutionError
- mkHotKey :: forall m c. ( Crypto c, IOLike m) => SignKeyKES c -> KESPeriod -> Word64 -> m ( HotKey c m)
- sign :: ( KESignable c toSign, HasCallStack ) => HotKey c m -> toSign -> m ( SignedKES c toSign)
KES Info
type KESEvolution = Period Source #
We call the relative periods that a KES key is valid its evolution, to avoid confusion with absolute periods.
KESInfo | |
|
Instances
Show KESInfo Source # | |
Generic KESInfo Source # | |
NoThunks KESInfo Source # | |
type Rep KESInfo Source # | |
Defined in Ouroboros.Consensus.Protocol.Ledger.HotKey
type
Rep
KESInfo
=
D1
('
MetaData
"KESInfo" "Ouroboros.Consensus.Protocol.Ledger.HotKey" "ouroboros-consensus-protocol-0.1.0.1-zKRBoYOfUlKsvZd6xB0lb" '
False
) (
C1
('
MetaCons
"KESInfo" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"kesStartPeriod") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
KESPeriod
)
:*:
(
S1
('
MetaSel
('
Just
"kesEndPeriod") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
KESPeriod
)
:*:
S1
('
MetaSel
('
Just
"kesEvolution") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
KESEvolution
))))
|
kesAbsolutePeriod :: KESInfo -> KESPeriod Source #
Return the absolute KES period
KES Status
BeforeKESStart |
The given period is before the start period of the KES key. |
InKESRange KESEvolution |
Relative period or evolution corresponding to the given absolute period |
AfterKESEnd |
The given period is after the end period of the KES key. |
kesStatus :: KESInfo -> KESPeriod -> KESStatus Source #
Return the evolution of the given KES period,
when
it falls within the
range of the
HotKey
(
[hkStart, hkEnd)
).
Note that the upper bound is exclusive, the spec says: > c0 <= kesPeriod s < c0 + MaxKESEvo
Hot Key
API to interact with the key.
HotKey | |
|
data KESEvolutionError Source #
Failed to evolve the KES key.
KESCouldNotEvolve KESInfo KESPeriod |
The KES key could not be evolved to the target period. |
KESKeyAlreadyPoisoned KESInfo KESPeriod |
Target period outside the range of the current KES key. Typically the current KES period according to the wallclock slot. |
Instances
type KESEvolutionInfo = UpdateInfo KESInfo KESEvolutionError Source #
Result of evolving the KES key.
sign :: ( KESignable c toSign, HasCallStack ) => HotKey c m -> toSign -> m ( SignedKES c toSign) Source #