Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data family BlockQuery blk :: Type -> Type
-
class
ConfigSupportsNode
blk
where
- getSystemStart :: BlockConfig blk -> SystemStart
- getNetworkMagic :: BlockConfig blk -> NetworkMagic
-
data
Query
blk result
where
- BlockQuery :: BlockQuery blk result -> Query blk result
- GetSystemStart :: Query blk SystemStart
- GetChainBlockNo :: Query blk ( WithOrigin BlockNo )
- GetChainPoint :: Query blk ( Point blk)
-
class
(
ShowQuery
(
BlockQuery
blk),
SameDepIndex
(
BlockQuery
blk)) =>
QueryLedger
blk
where
- answerBlockQuery :: ExtLedgerCfg blk -> BlockQuery blk result -> ExtLedgerState blk -> result
- data QueryVersion
-
class
(
forall
result.
Show
(query result)) =>
ShowQuery
(query ::
Type
->
Type
)
where
- showResult :: query result -> result -> String
- answerQuery :: ( QueryLedger blk, ConfigSupportsNode blk, HasAnnTip blk) => ExtLedgerCfg blk -> Query blk result -> ExtLedgerState blk -> result
- nodeToClientVersionToQueryVersion :: NodeToClientVersion -> QueryVersion
- queryDecodeNodeToClient :: forall blk. SerialiseNodeToClient blk ( SomeSecond BlockQuery blk) => CodecConfig blk -> QueryVersion -> BlockNodeToClientVersion blk -> forall s. Decoder s ( SomeSecond Query blk)
- queryEncodeNodeToClient :: forall blk. Typeable blk => Show ( SomeSecond BlockQuery blk) => SerialiseNodeToClient blk ( SomeSecond BlockQuery blk) => CodecConfig blk -> QueryVersion -> BlockNodeToClientVersion blk -> SomeSecond Query blk -> Encoding
Documentation
data family BlockQuery blk :: Type -> Type Source #
Different queries supported by the ledger, indexed by the result type.
Instances
class ConfigSupportsNode blk where Source #
The
BlockConfig
needs to contain some information in order to support
running a node.
getSystemStart :: BlockConfig blk -> SystemStart Source #
getNetworkMagic :: BlockConfig blk -> NetworkMagic Source #
Instances
CanHardFork xs => ConfigSupportsNode ( HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Node getSystemStart :: BlockConfig ( HardForkBlock xs) -> SystemStart Source # getNetworkMagic :: BlockConfig ( HardForkBlock xs) -> NetworkMagic Source # |
|
ConfigSupportsNode m => ConfigSupportsNode ( DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual getSystemStart :: BlockConfig ( DualBlock m a) -> SystemStart Source # getNetworkMagic :: BlockConfig ( DualBlock m a) -> NetworkMagic Source # |
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
BlockQuery :: BlockQuery blk result -> Query blk result |
This constructor is supported by all
|
GetSystemStart :: Query blk SystemStart |
Get the
Supported by
|
GetChainBlockNo :: Query blk ( WithOrigin BlockNo ) |
Get the
Supported by
|
GetChainPoint :: Query blk ( Point blk) |
Get the
Supported by
|
Instances
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.
answerBlockQuery :: ExtLedgerCfg blk -> BlockQuery blk result -> ExtLedgerState blk -> result Source #
Answer the given query about the extended ledger state.
Instances
All SingleEraBlock xs => QueryLedger ( HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query answerBlockQuery :: ExtLedgerCfg ( HardForkBlock xs) -> BlockQuery ( HardForkBlock xs) result -> ExtLedgerState ( HardForkBlock xs) -> result Source # |
|
Bridge m a => QueryLedger ( DualBlock m a) Source # |
Not used in the tests: no constructors |
Defined in Ouroboros.Consensus.Ledger.Dual answerBlockQuery :: ExtLedgerCfg ( 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
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.
showResult :: query result -> result -> String Source #
Instances
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
.
queryDecodeNodeToClient :: forall blk. SerialiseNodeToClient blk ( SomeSecond BlockQuery blk) => CodecConfig blk -> QueryVersion -> BlockNodeToClientVersion blk -> forall s. Decoder s ( SomeSecond Query blk) Source #
queryEncodeNodeToClient :: forall blk. Typeable blk => Show ( SomeSecond BlockQuery blk) => SerialiseNodeToClient blk ( SomeSecond BlockQuery blk) => CodecConfig blk -> QueryVersion -> BlockNodeToClientVersion blk -> SomeSecond Query blk -> Encoding Source #