Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.ByronSpec.Ledger.Rules
Description
Thin wrapper around the Byron spec rules
Intended for qualified import
import qualified Ouroboros.Consensus.ByronSpec.Ledger.Rules as Rules
Synopsis
- applyChainTick :: ByronSpecGenesis -> Slot -> State CHAIN -> State CHAIN
- liftCHAIN :: ByronSpecGenesis -> LiftedRule CHAIN
- liftSDELEG :: ByronSpecGenesis -> LiftedRule SDELEG
- liftUPIREG :: ByronSpecGenesis -> LiftedRule UPIREG
- liftUPIVOTE :: ByronSpecGenesis -> LiftedRule UPIVOTE
- liftUTXOW :: ByronSpecGenesis -> LiftedRule UTXOW
- initStateCHAIN :: ByronSpecGenesis -> State CHAIN
- data RuleContext sts = RuleContext {
- getRuleState :: GetChainState (State sts)
- modRuleState :: ModChainState (State sts)
- liftFailure :: PredicateFailure sts -> PredicateFailure CHAIN
- getRuleEnv :: State CHAIN -> Environment sts
- ctxtCHAIN :: ByronSpecGenesis -> RuleContext CHAIN
- ctxtDELEG :: ByronSpecGenesis -> RuleContext DELEG
- ctxtEPOCH :: ByronSpecGenesis -> RuleContext EPOCH
- ctxtSDELEG :: ByronSpecGenesis -> RuleContext SDELEG
- ctxtUPIREG :: ByronSpecGenesis -> RuleContext UPIREG
- ctxtUPIVOTE :: ByronSpecGenesis -> RuleContext UPIVOTE
- ctxtUTXOW :: ByronSpecGenesis -> RuleContext UTXOW
Ledger
applyChainTick :: ByronSpecGenesis -> Slot -> State CHAIN -> State CHAIN Source #
Chain tick
There isn't something in the spec that directly corresponds to this, so we have to combine a few different things:
- Apply the epoch rule (update the update state)
- Apply any scheduled delegations
- Set the slot number
This matches quite closely what applyChainTick
in
Ouroboros.Consensus.Ledger.Byron.Auxiliary does.
Lift STS transition rules to the chain level
liftCHAIN :: ByronSpecGenesis -> LiftedRule CHAIN Source #
Apply a block
This is a "trivial" (identity) lift.
liftSDELEG :: ByronSpecGenesis -> LiftedRule SDELEG Source #
Apply delegation certificate
liftUPIREG :: ByronSpecGenesis -> LiftedRule UPIREG Source #
Apply update proposal
liftUPIVOTE :: ByronSpecGenesis -> LiftedRule UPIVOTE Source #
Apply update vote
liftUTXOW :: ByronSpecGenesis -> LiftedRule UTXOW Source #
Apply transaction
STS initial rules
initStateCHAIN :: ByronSpecGenesis -> State CHAIN Source #
Rule context (exported for the benefit of the tests
data RuleContext sts Source #
Context required to apply a rule to the top-level CHAIN state
The environment for these rules pull in some information from the (abstract) genesis config and some information from the state; the reason is that although some values come from the state, as far as these rules are concerned, they are constants.
Constructors
RuleContext | |
Fields
|
ctxtCHAIN :: ByronSpecGenesis -> RuleContext CHAIN Source #
ctxtDELEG :: ByronSpecGenesis -> RuleContext DELEG Source #
ctxtEPOCH :: ByronSpecGenesis -> RuleContext EPOCH Source #
ctxtSDELEG :: ByronSpecGenesis -> RuleContext SDELEG Source #
ctxtUPIREG :: ByronSpecGenesis -> RuleContext UPIREG Source #
ctxtUPIVOTE :: ByronSpecGenesis -> RuleContext UPIVOTE Source #
ctxtUTXOW :: ByronSpecGenesis -> RuleContext UTXOW Source #