ouroboros-consensus-0.1.0.2: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.HardFork.Combinator.State.Types

Synopsis

Main types

data Current f blk Source #

Information about the current era

Constructors

Current 

Fields

Instances

Instances details
Eq (f blk) ⇒ Eq (Current f blk) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

Methods

(==)Current f blk → Current f blk → Bool Source #

(/=)Current f blk → Current f blk → Bool Source #

Show (f blk) ⇒ Show (Current f blk) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

Methods

showsPrecIntCurrent f blk → ShowS Source #

showCurrent f blk → String Source #

showList ∷ [Current f blk] → ShowS Source #

Generic (Current f blk) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

Associated Types

type Rep (Current f blk) ∷ TypeType Source #

Methods

fromCurrent f blk → Rep (Current f blk) x Source #

toRep (Current f blk) x → Current f blk Source #

NoThunks (f blk) ⇒ NoThunks (Current f blk) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

Methods

noThunks ∷ Context → Current f blk → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → Current f blk → IO (Maybe ThunkInfo) #

showTypeOfProxy (Current f blk) → String #

Serialise (f blk) ⇒ Serialise (Current f blk) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

Methods

encodeCurrent f blk → Encoding

decode ∷ Decoder s (Current f blk)

encodeList ∷ [Current f blk] → Encoding

decodeList ∷ Decoder s [Current f blk]

type Rep (Current f blk) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

