ouroboros-consensus-0.1.0.1: Consensus layer for the Ouroboros blockchain protocol
Safe Haskell None
Language Haskell2010

Ouroboros.Consensus.Ledger.Query

Synopsis

Documentation

data family BlockQuery blk :: Type -> Type 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

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

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

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

Defined in Ouroboros.Consensus.Ledger.Dual

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

SerialiseHFC xs => SerialiseResult ( HardForkBlock xs) ( BlockQuery ( HardForkBlock xs)) Source #
Instance details

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

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

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

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

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

( Typeable m, Typeable a) => ShowProxy ( BlockQuery ( DualBlock m a) :: Type -> Type ) Source #
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Typeable xs => ShowProxy ( BlockQuery ( HardForkBlock xs) :: Type -> Type ) 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

BlockQuery :: BlockQuery blk result -> Query blk result

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

GetSystemStart :: Query blk SystemStart

Get the SystemStart time.

Supported by QueryVersion >= QueryVersion1 .

GetChainBlockNo :: Query blk ( WithOrigin BlockNo )

Get the GetChainBlockNo time.

Supported by QueryVersion >= QueryVersion2 .

GetChainPoint :: Query 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

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

Defined in Ouroboros.Consensus.Ledger.Query

Methods

showResult :: Query blk result -> result -> String Source #

SameDepIndex ( BlockQuery blk) => SameDepIndex ( Query blk) Source #
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Eq ( SomeSecond BlockQuery blk) => Eq ( SomeSecond Query blk) Source #
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

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

ShowProxy ( BlockQuery blk) => ShowProxy ( Query blk :: Type -> Type ) Source #
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

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

answerBlockQuery :: ExtLedgerCfg blk -> BlockQuery blk result -> ExtLedgerState blk -> result Source #

Answer the given query about the extended ledger state.

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 ( forall result. Show (query result)) => ShowQuery (query :: Type -> Type ) 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 #

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.

nodeToClientVersionToQueryVersion :: NodeToClientVersion -> QueryVersion Source #

Get the QueryVersion supported by this NodeToClientVersion .