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

Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

Synopsis

Documentation

data family BlockQueryTypeQueryFootprintTypeType Source #

Different queries supported by the ledger, indexed by the result type.

Instances

Instances details
All SingleEraBlock xs ⇒ SameDepIndex2 (BlockQuery (HardForkBlock xs) ∷ QueryFootprintTypeType) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

Methods

sameDepIndex2 ∷ ∀ (x ∷ QueryFootprint) a (y ∷ QueryFootprint) b. BlockQuery (HardForkBlock xs) x a → BlockQuery (HardForkBlock xs) y b → Maybe ('(x, a) :~: '(y, b)) Source #

SameDepIndex2 (BlockQuery (DualBlock m a) ∷ QueryFootprintTypeType) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

sameDepIndex2 ∷ ∀ (x ∷ QueryFootprint) a0 (y ∷ QueryFootprint) b. BlockQuery (DualBlock m a) x a0 → BlockQuery (DualBlock m a) y b → Maybe ('(x, a0) :~: '(y, b)) Source #

SerialiseHFC xs ⇒ SerialiseBlockQueryResult (HardForkBlock xs) BlockQuery Source # 
Instance details

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

(∀ (footprint ∷ QueryFootprint) result. Show (BlockQuery blk footprint result)) ⇒ Show (SomeBlockQuery (BlockQuery blk)) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (SomeBlockQuery (BlockQuery (HardForkBlock xs))) Source # 
Instance details

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

All SingleEraBlock xs ⇒ ShowQuery (BlockQuery (HardForkBlock xs) footprint) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

Methods

showResultBlockQuery (HardForkBlock xs) footprint result → result → String Source #

ShowQuery (BlockQuery (DualBlock m a) footprint) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

showResultBlockQuery (DualBlock m a) footprint result → result → String Source #

Typeable xs ⇒ ShowProxy (BlockQuery (HardForkBlock xs) ∷ QueryFootprintTypeType) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

(Typeable m, Typeable a) ⇒ ShowProxy (BlockQuery (DualBlock m a) ∷ QueryFootprintTypeType) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

All SingleEraBlock xs ⇒ Show (BlockQuery (HardForkBlock xs) footprint result) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

Methods

showsPrecIntBlockQuery (HardForkBlock xs) footprint result → ShowS #

showBlockQuery (HardForkBlock xs) footprint result → String #

showList ∷ [BlockQuery (HardForkBlock xs) footprint result] → ShowS #

Show (BlockQuery (DualBlock m a) footprint result) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

showsPrecIntBlockQuery (DualBlock m a) footprint result → ShowS #

showBlockQuery (DualBlock m a) footprint result → String #

showList ∷ [BlockQuery (DualBlock m a) footprint result] → ShowS #

Inject (SomeBlockQuery :.: BlockQuery) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

data BlockQuery (HardForkBlock xs) footprint result Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

data BlockQuery (HardForkBlock xs) footprint result where
data BlockQuery (DualBlock m a) footprint result Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

data BlockQuery (DualBlock m a) footprint result

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 #

queryLedgerGetTraversingFilterIndex 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 QueryHardFork (xs ∷ [Type]) result where Source #

Constructors

GetInterpreter ∷ ∀ (xs ∷ [Type]). QueryHardFork xs (Interpreter xs) 
GetCurrentEra ∷ ∀ (xs ∷ [Type]). QueryHardFork xs (EraIndex xs) 

Instances

Instances details
SameDepIndex (QueryHardFork xs ∷ TypeType) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

Methods

sameDepIndexQueryHardFork xs a → QueryHardFork xs b → Maybe (a :~: b) Source #

All SingleEraBlock xs ⇒ ShowQuery (QueryHardFork xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

Methods

showResultQueryHardFork xs result → result → String Source #

Show (QueryHardFork xs result) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

Methods

showsPrecIntQueryHardFork xs result → ShowS #

showQueryHardFork 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

Instances details
All SingleEraBlock xs ⇒ SameDepIndex2 (QueryIfCurrent xs ∷ QueryFootprintTypeType) Source # 
Instance details

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 # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

Methods

showResultQueryIfCurrent xs footprint result → result → String Source #

All SingleEraBlock xs ⇒ Show (QueryIfCurrent xs footprint result) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query

Methods

showsPrecIntQueryIfCurrent xs footprint result → ShowS #

showQueryIfCurrent xs footprint result → String #

showList ∷ [QueryIfCurrent xs footprint result] → ShowS #

decodeQueryAnytimeResultQueryAnytime result → ∀ s. Decoder s result Source #

decodeQueryHardForkResult ∷ ∀ (xs ∷ [Type]) result. SListI xs ⇒ QueryHardFork xs result → ∀ s. Decoder s result 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 #

Orphan instances

All SingleEraBlock xs ⇒ SameDepIndex2 (BlockQuery (HardForkBlock xs) ∷ QueryFootprintTypeType) Source # 
Instance details

Methods

sameDepIndex2 ∷ ∀ (x ∷ QueryFootprint) a (y ∷ QueryFootprint) b. BlockQuery (HardForkBlock xs) x a → BlockQuery (HardForkBlock xs) y b → Maybe ('(x, a) :~: '(y, b)) Source #

(All SingleEraBlock xs, BlockSupportsHFLedgerQuery xs, All BlockSupportsLedgerQuery xs, CanHardFork xs) ⇒ BlockSupportsLedgerQuery (HardForkBlock xs) Source # 
Instance details

All SingleEraBlock xs ⇒ ShowQuery (BlockQuery (HardForkBlock xs) footprint) Source # 
Instance details

Methods

showResultBlockQuery (HardForkBlock xs) footprint result → result → String Source #

Typeable xs ⇒ ShowProxy (BlockQuery (HardForkBlock xs) ∷ QueryFootprintTypeType) Source # 
Instance details

All SingleEraBlock xs ⇒ Show (BlockQuery (HardForkBlock xs) footprint result) Source # 
Instance details

Methods

showsPrecIntBlockQuery (HardForkBlock xs) footprint result → ShowS #

showBlockQuery (HardForkBlock xs) footprint result → String #

showList ∷ [BlockQuery (HardForkBlock xs) footprint result] → ShowS #