Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data family BlockQuery blk ∷ Type → Type
- class (ShowQuery (BlockQuery blk), SameDepIndex (BlockQuery blk)) ⇒ BlockSupportsLedgerQuery blk where
- answerBlockQuery ∷ ExtLedgerCfg blk → BlockQuery blk result → ExtLedgerState blk → result
- 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)
- data QueryVersion
- class (∀ result. Show (query result)) ⇒ ShowQuery (query ∷ Type → Type) where
- showResult ∷ query result → result → String
- answerQuery ∷ (BlockSupportsLedgerQuery blk, ConfigSupportsNode blk, HasAnnTip blk) ⇒ ExtLedgerCfg blk → Query blk result → ExtLedgerState blk → result
- nodeToClientVersionToQueryVersion ∷ NodeToClientVersion → QueryVersion
- queryDecodeNodeToClient ∷ ∀ blk. SerialiseNodeToClient blk (SomeSecond BlockQuery blk) ⇒ CodecConfig blk → QueryVersion → BlockNodeToClientVersion blk → ∀ s. Decoder s (SomeSecond Query blk)
- queryEncodeNodeToClient ∷ ∀ 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 (ShowQuery (BlockQuery blk), SameDepIndex (BlockQuery blk)) ⇒ BlockSupportsLedgerQuery 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 ⇒ BlockSupportsLedgerQuery (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 ⇒ BlockSupportsLedgerQuery (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 # |
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 | |
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
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 (∀ 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 ∷ (BlockSupportsLedgerQuery 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 ∷ ∀ blk. SerialiseNodeToClient blk (SomeSecond BlockQuery blk) ⇒ CodecConfig blk → QueryVersion → BlockNodeToClientVersion blk → ∀ s. Decoder s (SomeSecond Query blk) Source #
queryEncodeNodeToClient ∷ ∀ blk. Typeable blk ⇒ Show (SomeSecond BlockQuery blk) ⇒ SerialiseNodeToClient blk (SomeSecond BlockQuery blk) ⇒ CodecConfig blk → QueryVersion → BlockNodeToClientVersion blk → SomeSecond Query blk → Encoding Source #