Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.Ledger
Synopsis
- data HardForkEnvelopeErr (xs ∷ [Type])
- data HardForkLedgerError (xs ∷ [Type])
- data HardForkLedgerUpdate (xs ∷ [Type])
- = HardForkUpdateInEra (OneEraLedgerUpdate xs)
- | HardForkUpdateTransitionConfirmed (EraIndex xs) (EraIndex xs) EpochNo
- | HardForkUpdateTransitionDone (EraIndex xs) (EraIndex xs) EpochNo
- | HardForkUpdateTransitionRolledBack (EraIndex xs) (EraIndex xs)
- data HardForkLedgerWarning (xs ∷ [Type])
- = HardForkWarningInEra (OneEraLedgerWarning xs)
- | HardForkWarningTransitionMismatch (EraIndex xs) EraParams EpochNo
- | HardForkWarningTransitionInFinalEra (EraIndex xs) EpochNo
- | HardForkWarningTransitionUnconfirmed (EraIndex xs)
- | HardForkWarningTransitionReconfirmed (EraIndex xs) (EraIndex xs) EpochNo EpochNo
- newtype FlipTickedLedgerState (mk ∷ MapKind) blk = FlipTickedLedgerState {
- getFlipTickedLedgerState ∷ Ticked (LedgerState blk) mk
- data family Ticked (st ∷ k) ∷ k
- data AnnForecast (state ∷ Type → (Type → Type → Type) → Type) (view ∷ Type → Type) blk = AnnForecast {
- annForecast ∷ Forecast (view blk)
- annForecastState ∷ state blk EmptyMK
- annForecastTip ∷ WithOrigin SlotNo
- annForecastEnd ∷ Maybe Bound
- mkHardForkForecast ∷ ∀ (state ∷ Type → (Type → Type → Type) → Type) (view ∷ Type → Type) (xs ∷ [Type]). SListI xs ⇒ InPairs (CrossEraForecaster state view) xs → HardForkState (AnnForecast state view) xs → Forecast (HardForkLedgerView_ view xs)
- ejectLedgerTables ∷ ∀ (xs ∷ [Type]) x (mk ∷ MapKind). (CanMapKeysMK mk, Ord (TxIn (LedgerState x)), HasCanonicalTxIn xs, CanMapMK mk, HasHardForkTxOut xs) ⇒ Index xs x → LedgerTables (LedgerState (HardForkBlock xs)) mk → LedgerTables (LedgerState x) mk
- injectLedgerTables ∷ ∀ (xs ∷ [Type]) x (mk ∷ MapKind). (CanMapKeysMK mk, CanMapMK mk, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ Index xs x → LedgerTables (LedgerState x) mk → LedgerTables (LedgerState (HardForkBlock xs)) mk
- class (Show (CanonicalTxIn xs), Ord (CanonicalTxIn xs), NoThunks (CanonicalTxIn xs), MemPack (CanonicalTxIn xs)) ⇒ HasCanonicalTxIn (xs ∷ [Type]) where
- data CanonicalTxIn (xs ∷ [Type])
- injectCanonicalTxIn ∷ Index xs x → TxIn (LedgerState x) → CanonicalTxIn xs
- ejectCanonicalTxIn ∷ Index xs x → CanonicalTxIn xs → TxIn (LedgerState x)
- type DefaultHardForkTxOut (xs ∷ [Type]) = NS WrapTxOut xs
- class (Show (HardForkTxOut xs), Eq (HardForkTxOut xs), NoThunks (HardForkTxOut xs), IndexedMemPack (LedgerState (HardForkBlock xs) EmptyMK) (HardForkTxOut xs), SerializeTablesWithHint (LedgerState (HardForkBlock xs))) ⇒ HasHardForkTxOut (xs ∷ [Type]) where
- type HardForkTxOut (xs ∷ [Type])
- injectHardForkTxOut ∷ Index xs x → TxOut (LedgerState x) → HardForkTxOut xs
- ejectHardForkTxOut ∷ Index xs x → HardForkTxOut xs → TxOut (LedgerState x)
- txOutEjections ∷ NP ((K (NS WrapTxOut xs) ∷ Type → Type) -.-> WrapTxOut) xs
- txOutTranslations ∷ Tails (Fn2 WrapTxOut) xs
- class MemPack (TxOut (LedgerState x)) ⇒ MemPackTxOut x
- ejectHardForkTxOutDefault ∷ ∀ (xs ∷ [Type]) x. (SListI xs, HasHardForkTxOut xs) ⇒ Index xs x → DefaultHardForkTxOut xs → TxOut (LedgerState x)
- injectHardForkTxOutDefault ∷ ∀ (xs ∷ [Type]) x. SListI xs ⇒ Index xs x → TxOut (LedgerState x) → DefaultHardForkTxOut xs
Documentation
data HardForkEnvelopeErr (xs ∷ [Type]) Source #
Constructors
HardForkEnvelopeErrFromEra (OneEraEnvelopeErr xs) | Validation error from one of the eras |
HardForkEnvelopeErrWrongEra (MismatchEraInfo xs) | We tried to apply a block from the wrong era |
Instances
data HardForkLedgerError (xs ∷ [Type]) Source #
Constructors
HardForkLedgerErrorFromEra (OneEraLedgerError xs) | Validation error from one of the eras |
HardForkLedgerErrorWrongEra (MismatchEraInfo xs) | We tried to apply a block from the wrong era |
Instances
Generic (HardForkLedgerError xs) Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Associated Types
Methods from ∷ HardForkLedgerError xs → Rep (HardForkLedgerError xs) x # to ∷ Rep (HardForkLedgerError xs) x → HardForkLedgerError xs # | |||||
CanHardFork xs ⇒ Show (HardForkLedgerError xs) Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods showsPrec ∷ Int → HardForkLedgerError xs → ShowS # show ∷ HardForkLedgerError xs → String # showList ∷ [HardForkLedgerError xs] → ShowS # | |||||
CanHardFork xs ⇒ Eq (HardForkLedgerError xs) Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods (==) ∷ HardForkLedgerError xs → HardForkLedgerError xs → Bool # (/=) ∷ HardForkLedgerError xs → HardForkLedgerError xs → Bool # | |||||
CanHardFork xs ⇒ NoThunks (HardForkLedgerError xs) Source # | |||||
type Rep (HardForkLedgerError xs) Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger type Rep (HardForkLedgerError xs) = D1 ('MetaData "HardForkLedgerError" "Ouroboros.Consensus.HardFork.Combinator.Ledger" "ouroboros-consensus-0.26.0.0-inplace" 'False) (C1 ('MetaCons "HardForkLedgerErrorFromEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OneEraLedgerError xs))) :+: C1 ('MetaCons "HardForkLedgerErrorWrongEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MismatchEraInfo xs)))) |
data HardForkLedgerUpdate (xs ∷ [Type]) Source #
Constructors
HardForkUpdateInEra (OneEraLedgerUpdate xs) | |
HardForkUpdateTransitionConfirmed (EraIndex xs) (EraIndex xs) EpochNo | Hard fork transition got confirmed |
HardForkUpdateTransitionDone (EraIndex xs) (EraIndex xs) EpochNo | Hard fork transition happened We record the |
HardForkUpdateTransitionRolledBack (EraIndex xs) (EraIndex xs) | The hard fork transition rolled back |
Instances
CanHardFork xs ⇒ Show (HardForkLedgerUpdate xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods showsPrec ∷ Int → HardForkLedgerUpdate xs → ShowS # show ∷ HardForkLedgerUpdate xs → String # showList ∷ [HardForkLedgerUpdate xs] → ShowS # | |
CanHardFork xs ⇒ Eq (HardForkLedgerUpdate xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods (==) ∷ HardForkLedgerUpdate xs → HardForkLedgerUpdate xs → Bool # (/=) ∷ HardForkLedgerUpdate xs → HardForkLedgerUpdate xs → Bool # | |
CanHardFork xs ⇒ Condense (HardForkLedgerUpdate xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods condense ∷ HardForkLedgerUpdate xs → String Source # |
data HardForkLedgerWarning (xs ∷ [Type]) Source #
Constructors
HardForkWarningInEra (OneEraLedgerWarning xs) | Warning from the underlying era |
HardForkWarningTransitionMismatch (EraIndex xs) EraParams EpochNo | The transition to the next era does not match the The |
HardForkWarningTransitionInFinalEra (EraIndex xs) EpochNo | Transition in the final era The final era should never confirm any transitions. For clarity, we also record the index of that final era. |
HardForkWarningTransitionUnconfirmed (EraIndex xs) | An already-confirmed transition got un-confirmed |
HardForkWarningTransitionReconfirmed (EraIndex xs) (EraIndex xs) EpochNo EpochNo | An already-confirmed transition got changed We record the indices of the era we are transitioning from and to,
as well as the old and new |
Instances
CanHardFork xs ⇒ Show (HardForkLedgerWarning xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods showsPrec ∷ Int → HardForkLedgerWarning xs → ShowS # show ∷ HardForkLedgerWarning xs → String # showList ∷ [HardForkLedgerWarning xs] → ShowS # | |
CanHardFork xs ⇒ Eq (HardForkLedgerWarning xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods (==) ∷ HardForkLedgerWarning xs → HardForkLedgerWarning xs → Bool # (/=) ∷ HardForkLedgerWarning xs → HardForkLedgerWarning xs → Bool # |
Type family instances
newtype FlipTickedLedgerState (mk ∷ MapKind) blk Source #
Constructors
FlipTickedLedgerState | |
Fields
|
Instances
Isomorphic (FlipTickedLedgerState mk) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary Methods project ∷ NoHardForks blk ⇒ FlipTickedLedgerState mk (HardForkBlock '[blk]) → FlipTickedLedgerState mk blk Source # inject ∷ NoHardForks blk ⇒ FlipTickedLedgerState mk blk → FlipTickedLedgerState mk (HardForkBlock '[blk]) Source # |
data family Ticked (st ∷ k) ∷ k Source #
" Ticked " piece of state, either LedgerState
or ChainDepState
Ticking refers to the passage of time (the ticking of the clock). When a
piece of state is marked as ticked, it means that time-related changes have
been applied to the state. There are exactly two methods in the interface
that do that: tickChainDepState
and
applyChainTickLedgerResult
.
Also note that a successful forecast
must equal
forecastFor
(ledgerViewForecastAt
cfg st)
slot
. Thus a
protocolLedgerView
cfg
(applyChainTick
cfg slot st)LedgerView
can only be projected
from a Ticked
state, but cannot itself be ticked.
Some examples of time related changes:
- Scheduled delegations might have been applied in Byron
- New leader schedule computed for Shelley
- Transition from Byron to Shelley activated in the hard fork combinator.
- Nonces switched out at the start of a new epoch.
Instances
Show (Ticked ()) Source # | |
CanHardFork xs ⇒ GetTip (Ticked (LedgerState (HardForkBlock xs))) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods getTip ∷ ∀ (mk ∷ MapKind). Ticked (LedgerState (HardForkBlock xs)) mk → Point (Ticked (LedgerState (HardForkBlock xs))) Source # | |
Bridge m a ⇒ GetTip (Ticked (LedgerState (DualBlock m a))) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
IsLedger (LedgerState blk) ⇒ GetTip (Ticked (ExtLedgerState blk)) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods getTip ∷ ∀ (mk ∷ MapKind). Ticked (ExtLedgerState blk) mk → Point (Ticked (ExtLedgerState blk)) Source # | |
(CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ HasLedgerTables (Ticked (LedgerState (HardForkBlock xs))) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (HardForkBlock xs)) mk → LedgerTables (Ticked (LedgerState (HardForkBlock xs))) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (HardForkBlock xs)) any → LedgerTables (Ticked (LedgerState (HardForkBlock xs))) mk → Ticked (LedgerState (HardForkBlock xs)) mk Source # | |
(Bridge m a, NoThunks (TxOut (LedgerState m)), NoThunks (TxIn (LedgerState m)), Show (TxOut (LedgerState m)), Show (TxIn (LedgerState m)), Eq (TxOut (LedgerState m)), Ord (TxIn (LedgerState m)), MemPack (TxIn (LedgerState m))) ⇒ HasLedgerTables (Ticked (LedgerState (DualBlock m a))) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (DualBlock m a)) mk → LedgerTables (Ticked (LedgerState (DualBlock m a))) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (DualBlock m a)) any → LedgerTables (Ticked (LedgerState (DualBlock m a))) mk → Ticked (LedgerState (DualBlock m a)) mk Source # | |
(HasLedgerTables (Ticked (LedgerState blk)), NoThunks (TxOut (LedgerState blk)), NoThunks (TxIn (LedgerState blk)), Show (TxOut (LedgerState blk)), Show (TxIn (LedgerState blk)), Eq (TxOut (LedgerState blk)), Ord (TxIn (LedgerState blk)), MemPack (TxIn (LedgerState blk))) ⇒ HasLedgerTables (Ticked (ExtLedgerState blk)) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (ExtLedgerState blk) mk → LedgerTables (Ticked (ExtLedgerState blk)) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (ExtLedgerState blk) any → LedgerTables (Ticked (ExtLedgerState blk)) mk → Ticked (ExtLedgerState blk) mk Source # | |
LedgerTablesAreTrivial (Ticked (LedgerState blk)) ⇒ LedgerTablesAreTrivial (Ticked (ExtLedgerState blk)) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods convertMapKind ∷ ∀ (mk ∷ MapKind) (mk' ∷ MapKind). Ticked (ExtLedgerState blk) mk → Ticked (ExtLedgerState blk) mk' Source # | |
NoThunks (Ticked (LedgerState (DualBlock m a)) mk) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
Show (Ticked (f a)) ⇒ Show (((Ticked ∷ Type → Type) :.: f) a) Source # | |
NoThunks (Ticked (f a)) ⇒ NoThunks (((Ticked ∷ Type → Type) :.: f) a) Source # | |
data Ticked () Source # | |
Defined in Ouroboros.Consensus.Ticked | |
data Ticked (HardForkChainDepState xs ∷ Type) Source # | |
data Ticked (HeaderState blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.HeaderValidation | |
data Ticked (PBftState c ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Protocol.PBFT | |
newtype Ticked (WrapChainDepState blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.TypeFamilyWrappers | |
type HeaderHash (Ticked l ∷ k) Source # | |
Defined in Ouroboros.Consensus.Ticked | |
type TxIn (Ticked l) Source # | |
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |
type TxOut (Ticked l) Source # | |
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |
data Ticked (LedgerState (HardForkBlock xs) ∷ MapKind → Type) (mk ∷ MapKind) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger data Ticked (LedgerState (HardForkBlock xs) ∷ MapKind → Type) (mk ∷ MapKind) = TickedHardForkLedgerState {} | |
data Ticked (LedgerState (DualBlock m a) ∷ MapKind → Type) (mk ∷ MapKind) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual data Ticked (LedgerState (DualBlock m a) ∷ MapKind → Type) (mk ∷ MapKind) = TickedDualLedgerState {} | |
data Ticked (ExtLedgerState blk ∷ MapKind → Type) (mk ∷ MapKind) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended data Ticked (ExtLedgerState blk ∷ MapKind → Type) (mk ∷ MapKind) = TickedExtLedgerState {
|
Low-level API (exported for the benefit of testing)
data AnnForecast (state ∷ Type → (Type → Type → Type) → Type) (view ∷ Type → Type) blk Source #
Forecast annotated with details about the ledger it was derived from
Constructors
AnnForecast | |
Fields
|
mkHardForkForecast ∷ ∀ (state ∷ Type → (Type → Type → Type) → Type) (view ∷ Type → Type) (xs ∷ [Type]). SListI xs ⇒ InPairs (CrossEraForecaster state view) xs → HardForkState (AnnForecast state view) xs → Forecast (HardForkLedgerView_ view xs) Source #
Change a telescope of a forecast into a forecast of a telescope
Ledger tables
ejectLedgerTables ∷ ∀ (xs ∷ [Type]) x (mk ∷ MapKind). (CanMapKeysMK mk, Ord (TxIn (LedgerState x)), HasCanonicalTxIn xs, CanMapMK mk, HasHardForkTxOut xs) ⇒ Index xs x → LedgerTables (LedgerState (HardForkBlock xs)) mk → LedgerTables (LedgerState x) mk Source #
injectLedgerTables ∷ ∀ (xs ∷ [Type]) x (mk ∷ MapKind). (CanMapKeysMK mk, CanMapMK mk, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ Index xs x → LedgerTables (LedgerState x) mk → LedgerTables (LedgerState (HardForkBlock xs)) mk Source #
HardForkTxIn
class (Show (CanonicalTxIn xs), Ord (CanonicalTxIn xs), NoThunks (CanonicalTxIn xs), MemPack (CanonicalTxIn xs)) ⇒ HasCanonicalTxIn (xs ∷ [Type]) where Source #
Canonical TxIn
The Ledger and Consensus team discussed the fact that we need to be able to
reach the TxIn key for an entry from any era, regardless of the era in which
it was created, therefore we need to have a "canonical" serialization that
doesn't change between eras. For now we are requiring that a HardForkBlock
has only one associated TxIn
type as a stop-gap, but Ledger will provide a
serialization function into something more efficient.
Associated Types
data CanonicalTxIn (xs ∷ [Type]) Source #
Methods
injectCanonicalTxIn ∷ Index xs x → TxIn (LedgerState x) → CanonicalTxIn xs Source #
Inject an era-specific TxIn
into a TxIn
for a HardForkBlock
.
ejectCanonicalTxIn ∷ Index xs x → CanonicalTxIn xs → TxIn (LedgerState x) Source #
Distribute a TxIn
for a HardForkBlock
to an era-specific TxIn
.
HardForkTxOut
type DefaultHardForkTxOut (xs ∷ [Type]) = NS WrapTxOut xs Source #
This choice for HardForkTxOut
imposes some complications on the code.
We deliberately chose not to have all values in the tables be
because this would require us to traverse
and translate the whole UTxO set on era boundaries. To avoid this, we are
holding a TxOut
era
instead.NS
WrapTxOut
xs
Whenever we are carrying a
(or
LedgerState
(HardForkBlock
xs) mkExtLedgerState
), the tables are the
ones inside the particular ledger state in the Telescope
of the
HardForkState
.
However, when we are carrying
we are
instead carrying these tables, where the LedgerTables
(HardForkBlock
xs) mkTxOut
is an NS
. This means that
whenever we are extracting these tables, we are effectively duplicating the
UTxO set (Map
) inside, to create an identical one where every
element has been translated to the most recent era and unwrapped from the
NS
.
To prevent memory explosion, try to only perform one of this transformations, for example:
- when applying blocks, inject the tables for the transactions only once, and extract them only once.
- when performing queries on the tables (that use
QFTraverseTables
), operate with the tables at the hard fork level until the very end, when you have to promote them to some specific era.
(image code)
>>>
:{
>>>
either (error . show) pure =<<
>>>
renderToFile "docs/haddocks/hard-fork-tables.svg" defaultEnv (tikz ["positioning", "arrows"]) "\\node at (4.5,4.8) {\\small{LedgerTables (LedgerState (HardForkBlock xs))}};\
>>>
\ \\draw (0,0) rectangle (9,5);\
>>>
\ \\node (rect) at (1.5,4) [draw,minimum width=1cm,minimum height=0.5cm] {TxIn};\
>>>
\ \\node (oneOf) at (3.5,4) [draw=none] {NS};\
>>>
\ \\draw (rect) -> (oneOf);\
>>>
\ \\node (sh) at (6.5,4) [draw,minimum width=1cm,minimum height=0.5cm] {BlockATxOut};\
>>>
\ \\node (al) at (6.5,3) [draw,minimum width=1cm,minimum height=0.5cm] {BlockBTxOut};\
>>>
\ \\node (my) at (6.5,2) [draw=none,minimum width=1cm,minimum height=0.5cm] {...};\
>>>
\ \\node (ba) at (6.5,1) [draw,minimum width=1cm,minimum height=0.5cm] {BlockNTxOut};\
>>>
\ \\draw (oneOf) -> (sh);\
>>>
\ \\draw (oneOf) -> (al);\
>>>
\ \\draw (oneOf) -> (ba);\
>>>
\ \\draw (3,0.5) rectangle (8,4.5);"
>>>
:}
>>>
:{
>>>
either (error . show) pure =<<
>>>
renderToFile "docs/haddocks/hard-fork-tables-per-block.svg" defaultEnv (tikz ["positioning", "arrows"]) "\\node at (5,4.8) {\\small{LedgerState (HardForkBlock xs)}};\
>>>
\ \\draw (0,0) rectangle (10,5);\
>>>
\ \\node (oneOf2) at (2,4) [draw=none] {HardForkState};\
>>>
\ \\node (bb) at (5,4) [draw,minimum width=1cm,minimum height=0.5cm] {BlockAState};\
>>>
\ \\node (bt) at (8,4) [draw,minimum width=1cm,minimum height=0.5cm] {BlockATables};\
>>>
\ \\node (sb) at (5,3) [draw,minimum width=1cm,minimum height=0.5cm] {BlockBState};\
>>>
\ \\node (st) at (8,3) [draw,minimum width=1cm,minimum height=0.5cm] {BlockBTables};\
>>>
\ \\node (db) at (5,2) [draw=none,minimum width=1cm,minimum height=0.5cm] {...};\
>>>
\ \\node (dt) at (8,2) [draw=none,minimum width=1cm,minimum height=0.5cm] {...};\
>>>
\ \\node (bab) at (5,1) [draw,minimum width=1cm,minimum height=0.5cm] {BlockNState};\
>>>
\ \\node (bat) at (8,1) [draw,minimum width=1cm,minimum height=0.5cm] {BlockNTables};\
>>>
\ \\draw (oneOf2) -> (bb);\
>>>
\ \\draw (bb) -> (bt);\
>>>
\ \\draw (oneOf2) -> (sb);\
>>>
\ \\draw (sb) -> (st);\
>>>
\ \\draw (oneOf2) -> (bab);\
>>>
\ \\draw (bab) -> (bat);"
>>>
:}
class (Show (HardForkTxOut xs), Eq (HardForkTxOut xs), NoThunks (HardForkTxOut xs), IndexedMemPack (LedgerState (HardForkBlock xs) EmptyMK) (HardForkTxOut xs), SerializeTablesWithHint (LedgerState (HardForkBlock xs))) ⇒ HasHardForkTxOut (xs ∷ [Type]) where Source #
Minimal complete definition
Associated Types
type HardForkTxOut (xs ∷ [Type]) Source #
type HardForkTxOut (xs ∷ [Type]) = DefaultHardForkTxOut xs
Methods
injectHardForkTxOut ∷ Index xs x → TxOut (LedgerState x) → HardForkTxOut xs Source #
ejectHardForkTxOut ∷ Index xs x → HardForkTxOut xs → TxOut (LedgerState x) Source #
txOutEjections ∷ NP ((K (NS WrapTxOut xs) ∷ Type → Type) -.-> WrapTxOut) xs Source #
This method is a null-arity method in a typeclass to make it a CAF, such
that we only compute it once, then it is cached for the duration of the
program, as we will use it very often when converting from the
HardForkBlock to the particular blk
.
This particular method is useful when our HardForkBlock uses DefaultHardForkTxOut, so that we can implement inject and project.
default txOutEjections ∷ CanHardFork xs ⇒ NP ((K (NS WrapTxOut xs) ∷ Type → Type) -.-> WrapTxOut) xs Source #
txOutTranslations ∷ Tails (Fn2 WrapTxOut) xs Source #
This method is a null-arity method in a typeclass to make it a CAF, such
that we only compute it once, then it is cached for the duration of the
program, as we will use it very often when converting from the
HardForkBlock to the particular blk
.
default txOutTranslations ∷ CanHardFork xs ⇒ Tails (Fn2 WrapTxOut) xs Source #
class MemPack (TxOut (LedgerState x)) ⇒ MemPackTxOut x Source #
Instances
MemPack (TxOut (LedgerState x)) ⇒ MemPackTxOut x Source # | |
ejectHardForkTxOutDefault ∷ ∀ (xs ∷ [Type]) x. (SListI xs, HasHardForkTxOut xs) ⇒ Index xs x → DefaultHardForkTxOut xs → TxOut (LedgerState x) Source #
injectHardForkTxOutDefault ∷ ∀ (xs ∷ [Type]) x. SListI xs ⇒ Index xs x → TxOut (LedgerState x) → DefaultHardForkTxOut xs Source #
Orphan instances
(All MemPackTxOut xs, Typeable xs) ⇒ MemPack (DefaultHardForkTxOut xs) Source # | |||||||||
Methods packedByteCount ∷ DefaultHardForkTxOut xs → Int Source # packM ∷ DefaultHardForkTxOut xs → Pack s () Source # unpackM ∷ Buffer b ⇒ Unpack b (DefaultHardForkTxOut xs) Source # | |||||||||
All SingleEraBlock xs ⇒ HasHardForkHistory (HardForkBlock xs) Source # | |||||||||
Associated Types
Methods hardForkSummary ∷ ∀ (mk ∷ MapKind). LedgerConfig (HardForkBlock xs) → LedgerState (HardForkBlock xs) mk → Summary (HardForkIndices (HardForkBlock xs)) Source # | |||||||||
CanHardFork xs ⇒ ValidateEnvelope (HardForkBlock xs) Source # | |||||||||
Associated Types
Methods additionalEnvelopeChecks ∷ TopLevelConfig (HardForkBlock xs) → LedgerView (BlockProtocol (HardForkBlock xs)) → Header (HardForkBlock xs) → Except (OtherHeaderEnvelopeError (HardForkBlock xs)) () Source # | |||||||||
(CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ UpdateLedger (HardForkBlock xs) Source # | |||||||||
CanHardFork xs ⇒ GetTip (LedgerState (HardForkBlock xs)) Source # | |||||||||
Methods getTip ∷ ∀ (mk ∷ MapKind). LedgerState (HardForkBlock xs) mk → Point (LedgerState (HardForkBlock xs)) Source # | |||||||||
CanHardFork xs ⇒ IsLedger (LedgerState (HardForkBlock xs)) Source # | |||||||||
Associated Types
Methods applyChainTickLedgerResult ∷ ComputeLedgerEvents → LedgerCfg (LedgerState (HardForkBlock xs)) → SlotNo → LedgerState (HardForkBlock xs) EmptyMK → LedgerResult (LedgerState (HardForkBlock xs)) (Ticked (LedgerState (HardForkBlock xs)) DiffMK) Source # | |||||||||
CanHardFork xs ⇒ InspectLedger (HardForkBlock xs) Source # | |||||||||
Associated Types
Methods inspectLedger ∷ ∀ (mk1 ∷ MapKind) (mk2 ∷ MapKind). TopLevelConfig (HardForkBlock xs) → LedgerState (HardForkBlock xs) mk1 → LedgerState (HardForkBlock xs) mk2 → [LedgerEvent (HardForkBlock xs)] Source # | |||||||||
(CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ LedgerSupportsProtocol (HardForkBlock xs) Source # | |||||||||
Methods protocolLedgerView ∷ ∀ (mk ∷ MapKind). LedgerConfig (HardForkBlock xs) → Ticked (LedgerState (HardForkBlock xs)) mk → LedgerView (BlockProtocol (HardForkBlock xs)) Source # ledgerViewForecastAt ∷ ∀ (mk ∷ MapKind). HasCallStack ⇒ LedgerConfig (HardForkBlock xs) → LedgerState (HardForkBlock xs) mk → Forecast (LedgerView (BlockProtocol (HardForkBlock xs))) Source # | |||||||||
All (Compose CanStowLedgerTables LedgerState) xs ⇒ CanStowLedgerTables (LedgerState (HardForkBlock xs)) Source # | |||||||||
Methods stowLedgerTables ∷ LedgerState (HardForkBlock xs) ValuesMK → LedgerState (HardForkBlock xs) EmptyMK Source # unstowLedgerTables ∷ LedgerState (HardForkBlock xs) EmptyMK → LedgerState (HardForkBlock xs) ValuesMK Source # | |||||||||
(CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ HasLedgerTables (LedgerState (HardForkBlock xs)) Source # | Warning: | ||||||||
Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ LedgerState (HardForkBlock xs) mk → LedgerTables (LedgerState (HardForkBlock xs)) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ LedgerState (HardForkBlock xs) any → LedgerTables (LedgerState (HardForkBlock xs)) mk → LedgerState (HardForkBlock xs) mk Source # | |||||||||
(CanHardFork xs, HasHardForkTxOut xs) ⇒ CanUpgradeLedgerTables (LedgerState (HardForkBlock xs)) Source # | |||||||||
Methods upgradeTables ∷ ∀ (mk1 ∷ MapKind) (mk2 ∷ MapKind). LedgerState (HardForkBlock xs) mk1 → LedgerState (HardForkBlock xs) mk2 → LedgerTables (LedgerState (HardForkBlock xs)) ValuesMK → LedgerTables (LedgerState (HardForkBlock xs)) ValuesMK Source # | |||||||||
(CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ ApplyBlock (LedgerState (HardForkBlock xs)) (HardForkBlock xs) Source # | |||||||||
Methods applyBlockLedgerResultWithValidation ∷ ValidationPolicy → ComputeLedgerEvents → LedgerCfg (LedgerState (HardForkBlock xs)) → HardForkBlock xs → Ticked (LedgerState (HardForkBlock xs)) ValuesMK → Except (LedgerErr (LedgerState (HardForkBlock xs))) (LedgerResult (LedgerState (HardForkBlock xs)) (LedgerState (HardForkBlock xs) DiffMK)) Source # applyBlockLedgerResult ∷ ComputeLedgerEvents → LedgerCfg (LedgerState (HardForkBlock xs)) → HardForkBlock xs → Ticked (LedgerState (HardForkBlock xs)) ValuesMK → Except (LedgerErr (LedgerState (HardForkBlock xs))) (LedgerResult (LedgerState (HardForkBlock xs)) (LedgerState (HardForkBlock xs) DiffMK)) Source # reapplyBlockLedgerResult ∷ ComputeLedgerEvents → LedgerCfg (LedgerState (HardForkBlock xs)) → HardForkBlock xs → Ticked (LedgerState (HardForkBlock xs)) ValuesMK → LedgerResult (LedgerState (HardForkBlock xs)) (LedgerState (HardForkBlock xs) DiffMK) Source # getBlockKeySets ∷ HardForkBlock xs → LedgerTables (LedgerState (HardForkBlock xs)) KeysMK Source # | |||||||||
CanHardFork xs ⇒ GetTip (Ticked (LedgerState (HardForkBlock xs))) Source # | |||||||||
Methods getTip ∷ ∀ (mk ∷ MapKind). Ticked (LedgerState (HardForkBlock xs)) mk → Point (Ticked (LedgerState (HardForkBlock xs))) Source # | |||||||||
(CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ HasLedgerTables (Ticked (LedgerState (HardForkBlock xs))) Source # | |||||||||
Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (HardForkBlock xs)) mk → LedgerTables (Ticked (LedgerState (HardForkBlock xs))) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (HardForkBlock xs)) any → LedgerTables (Ticked (LedgerState (HardForkBlock xs))) mk → Ticked (LedgerState (HardForkBlock xs)) mk Source # |