Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The type of the local ledger state query protocol.
This is used by local clients (like wallets and CLI tools) to query the ledger state of a local node.
Synopsis
-
data
LocalStateQuery
block point (query ::
Type
->
Type
)
where
- StIdle :: LocalStateQuery block point query
- StAcquiring :: LocalStateQuery block point query
- StAcquired :: LocalStateQuery block point query
- StQuerying :: result -> LocalStateQuery block point query
- StDone :: LocalStateQuery block point query
- data AcquireFailure
-
class
(
forall
result.
Show
(query result)) =>
ShowQuery
query
where
- showResult :: forall result. query result -> result -> String
Documentation
data LocalStateQuery block point (query :: Type -> Type ) where Source #
The kind of the local state query protocol, and the types of the states in the protocol state machine.
It is parametrised over the type of block (for points), the type of queries and query results.
StIdle :: LocalStateQuery block point query |
The client has agency. It can ask to acquire a state or terminate. There is no timeout in this state. |
StAcquiring :: LocalStateQuery block point query |
The server has agency. it must acquire the state at the requested point or report a failure. There is a timeout in this state. |
StAcquired :: LocalStateQuery block point query |
The client has agency. It can request queries against the current state, or it can release the state. |
StQuerying :: result -> LocalStateQuery block point query |
The server has agency. It must respond with the query result. |
StDone :: LocalStateQuery block point query |
Nobody has agency. The terminal state. |
Instances
( ShowProxy block, ShowProxy query) => ShowProxy ( LocalStateQuery block point query :: Type ) Source # | |
|
|
Show ( ClientHasAgency st) Source # | |
|
|
( forall result. Show (query result)) => Show ( ServerHasAgency st) Source # | |
|
|
( ShowQuery query, Show point) => Show ( Message ( LocalStateQuery block point query) st st') Source # | |
|
|
Protocol ( LocalStateQuery block point query) Source # | |
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type data Message ( LocalStateQuery block point query) st st' Source # data ClientHasAgency st Source # data ServerHasAgency st Source # data NobodyHasAgency st Source # exclusionLemma_ClientAndServerHaveAgency :: forall (st :: LocalStateQuery block point query). ClientHasAgency st -> ServerHasAgency st -> Void Source # exclusionLemma_NobodyAndClientHaveAgency :: forall (st :: LocalStateQuery block point query). NobodyHasAgency st -> ClientHasAgency st -> Void Source # exclusionLemma_NobodyAndServerHaveAgency :: forall (st :: LocalStateQuery block point query). NobodyHasAgency st -> ServerHasAgency st -> Void Source # |
|
data Message ( LocalStateQuery block point query) (from :: LocalStateQuery block point query) (to :: LocalStateQuery block point query) Source # | |
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type
data
Message
(
LocalStateQuery
block point query) (from ::
LocalStateQuery
block point query) (to ::
LocalStateQuery
block point query)
where
|
|
data ClientHasAgency (st :: LocalStateQuery block point query) Source # | |
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type
data
ClientHasAgency
(st ::
LocalStateQuery
block point query)
where
|
|
data ServerHasAgency (st :: LocalStateQuery block point query) Source # | |
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type
data
ServerHasAgency
(st ::
LocalStateQuery
block point query)
where
|
|
data NobodyHasAgency (st :: LocalStateQuery block point query) Source # | |
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type
data
NobodyHasAgency
(st ::
LocalStateQuery
block point query)
where
|
data AcquireFailure Source #
Instances
Enum AcquireFailure Source # | |
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type succ :: AcquireFailure -> AcquireFailure Source # pred :: AcquireFailure -> AcquireFailure Source # toEnum :: Int -> AcquireFailure Source # fromEnum :: AcquireFailure -> Int Source # enumFrom :: AcquireFailure -> [ AcquireFailure ] Source # enumFromThen :: AcquireFailure -> AcquireFailure -> [ AcquireFailure ] Source # enumFromTo :: AcquireFailure -> AcquireFailure -> [ AcquireFailure ] Source # enumFromThenTo :: AcquireFailure -> AcquireFailure -> AcquireFailure -> [ AcquireFailure ] Source # |
|
Eq AcquireFailure Source # | |
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type (==) :: AcquireFailure -> AcquireFailure -> Bool Source # (/=) :: AcquireFailure -> AcquireFailure -> Bool Source # |
|
Show AcquireFailure Source # | |
|
class ( forall result. Show (query result)) => ShowQuery query 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 :: forall result. query result -> result -> String Source #