ouroboros-consensus:cardano
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Shelley.Ledger.Query

Synopsis

Documentation

data family BlockQuery ∷ Type → QueryFootprint → Type → Type Source #

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

Instances

Instances details
SerialiseBlockQueryResult ByronBlock BlockQuery Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

All SingleEraBlock xs ⇒ SameDepIndex2 (BlockQuery (HardForkBlock xs) ∷ QueryFootprint → Type → Type) 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) ∷ QueryFootprint → Type → Type) 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 #

SameDepIndex2 (BlockQuery ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Methods

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

SameDepIndex2 (BlockQuery (ShelleyBlock proto era) ∷ QueryFootprint → Type → Type) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Query

Methods

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

SerialiseNodeToClient ByronBlock (SomeBlockQuery (BlockQuery ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

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

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

ShelleyCompatible proto era ⇒ SerialiseBlockQueryResult (ShelleyBlock proto era) BlockQuery Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Node.Serialisation

Methods

encodeBlockQueryResult ∷ ∀ (fp ∷ QueryFootprint) result. CodecConfig (ShelleyBlock proto era) → BlockNodeToClientVersion (ShelleyBlock proto era) → BlockQuery (ShelleyBlock proto era) fp result → result → Encoding Source #

decodeBlockQueryResult ∷ ∀ (fp ∷ QueryFootprint) result. CodecConfig (ShelleyBlock proto era) → BlockNodeToClientVersion (ShelleyBlock proto era) → BlockQuery (ShelleyBlock proto era) fp result → ∀ s. Decoder s result Source #

(∀ (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

showResult ∷ BlockQuery (HardForkBlock xs) footprint result → result → String #

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

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

showResult ∷ BlockQuery (DualBlock m a) footprint result → result → String #

ShowQuery (BlockQuery ByronBlock fp) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Methods

showResult ∷ BlockQuery ByronBlock fp result → result → String #

ShelleyCompatible proto era ⇒ ShowQuery (BlockQuery (ShelleyBlock proto era) fp) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Query

Methods

showResult ∷ BlockQuery (ShelleyBlock proto era) fp result → result → String #

(ShelleyCompatible proto era, LedgerSupportsProtocol (ShelleyBlock proto era), ConfigSupportsNode (ShelleyBlock proto era)) ⇒ SerialiseNodeToClient (ShelleyBlock proto era) (SomeBlockQuery (BlockQuery (ShelleyBlock proto era))) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Node.Serialisation

Typeable xs ⇒ ShowProxy (BlockQuery (HardForkBlock xs) ∷ QueryFootprint → Type → Type) Source # 
Instance details

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

(Typeable m, Typeable a) ⇒ ShowProxy (BlockQuery (DualBlock m a) ∷ QueryFootprint → Type → Type) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

showProxy ∷ Proxy (BlockQuery (DualBlock m a)) → String #

ShowProxy (BlockQuery ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

(Typeable era, Typeable proto) ⇒ ShowProxy (BlockQuery (ShelleyBlock proto era) ∷ QueryFootprint → Type → Type) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Query

Methods

showProxy ∷ Proxy (BlockQuery (ShelleyBlock proto era)) → String #

Eq (BlockQuery ByronBlock fp result) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Methods

(==) ∷ BlockQuery ByronBlock fp result → BlockQuery ByronBlock fp result → Bool #

(/=) ∷ BlockQuery ByronBlock fp result → BlockQuery ByronBlock fp result → Bool #

Eq (BlockQuery (ShelleyBlock proto era) fp result) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Query

Methods

(==) ∷ BlockQuery (ShelleyBlock proto era) fp result → BlockQuery (ShelleyBlock proto era) fp result → Bool #

(/=) ∷ BlockQuery (ShelleyBlock proto era) fp result → BlockQuery (ShelleyBlock proto era) fp result → Bool #

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

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

Methods

showsPrec ∷ Int → BlockQuery (HardForkBlock xs) footprint result → ShowS #

show ∷ BlockQuery (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

showsPrec ∷ Int → BlockQuery (DualBlock m a) footprint result → ShowS #

show ∷ BlockQuery (DualBlock m a) footprint result → String #

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

Show (BlockQuery ByronBlock fp result) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Methods

showsPrec ∷ Int → BlockQuery ByronBlock fp result → ShowS #

show ∷ BlockQuery ByronBlock fp result → String #

showList ∷ [BlockQuery ByronBlock fp result] → ShowS #

Show (BlockQuery (ShelleyBlock proto era) fp result) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Query

Methods

showsPrec ∷ Int → BlockQuery (ShelleyBlock proto era) fp result → ShowS #

show ∷ BlockQuery (ShelleyBlock proto era) fp result → String #

showList ∷ [BlockQuery (ShelleyBlock proto era) fp result] → ShowS #

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

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

data BlockQuery ByronBlock fp result Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

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
data BlockQuery (ShelleyBlock proto era) fp result Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Query

data BlockQuery (ShelleyBlock proto era) fp result where

Serialisation

decodeShelleyResult ∷ ∀ proto era (fp ∷ QueryFootprint) result. ShelleyCompatible proto era ⇒ ShelleyNodeToClientVersion → BlockQuery (ShelleyBlock proto era) fp result → ∀ s. Decoder s result Source #

encodeShelleyQuery ∷ ∀ era proto (fp ∷ QueryFootprint) result. ShelleyBasedEra era ⇒ BlockQuery (ShelleyBlock proto era) fp result → Encoding Source #

encodeShelleyResult ∷ ∀ proto era (fp ∷ QueryFootprint) result. ShelleyCompatible proto era ⇒ ShelleyNodeToClientVersion → BlockQuery (ShelleyBlock proto era) fp result → result → Encoding Source #

BlockSupportsHFLedgerQuery instances

answerShelleyLookupQueries Source #

Arguments

∷ ∀ proto era m result blk. (Monad m, ShelleyCompatible proto era) 
⇒ (LedgerTables (ShelleyBlock proto era) KeysMK → LedgerTables blk KeysMK)

Inject ledger tables

→ (TxOut blk → TxOut era)

Eject TxOut

→ (TxIn blk → TxIn)

Eject TxIn

→ ExtLedgerCfg (ShelleyBlock proto era) 
→ BlockQuery (ShelleyBlock proto era) 'QFLookupTables result 
→ ReadOnlyForker' m blk 
→ m result 

answerShelleyTraversingQueries Source #

Arguments

∷ ∀ proto era m result blk. (ShelleyCompatible proto era, Ord (TxIn blk), Eq (TxOut blk), MemPack (TxIn blk), IndexedMemPack LedgerState blk (TxOut blk), Monad m) 
⇒ (TxOut blk → TxOut era)

Eject TxOut

→ (TxIn blk → TxIn)

Eject TxIn

→ (∀ result'. BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result' → TxOut blk → Bool)

Get filter by query

→ ExtLedgerCfg (ShelleyBlock proto era) 
→ BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result 
→ ReadOnlyForker' m blk 
→ m result 

shelleyQFTraverseTablesPredicate ∷ ∀ proto era proto' era' result. (ShelleyBasedEra era, ShelleyBasedEra era') ⇒ BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result → TxOut (ShelleyBlock proto' era') → Bool Source #

Orphan instances

SameDepIndex2 (BlockQuery (ShelleyBlock proto era) ∷ QueryFootprint → Type → Type) Source # 
Instance details

Methods

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

(ShelleyCompatible proto era, LedgerSupportsProtocol (ShelleyBlock proto era), ConfigSupportsNode (ShelleyBlock proto era), ProtoCrypto proto ~ crypto, Crypto crypto) ⇒ BlockSupportsLedgerQuery (ShelleyBlock proto era) Source # 
Instance details

Methods

answerPureBlockQuery ∷ ExtLedgerCfg (ShelleyBlock proto era) → BlockQuery (ShelleyBlock proto era) 'QFNoTables result → ExtLedgerState (ShelleyBlock proto era) EmptyMK → result Source #

answerBlockQueryLookup ∷ MonadSTM m ⇒ ExtLedgerCfg (ShelleyBlock proto era) → BlockQuery (ShelleyBlock proto era) 'QFLookupTables result → ReadOnlyForker' m (ShelleyBlock proto era) → m result Source #

answerBlockQueryTraverse ∷ MonadSTM m ⇒ ExtLedgerCfg (ShelleyBlock proto era) → BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result → ReadOnlyForker' m (ShelleyBlock proto era) → m result Source #

blockQueryIsSupportedOnVersion ∷ ∀ (fp ∷ QueryFootprint) result. BlockQuery (ShelleyBlock proto era) fp result → BlockNodeToClientVersion (ShelleyBlock proto era) → Bool Source #

ShelleyCompatible proto era ⇒ ShowQuery (BlockQuery (ShelleyBlock proto era) fp) Source # 
Instance details

Methods

showResult ∷ BlockQuery (ShelleyBlock proto era) fp result → result → String #

(Typeable era, Typeable proto) ⇒ ShowProxy (BlockQuery (ShelleyBlock proto era) ∷ QueryFootprint → Type → Type) Source # 
Instance details

Methods

showProxy ∷ Proxy (BlockQuery (ShelleyBlock proto era)) → String #

Eq (BlockQuery (ShelleyBlock proto era) fp result) Source # 
Instance details

Methods

(==) ∷ BlockQuery (ShelleyBlock proto era) fp result → BlockQuery (ShelleyBlock proto era) fp result → Bool #

(/=) ∷ BlockQuery (ShelleyBlock proto era) fp result → BlockQuery (ShelleyBlock proto era) fp result → Bool #

Show (BlockQuery (ShelleyBlock proto era) fp result) Source # 
Instance details

Methods

showsPrec ∷ Int → BlockQuery (ShelleyBlock proto era) fp result → ShowS #

show ∷ BlockQuery (ShelleyBlock proto era) fp result → String #

showList ∷ [BlockQuery (ShelleyBlock proto era) fp result] → ShowS #