type Rep (Current f blk) = D1 ('MetaData "Current" "Ouroboros.Consensus.HardFork.Combinator.State.Types" "ouroboros-consensus-0.1.0.2-inplace" 'False) (C1 ('MetaCons "Current" 'PrefixI 'True) (S1 ('MetaSel ('Just "currentStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bound) :*: S1 ('MetaSel ('Just "currentState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (f blk))))

newtype HardForkState f xs Source #

Generic hard fork state

This is used both for the consensus state and the ledger state.

Constructors

HardForkState 

Fields

Instances

Instances details
SerialiseHFC xs ⇒ DecodeDisk (HardForkBlock xs) (HardForkChainDepState xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk

Methods

decodeDiskCodecConfig (HardForkBlock xs) → ∀ s. Decoder s (HardForkChainDepState xs) Source #

SerialiseHFC xs ⇒ EncodeDisk (HardForkBlock xs) (HardForkChainDepState xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk

HAp HardForkState Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

Methods

hap ∷ ∀ (f ∷ k → Type) (g ∷ k → Type) (xs ∷ l). Prod HardForkState (f -.-> g) xs → HardForkState f xs → HardForkState g xs #

HCollapse HardForkState Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

Methods

hcollapse ∷ ∀ (xs ∷ l) a. SListIN HardForkState xs ⇒ HardForkState (K a) xs → CollapseTo HardForkState a #

HSequence HardForkState Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

Methods

hsequence' ∷ ∀ (xs ∷ l) f (g ∷ k → Type). (SListIN HardForkState xs, Applicative f) ⇒ HardForkState (f :.: g) xs → f (HardForkState g xs) #

hctraverse' ∷ ∀ c (xs ∷ l) g proxy f f'. (AllN HardForkState c xs, Applicative g) ⇒ proxy c → (∀ (a ∷ k). c a ⇒ f a → g (f' a)) → HardForkState f xs → g (HardForkState f' xs) #

htraverse' ∷ ∀ (xs ∷ l) g f f'. (SListIN HardForkState xs, Applicative g) ⇒ (∀ (a ∷ k). f a → g (f' a)) → HardForkState f xs → g (HardForkState f' xs) #

(All SingleEraBlock xs, ∀ blk. SingleEraBlock blk ⇒ Eq (f blk)) ⇒ Eq (HardForkState f xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

Methods

(==)HardForkState f xs → HardForkState f xs → Bool Source #

(/=)HardForkState f xs → HardForkState f xs → Bool Source #

(All SingleEraBlock xs, ∀ blk. SingleEraBlock blk ⇒ Show (f blk)) ⇒ Show (HardForkState f xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

(All SingleEraBlock xs, ∀ blk. SingleEraBlock blk ⇒ NoThunks (f blk)) ⇒ NoThunks (HardForkState f xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

Methods

noThunks ∷ Context → HardForkState f xs → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → HardForkState f xs → IO (Maybe ThunkInfo) #

showTypeOfProxy (HardForkState f xs) → String #

data Ticked (HardForkChainDepState xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol

type Prod HardForkState Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

type Prod HardForkState = NP ∷ (TypeType) → [Type] → Type
type SListIN HardForkState 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

type SListIN HardForkState = SListI ∷ [Type] → Constraint
type CollapseTo HardForkState a Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

type AllN HardForkState (c ∷ TypeConstraint) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

type AllN HardForkState (c ∷ TypeConstraint) = All c

data Past Source #

Information about a past era

Constructors

Past 

Fields

Instances

Instances details
Eq Past Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

Methods

(==)PastPastBool Source #

(/=)PastPastBool Source #

Show Past Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

Methods

showsPrecIntPastShowS Source #

showPastString Source #

showList ∷ [Past] → ShowS Source #

Generic Past Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

Associated Types

type Rep PastTypeType Source #

Methods

fromPastRep Past x Source #

toRep Past x → Past Source #

NoThunks Past Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

Methods

noThunks ∷ Context → PastIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → PastIO (Maybe ThunkInfo) #

showTypeOfProxy PastString #

Serialise Past 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Instances

Methods

encodePast → Encoding

decode ∷ Decoder s Past

encodeList ∷ [Past] → Encoding

decodeList ∷ Decoder s [Past]

type Rep Past Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

type Rep Past = D1 ('MetaData "Past" "Ouroboros.Consensus.HardFork.Combinator.State.Types" "ouroboros-consensus-0.1.0.2-inplace" 'False) (C1 ('MetaCons "Past" 'PrefixI 'True) (S1 ('MetaSel ('Just "pastStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bound) :*: S1 ('MetaSel ('Just "pastEnd") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bound)))

sequenceHardForkState ∷ ∀ m f xs. (All Top xs, Functor m) ⇒ HardForkState (m :.: f) xs → m (HardForkState f xs) Source #

Thin wrapper around sequence

Supporting types

data TransitionInfo Source #

Knowledge in a particular era of the transition to the next era

Constructors

TransitionUnknown !(WithOrigin SlotNo)

No transition is yet known for this era We instead record the ledger tip (which must be in this era)

NOTE: If we are forecasting, this will be set to the slot number of the (past) ledger state in which the forecast was created. This means that when we construct an EpochInfo using a HardForkLedgerView, the range of that EpochInfo will extend a safe zone from that past ledger state.

TransitionKnown !EpochNo

Transition to the next era is known to happen at this EpochNo

TransitionImpossible

The transition is impossible

This can be due to one of two reasons:

  • We are in the final era
  • This era has not actually begun yet (we are forecasting). In this case, we cannot look past the safe zone of this era and hence, by definition, the transition to the next era cannot happen.

Instances

Instances details
Show TransitionInfo Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

Generic TransitionInfo Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

Associated Types

type Rep TransitionInfoTypeType Source #

NoThunks TransitionInfo Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

Methods

noThunks ∷ Context → TransitionInfoIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → TransitionInfoIO (Maybe ThunkInfo) #

showTypeOfProxy TransitionInfoString #

type Rep TransitionInfo Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.State.Types

type Rep TransitionInfo = D1 ('MetaData "TransitionInfo" "Ouroboros.Consensus.HardFork.Combinator.State.Types" "ouroboros-consensus-0.1.0.2-inplace" 'False) (C1 ('MetaCons "TransitionUnknown" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin SlotNo))) :+: (C1 ('MetaCons "TransitionKnown" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo)) :+: C1 ('MetaCons "TransitionImpossible" 'PrefixI 'False) (U1TypeType)))

newtype Translate f x y Source #

Translate f x to f y across an era transition

Typically f will be LedgerState or WrapChainDepState.

Constructors

Translate 

Fields

newtype TranslateForecast f g x y Source #

Translate (a forecast of) f x to (a forecast of) f y across an era transition.

Typically f will be WrapLedgerView.

In addition to the Bound of the transition, this is also told the SlotNo we're constructing a forecast for. This enables the translation function to take into account any scheduled changes that the final ledger view in the preceding era might have.

Constructors

TranslateForecast