Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.Ledger.Query
Contents
Synopsis
- data family BlockQuery ∷ Type → QueryFootprint → Type → Type
- class (All (Compose NoThunks WrapTxOut) xs, All (Compose Show WrapTxOut) xs, All (Compose Eq WrapTxOut) xs, All (Compose HasTickedLedgerTables LedgerState) xs, All (Compose HasLedgerTables LedgerState) xs) ⇒ BlockSupportsHFLedgerQuery (xs ∷ [Type]) where
- answerBlockQueryHFLookup ∷ (All SingleEraBlock xs, Monad m) ⇒ Index xs x → ExtLedgerCfg x → BlockQuery x 'QFLookupTables result → ReadOnlyForker' m (HardForkBlock xs) → m result
- answerBlockQueryHFTraverse ∷ (All SingleEraBlock xs, Monad m) ⇒ Index xs x → ExtLedgerCfg x → BlockQuery x 'QFTraverseTables result → ReadOnlyForker' m (HardForkBlock xs) → m result
- queryLedgerGetTraversingFilter ∷ Index xs x → BlockQuery x 'QFTraverseTables result → TxOut (LedgerState (HardForkBlock xs)) → Bool
- data HardForkNodeToClientVersion (xs ∷ [Type]) where
- HardForkNodeToClientDisabled ∷ ∀ x (xs1 ∷ [Type]). BlockNodeToClientVersion x → HardForkNodeToClientVersion (x ': xs1)
- HardForkNodeToClientEnabled ∷ ∀ (xs ∷ [Type]). HardForkSpecificNodeToClientVersion → NP EraNodeToClientVersion xs → HardForkNodeToClientVersion xs
- type HardForkQueryResult (xs ∷ [Type]) = Either (MismatchEraInfo xs)
- data QueryAnytime result where
- data QueryHardFork (xs ∷ [Type]) result where
- GetInterpreter ∷ ∀ (xs ∷ [Type]). QueryHardFork xs (Interpreter xs)
- GetCurrentEra ∷ ∀ (xs ∷ [Type]). QueryHardFork xs (EraIndex xs)
- data QueryIfCurrent (xs ∷ [Type]) (footprint ∷ QueryFootprint) result where
- QZ ∷ ∀ x (footprint ∷ QueryFootprint) result (xs1 ∷ [Type]). BlockQuery x footprint result → QueryIfCurrent (x ': xs1) footprint result
- QS ∷ ∀ (xs1 ∷ [Type]) (footprint ∷ QueryFootprint) result x. QueryIfCurrent xs1 footprint result → QueryIfCurrent (x ': xs1) footprint result
- decodeQueryAnytimeResult ∷ QueryAnytime result → ∀ s. Decoder s result
- decodeQueryHardForkResult ∷ ∀ (xs ∷ [Type]) result. SListI xs ⇒ QueryHardFork xs result → ∀ s. Decoder s result
- encodeQueryAnytimeResult ∷ QueryAnytime result → result → Encoding
- encodeQueryHardForkResult ∷ ∀ (xs ∷ [Type]) result. SListI xs ⇒ QueryHardFork xs result → result → Encoding
- getHardForkQuery ∷ ∀ (xs ∷ [Type]) (footprint ∷ QueryFootprint) result r. BlockQuery (HardForkBlock xs) footprint result → (∀ result'. (result :~: HardForkQueryResult xs result') → QueryIfCurrent xs footprint result' → r) → (∀ x' (xs' ∷ [Type]). (xs :~: (x' ': xs')) → ProofNonEmpty xs' → QueryAnytime result → EraIndex xs → r) → (∀ x' (xs' ∷ [Type]). (xs :~: (x' ': xs')) → ProofNonEmpty xs' → QueryHardFork xs result → r) → r
- hardForkQueryInfo ∷ ∀ (xs ∷ [Type]) (footprint ∷ QueryFootprint) result. All SingleEraBlock xs ⇒ QueryIfCurrent xs footprint result → NS SingleEraInfo xs
Documentation
data family BlockQuery ∷ Type → QueryFootprint → Type → Type Source #
Different queries supported by the ledger, indexed by the result type.
Instances
class (All (Compose NoThunks WrapTxOut) xs, All (Compose Show WrapTxOut) xs, All (Compose Eq WrapTxOut) xs, All (Compose HasTickedLedgerTables LedgerState) xs, All (Compose HasLedgerTables LedgerState) xs) ⇒ BlockSupportsHFLedgerQuery (xs ∷ [Type]) where Source #
Queries that use ledger tables usually can be implemented faster if we work
with the hard fork tables rather than projecting everything to the
appropriate era before we process the query. This class should be used to
implement how these queries that have a footprint which is not QFNoTables
are answered.
Methods
answerBlockQueryHFLookup ∷ (All SingleEraBlock xs, Monad m) ⇒ Index xs x → ExtLedgerCfg x → BlockQuery x 'QFLookupTables result → ReadOnlyForker' m (HardForkBlock xs) → m result Source #
answerBlockQueryHFTraverse ∷ (All SingleEraBlock xs, Monad m) ⇒ Index xs x → ExtLedgerCfg x → BlockQuery x 'QFTraverseTables result → ReadOnlyForker' m (HardForkBlock xs) → m result Source #
queryLedgerGetTraversingFilter ∷ Index xs x → BlockQuery x 'QFTraverseTables result → TxOut (LedgerState (HardForkBlock xs)) → Bool Source #
The QFTraverseTables
queries consist of some filter on the TxOut
. This class
provides that filter so that answerBlockQueryHFAll
can be implemented
in an abstract manner depending on this function.
data HardForkNodeToClientVersion (xs ∷ [Type]) where Source #
Constructors
HardForkNodeToClientDisabled ∷ ∀ x (xs1 ∷ [Type]). BlockNodeToClientVersion x → HardForkNodeToClientVersion (x ': xs1) | Disable the HFC |
HardForkNodeToClientEnabled ∷ ∀ (xs ∷ [Type]). HardForkSpecificNodeToClientVersion → NP EraNodeToClientVersion xs → HardForkNodeToClientVersion xs | Enable the HFC |
Instances
(All HasNetworkProtocolVersion xs, All (Compose Show EraNodeToClientVersion) xs) ⇒ Show (HardForkNodeToClientVersion xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.NetworkVersion Methods showsPrec ∷ Int → HardForkNodeToClientVersion xs → ShowS # show ∷ HardForkNodeToClientVersion xs → String # showList ∷ [HardForkNodeToClientVersion xs] → ShowS # | |
(All HasNetworkProtocolVersion xs, All (Compose Eq EraNodeToClientVersion) xs) ⇒ Eq (HardForkNodeToClientVersion xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.NetworkVersion Methods (==) ∷ HardForkNodeToClientVersion xs → HardForkNodeToClientVersion xs → Bool # (/=) ∷ HardForkNodeToClientVersion xs → HardForkNodeToClientVersion xs → Bool # |
type HardForkQueryResult (xs ∷ [Type]) = Either (MismatchEraInfo xs) Source #
data QueryAnytime result where Source #
Constructors
GetEraStart ∷ QueryAnytime (Maybe Bound) |
Instances
ShowQuery QueryAnytime Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showResult ∷ QueryAnytime result → result → String Source # | |
SameDepIndex QueryAnytime Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods sameDepIndex ∷ QueryAnytime a → QueryAnytime b → Maybe (a :~: b) Source # | |
Show (QueryAnytime result) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showsPrec ∷ Int → QueryAnytime result → ShowS # show ∷ QueryAnytime result → String # showList ∷ [QueryAnytime result] → ShowS # | |
Serialise (Some QueryAnytime) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods encode ∷ Some QueryAnytime → Encoding Source # decode ∷ Decoder s (Some QueryAnytime) Source # encodeList ∷ [Some QueryAnytime] → Encoding Source # decodeList ∷ Decoder s [Some QueryAnytime] Source # |
data QueryHardFork (xs ∷ [Type]) result where Source #
Constructors
GetInterpreter ∷ ∀ (xs ∷ [Type]). QueryHardFork xs (Interpreter xs) | |
GetCurrentEra ∷ ∀ (xs ∷ [Type]). QueryHardFork xs (EraIndex xs) |
Instances
SameDepIndex (QueryHardFork xs ∷ Type → Type) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods sameDepIndex ∷ QueryHardFork xs a → QueryHardFork xs b → Maybe (a :~: b) Source # | |
All SingleEraBlock xs ⇒ ShowQuery (QueryHardFork xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showResult ∷ QueryHardFork xs result → result → String Source # | |
Show (QueryHardFork xs result) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showsPrec ∷ Int → QueryHardFork xs result → ShowS # show ∷ QueryHardFork xs result → String # showList ∷ [QueryHardFork xs result] → ShowS # |
data QueryIfCurrent (xs ∷ [Type]) (footprint ∷ QueryFootprint) result where Source #
Constructors
QZ ∷ ∀ x (footprint ∷ QueryFootprint) result (xs1 ∷ [Type]). BlockQuery x footprint result → QueryIfCurrent (x ': xs1) footprint result | |
QS ∷ ∀ (xs1 ∷ [Type]) (footprint ∷ QueryFootprint) result x. QueryIfCurrent xs1 footprint result → QueryIfCurrent (x ': xs1) footprint result |
Instances
All SingleEraBlock xs ⇒ SameDepIndex2 (QueryIfCurrent xs ∷ QueryFootprint → Type → Type) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods sameDepIndex2 ∷ ∀ (x ∷ QueryFootprint) a (y ∷ QueryFootprint) b. QueryIfCurrent xs x a → QueryIfCurrent xs y b → Maybe ('(x, a) :~: '(y, b)) Source # | |
All SingleEraBlock xs ⇒ ShowQuery (QueryIfCurrent xs footprint) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showResult ∷ QueryIfCurrent xs footprint result → result → String Source # | |
All SingleEraBlock xs ⇒ Show (QueryIfCurrent xs footprint result) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query Methods showsPrec ∷ Int → QueryIfCurrent xs footprint result → ShowS # show ∷ QueryIfCurrent xs footprint result → String # showList ∷ [QueryIfCurrent xs footprint result] → ShowS # |
decodeQueryAnytimeResult ∷ QueryAnytime result → ∀ s. Decoder s result Source #
decodeQueryHardForkResult ∷ ∀ (xs ∷ [Type]) result. SListI xs ⇒ QueryHardFork xs result → ∀ s. Decoder s result Source #
encodeQueryAnytimeResult ∷ QueryAnytime result → result → Encoding Source #
encodeQueryHardForkResult ∷ ∀ (xs ∷ [Type]) result. SListI xs ⇒ QueryHardFork xs result → result → Encoding Source #
getHardForkQuery ∷ ∀ (xs ∷ [Type]) (footprint ∷ QueryFootprint) result r. BlockQuery (HardForkBlock xs) footprint result → (∀ result'. (result :~: HardForkQueryResult xs result') → QueryIfCurrent xs footprint result' → r) → (∀ x' (xs' ∷ [Type]). (xs :~: (x' ': xs')) → ProofNonEmpty xs' → QueryAnytime result → EraIndex xs → r) → (∀ x' (xs' ∷ [Type]). (xs :~: (x' ': xs')) → ProofNonEmpty xs' → QueryHardFork xs result → r) → r Source #
hardForkQueryInfo ∷ ∀ (xs ∷ [Type]) (footprint ∷ QueryFootprint) result. All SingleEraBlock xs ⇒ QueryIfCurrent xs footprint result → NS SingleEraInfo xs Source #