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

Ouroboros.Consensus.Ledger.Query

Synopsis

Documentation

data family BlockQuery blk ∷ TypeType Source #

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

Instances

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

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

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

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

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

Methods

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

SameDepIndex (BlockQuery (DualBlock m a)) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

sameDepIndexBlockQuery (DualBlock m a) a0 → BlockQuery (DualBlock m a) b → Maybe (a0 :~: b) Source #

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

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

Inject (SomeSecond BlockQuery) Source # 
Instance details

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

Methods

inject ∷ ∀ x (xs ∷ [Type]). CanHardFork xs ⇒ Exactly xs BoundIndex xs x → SomeSecond BlockQuery x → SomeSecond BlockQuery (HardForkBlock xs) Source #

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

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

Methods

encodeResultCodecConfig (HardForkBlock xs) → BlockNodeToClientVersion (HardForkBlock xs) → BlockQuery (HardForkBlock xs) result → result → Encoding Source #

decodeResultCodecConfig (HardForkBlock xs) → BlockNodeToClientVersion (HardForkBlock xs) → BlockQuery (HardForkBlock xs) result → ∀ s. Decoder s result Source #

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

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

SameDepIndex (BlockQuery blk) ⇒ Eq (SomeSecond BlockQuery blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

(∀ result. Show (BlockQuery blk result)) ⇒ Show (SomeSecond BlockQuery blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

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

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

showsPrecIntBlockQuery (DualBlock m a) result → ShowS Source #

showBlockQuery (DualBlock m a) result → String Source #

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

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

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

Methods

showsPrecIntBlockQuery (HardForkBlock xs) result → ShowS Source #

showBlockQuery (HardForkBlock xs) result → String Source #

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

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

Defined in Ouroboros.Consensus.Ledger.Dual

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

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

data BlockQuery (HardForkBlock xs) a Source # 
Instance details

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

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

Defined in Ouroboros.Consensus.Ledger.Dual

data BlockQuery (DualBlock m a) result

data Query blk result where Source #

Different queries supported by the ledger for all block types, indexed by the result type.

Additions to the set of queries is versioned by QueryVersion

Constructors

BlockQueryBlockQuery blk result → Query blk result

This constructor is supported by all QueryVersions. The BlockQuery argument is versioned by the BlockNodeToClientVersion blk.

GetSystemStartQuery blk SystemStart

Get the SystemStart time.

Supported by QueryVersion >= QueryVersion1.

GetChainBlockNoQuery blk (WithOrigin BlockNo)

Get the GetChainBlockNo time.

Supported by QueryVersion >= QueryVersion2.

GetChainPointQuery blk (Point blk)

Get the GetChainPoint time.

Supported by QueryVersion >= QueryVersion2.

Instances

Instances details
(SerialiseResult blk (BlockQuery blk), Serialise (HeaderHash blk)) ⇒ SerialiseResult blk (Query blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Methods

encodeResultCodecConfig blk → BlockNodeToClientVersion blk → Query blk result → result → Encoding Source #

decodeResultCodecConfig blk → BlockNodeToClientVersion blk → Query blk result → ∀ s. Decoder s result Source #

(ShowQuery (BlockQuery blk), StandardHash blk) ⇒ ShowQuery (Query blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Methods

showResultQuery blk result → result → String Source #

SameDepIndex (BlockQuery blk) ⇒ SameDepIndex (Query blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Methods

sameDepIndexQuery blk a → Query blk b → Maybe (a :~: b) Source #

Eq (SomeSecond BlockQuery blk) ⇒ Eq (SomeSecond Query blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Methods

(==)SomeSecond Query blk → SomeSecond Query blk → Bool Source #

(/=)SomeSecond Query blk → SomeSecond Query blk → Bool Source #

Show (SomeSecond BlockQuery blk) ⇒ Show (SomeSecond Query blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Show (BlockQuery blk result) ⇒ Show (Query blk result) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Methods

showsPrecIntQuery blk result → ShowS Source #

showQuery blk result → String Source #

showList ∷ [Query blk result] → ShowS Source #

ShowProxy (BlockQuery blk) ⇒ ShowProxy (Query blk ∷ TypeType) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Methods

showProxyProxy (Query blk) → String Source #

class (ShowQuery (BlockQuery blk), SameDepIndex (BlockQuery blk)) ⇒ QueryLedger blk where Source #

Query the ledger extended state.

Used by the LocalStateQuery protocol to allow clients to query the extended ledger state.

Methods

answerBlockQueryExtLedgerCfg blk → BlockQuery blk result → ExtLedgerState blk → result Source #

Answer the given query about the extended ledger state.

Instances

Instances details
All SingleEraBlock xs ⇒ QueryLedger (HardForkBlock xs) Source # 
Instance details

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

Bridge m a ⇒ QueryLedger (DualBlock m a) Source #

Not used in the tests: no constructors

Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

answerBlockQueryExtLedgerCfg (DualBlock m a) → BlockQuery (DualBlock m a) result → ExtLedgerState (DualBlock m a) → result Source #

data QueryVersion Source #

Version of the `Query blk` type.

Multiple top level queries are now supported. The encoding now has constructor tags for the different top level queries for QueryVersion1 onwards.

Instances

Instances details
Bounded QueryVersion Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query.Version

Enum QueryVersion Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query.Version

Eq QueryVersion Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query.Version

Ord QueryVersion Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query.Version

Show QueryVersion Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query.Version

class (∀ result. Show (query result)) ⇒ ShowQuery (query ∷ TypeType) where Source #

To implement Show for:

('Message' ('LocalStateQuery' block query) st st')

we need a way to print the query GADT and its type index, result. This class contain the method we need to provide this Show instance.

We use a type class for this, as this Show constraint propagates to a lot of places.

Methods

showResult ∷ query result → result → String Source #

Instances

Instances details
ShowQuery QueryAnytime Source # 
Instance details

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

Methods

showResultQueryAnytime result → result → String Source #

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

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

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

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

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

Methods

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

(ShowQuery (BlockQuery blk), StandardHash blk) ⇒ ShowQuery (Query blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Methods

showResultQuery blk result → result → String 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 #

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

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

Methods

showResultQueryIfCurrent xs result → result → String Source #

answerQuery ∷ (QueryLedger blk, ConfigSupportsNode blk, HasAnnTip blk) ⇒ ExtLedgerCfg blk → Query blk result → ExtLedgerState blk → result Source #

Answer the given query about the extended ledger state.

nodeToClientVersionToQueryVersionNodeToClientVersionQueryVersion Source #

Get the QueryVersion supported by this NodeToClientVersion.