Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type BaseEffs = [Metrics, Logger, Resource, Error AppError]
- defaultCompileToCore :: forall a. Sem (BaseAppEffs CoreEffs) a -> Sem CoreEffs a
- defaultCompileToPureCore :: forall a. Sem (BaseAppEffs PureCoreEffs) a -> Sem PureCoreEffs a
- type BaseAppEffs core = StoreEffs :& (BaseEffs :& core)
- type family (as :: [a]) :& (bs :: [a]) :: [a] where ...
- type CoreEffs = '[Reader LogConfig, Reader (Maybe PrometheusEnv), Reader IAVLVersions, Reader GrpcClient, Embed IO]
- data Context = Context {}
- contextLogConfig :: Lens' Context LogConfig
- contextPrometheusEnv :: Lens' Context (Maybe PrometheusEnv)
- contextVersions :: Lens' Context IAVLVersions
- makeContext :: InitialLogNamespace -> Maybe MetricsScrapingConfig -> IAVLVersions -> GrpcConfig -> IO Context
- runCoreEffs :: Context -> forall a. Sem CoreEffs a -> IO a
- type PureCoreEffs = '[Reader LogConfig, Reader DBVersions, Reader DB, Error AppError, Embed IO]
- data PureContext = PureContext {}
- pureContextLogConfig :: Lens' PureContext LogConfig
- pureContextVersions :: Lens' PureContext DBVersions
- pureContextDB :: Lens' PureContext DB
- makePureContext :: InitialLogNamespace -> IO PureContext
- runPureCoreEffs :: PureContext -> forall a. Sem PureCoreEffs a -> IO (Either AppError a)
- data ReadStore m a
- data WriteStore m a
- class RawKey k where
- rawKey :: Iso' k ByteString
- data StoreKey = StoreKey {
- skPathFromRoot :: [ByteString]
- skKey :: ByteString
- class RawKey k => IsKey k ns where
- data Store ns
- newtype KeyRoot ns = KeyRoot ByteString
- makeStore :: KeyRoot ns -> Store ns
- put :: forall k r ns. IsKey k ns => HasCodec (Value k ns) => Member WriteStore r => Store ns -> k -> Value k ns -> Sem r ()
- get :: forall k r ns. IsKey k ns => HasCodec (Value k ns) => Members [ReadStore, Error AppError] r => Store ns -> k -> Sem r (Maybe (Value k ns))
- delete :: forall k ns r. IsKey k ns => Member WriteStore r => Store ns -> k -> Sem r ()
- data Leaf (a :: Type)
- data QA (a :: Type)
- data StoreLeaf a
- data AppError = AppError {}
- class IsAppError e where
- makeAppError :: e -> AppError
- data Event = Event {
- eventType :: Text
- eventAttributes :: [KVPair]
- class ToEvent e where
- newtype ContextEvent t = ContextEvent t
- emit :: ToEvent e => Member (Output Event) r => e -> Sem r ()
- logEvent :: forall e r. (ToJSON e, ToEvent e, Select e) => Member Logger r => e -> Sem r ()
- data GasMeter m a
- withGas :: forall r a. MemberWithError GasMeter r => GasAmount -> Sem r a -> Sem r a
- data Logger m a
- log :: forall r. MemberWithError Logger r => Severity -> Text -> Sem r ()
- data LogSelect
- addContext :: forall r x a. (MemberWithError Logger r, Select x, ToJSON x) => x -> Sem r a -> Sem r a
- data Severity
- class Select a where
- data Verbosity
- data Metrics m a
- incCount :: forall r. MemberWithError Metrics r => CountName -> Sem r ()
- withTimer :: forall r a. MemberWithError Metrics r => HistogramName -> Sem r a -> Sem r a
- data CountName = CountName {
- countName :: Text
- countLabels :: [(Text, Text)]
- data HistogramName = HistogramName {
- histogramName :: Text
- histogramLabels :: [(Text, Text)]
- histogramBuckets :: [Double]
- type AnteHandler r = forall msg a. Endo (RoutingTx msg -> Sem r a)
- data RoutingTx msg where
- type family RouteTx layout (s :: EffectRow) :: Type
- data RouteContext
- data Return a
- data msg :~> a
- data TypedMessage msg
- type TxEffs = [Output Event, GasMeter, WriteStore, ReadStore, Error AppError]
- data EmptyTxServer = EmptyTxServer
- class DefaultCheckTx api (r :: EffectRow) where
- type DefaultCheckTxT api r :: Type
- defaultCheckTx :: Proxy api -> Proxy r -> DefaultCheckTxT api r
- type family VoidReturn (api :: Type) :: Type where ...
- type QueryEffs = '[ReadStore, Error AppError]
- class QueryData a where
- fromQueryData :: Base64String -> Either String a
- toQueryData :: a -> Base64String
- type family RouteQ layout r :: Type
- data QueryResult a = QueryResult {}
- storeQueryHandler :: StoreQueryHandler ns h => ns -> h
- data EmptyQueryServer = EmptyQueryServer
- data RouterError = ResourceNotFound
- type BlockEffs = TxEffs
- data EndBlockResult = EndBlockResult [ValidatorUpdate] (Maybe ConsensusParams)
- defaultBeginBlocker :: BeginBlock -> Sem r ()
- defaultEndBlocker :: EndBlock -> Sem r EndBlockResult
BaseApp
type BaseEffs = [Metrics, Logger, Resource, Error AppError] Source #
Concrete row of effects for the BaseApp. Note that because there does
| not exist an interpreter for an untagged RawStore
, you must scope
| these effects before they can be interpreted.
defaultCompileToCore :: forall a. Sem (BaseAppEffs CoreEffs) a -> Sem CoreEffs a Source #
defaultCompileToPureCore :: forall a. Sem (BaseAppEffs PureCoreEffs) a -> Sem PureCoreEffs a Source #
type family (as :: [a]) :& (bs :: [a]) :: [a] where ... infixr 5 Source #
This type family gives a nice syntax for combining multiple lists of effects.
Core Effects
type CoreEffs = '[Reader LogConfig, Reader (Maybe PrometheusEnv), Reader IAVLVersions, Reader GrpcClient, Embed IO] Source #
CoreEffs is one level below BaseAppEffs, and provides one possible | interpretation for its effects to IO.
contextLogConfig :: Lens' Context LogConfig Source #
contextPrometheusEnv :: Lens' Context (Maybe PrometheusEnv) Source #
contextVersions :: Lens' Context IAVLVersions Source #
makeContext :: InitialLogNamespace -> Maybe MetricsScrapingConfig -> IAVLVersions -> GrpcConfig -> IO Context Source #
runCoreEffs :: Context -> forall a. Sem CoreEffs a -> IO a Source #
The standard interpeter for CoreEffs
.
Pure Effects
type PureCoreEffs = '[Reader LogConfig, Reader DBVersions, Reader DB, Error AppError, Embed IO] Source #
CoreEffs is one level below BaseAppEffs, and provides one possible | interpretation for its effects to IO.
data PureContext Source #
Context
is the environment required to run CoreEffsPure
to IO
pureContextLogConfig :: Lens' PureContext LogConfig Source #
pureContextVersions :: Lens' PureContext DBVersions Source #
pureContextDB :: Lens' PureContext DB Source #
runPureCoreEffs :: PureContext -> forall a. Sem PureCoreEffs a -> IO (Either AppError a) Source #
The standard interpeter for PureCoreEffs
.
Store
Read and Write Effects
data WriteStore m a Source #
Instances
type DefiningModule (WriteStore :: k -> Type -> Type) Source # | |
Defined in Tendermint.SDK.BaseApp.Store.RawStore |
Keys
rawKey :: Iso' k ByteString Source #
Instances
RawKey Word64 Source # | |
Defined in Tendermint.SDK.BaseApp.Store.RawStore rawKey :: Iso' Word64 ByteString Source # | |
RawKey () Source # | |
Defined in Tendermint.SDK.BaseApp.Store.RawStore rawKey :: Iso' () ByteString Source # | |
RawKey Text Source # | |
Defined in Tendermint.SDK.BaseApp.Store.RawStore rawKey :: Iso' Text ByteString Source # | |
RawKey Address Source # | |
Defined in Tendermint.SDK.BaseApp.Store.RawStore rawKey :: Iso' Address ByteString Source # | |
RawKey PubKey_ Source # | |
Defined in Tendermint.SDK.Modules.Validators.Types rawKey :: Iso' PubKey_ ByteString Source # |
StoreKey | |
|
class RawKey k => IsKey k ns where Source #
Nothing
put :: forall k r ns. IsKey k ns => HasCodec (Value k ns) => Member WriteStore r => Store ns -> k -> Value k ns -> Sem r () Source #
get :: forall k r ns. IsKey k ns => HasCodec (Value k ns) => Members [ReadStore, Error AppError] r => Store ns -> k -> Sem r (Maybe (Value k ns)) Source #
Query Routes
data Leaf (a :: Type) Source #
Instances
(Member (Tagged 'QueryAndMempool (ReadStore :: (Type -> Type) -> Type -> Type)) r, HasCodec a) => HasQueryRouter (Leaf a :: Type) r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router routeQ :: Proxy (Leaf a) -> Proxy r -> Delayed (Sem r) env QueryRequest (RouteQ (Leaf a) (QueryEffs :& r)) -> Router env r QueryRequest Query Source # hoistQueryRouter :: forall (s :: EffectRow) (s' :: EffectRow). Proxy (Leaf a) -> Proxy r -> (forall a0. Sem s a0 -> Sem s' a0) -> RouteQ (Leaf a) s -> RouteQ (Leaf a) s' Source # | |
type RouteQ (Leaf a :: Type) r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router |
Instances
(QueryData a, HasQueryRouter sublayout r) => HasQueryRouter (QA a :> sublayout :: Type) r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router routeQ :: Proxy (QA a :> sublayout) -> Proxy r -> Delayed (Sem r) env QueryRequest (RouteQ (QA a :> sublayout) (QueryEffs :& r)) -> Router env r QueryRequest Query Source # hoistQueryRouter :: forall (s :: EffectRow) (s' :: EffectRow). Proxy (QA a :> sublayout) -> Proxy r -> (forall a0. Sem s a0 -> Sem s' a0) -> RouteQ (QA a :> sublayout) s -> RouteQ (QA a :> sublayout) s' Source # | |
type RouteQ (QA a :> sublayout :: Type) r Source # | |
Instances
Errors
This type represents a common error response for the query, checkTx, | and deliver tx abci-messages.
Instances
class IsAppError e where Source #
Allows for custom application error types to be coerced into the standard error resposne.
makeAppError :: e -> AppError Source #
Instances
IsAppError SDKError Source # | |
Defined in Tendermint.SDK.BaseApp.Errors makeAppError :: SDKError -> AppError Source # | |
IsAppError RouterError Source # | |
Defined in Tendermint.SDK.BaseApp.Router.Types makeAppError :: RouterError -> AppError Source # | |
IsAppError AuthError Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types makeAppError :: AuthError -> AppError Source # | |
IsAppError BankError Source # | |
Defined in Tendermint.SDK.Modules.Bank.Types makeAppError :: BankError -> AppError Source # |
Events
Event | |
|
Instances
Eq Event | |
Show Event | |
Generic Event | |
FromJSON Event | |
Defined in Network.ABCI.Types.Messages.FieldTypes parseJSON :: Value -> Parser Event parseJSONList :: Value -> Parser [Event] | |
ToJSON Event | |
Defined in Network.ABCI.Types.Messages.FieldTypes | |
Wrapped Event | |
Defined in Network.ABCI.Types.Messages.FieldTypes type Unwrapped Event | |
type Rep Event | |
Defined in Network.ABCI.Types.Messages.FieldTypes type Rep Event = D1 ('MetaData "Event" "Network.ABCI.Types.Messages.FieldTypes" "hs-abci-types-0.1.0.0-JbnZdER2jhDLQQCYdLDZz" 'False) (C1 ('MetaCons "Event" 'PrefixI 'True) (S1 ('MetaSel ('Just "eventType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "eventAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [KVPair]))) | |
type Unwrapped Event | |
Defined in Network.ABCI.Types.Messages.FieldTypes |
class ToEvent e where Source #
A class representing a type that can be emitted as an event in the | event logs for the deliverTx response.
Nothing
Instances
ToEvent TransferEvent Source # | |
Defined in Tendermint.SDK.Modules.Bank.Types toEvent :: TransferEvent -> Event Source # |
newtype ContextEvent t Source #
Special event wrapper to add contextual event_type info
Instances
(ToJSON a, ToEvent a) => ToJSON (ContextEvent a) Source # | |
Defined in Tendermint.SDK.BaseApp.Events toJSON :: ContextEvent a -> Value toEncoding :: ContextEvent a -> Encoding toJSONList :: [ContextEvent a] -> Value toEncodingList :: [ContextEvent a] -> Encoding | |
Select a => Select (ContextEvent a) Source # | |
Defined in Tendermint.SDK.BaseApp.Events |
logEvent :: forall e r. (ToJSON e, ToEvent e, Select e) => Member Logger r => e -> Sem r () Source #
Gas
Logger
Effect allowing for console logging.
Instances
type DefiningModule Logger Source # | |
Defined in Tendermint.SDK.BaseApp.Logger type DefiningModule Logger = "Tendermint.SDK.BaseApp.Logger" |
addContext :: forall r x a. (MemberWithError Logger r, Select x, ToJSON x) => x -> Sem r a -> Sem r a Source #
Class for selecting object keys for contextual logging
Nothing
Instances
Select TransferEvent Source # | |
Defined in Tendermint.SDK.Modules.Bank.Types | |
Select a => Select (ContextEvent a) Source # | |
Defined in Tendermint.SDK.BaseApp.Events |
Metrics
Instances
type DefiningModule Metrics Source # | |
Defined in Tendermint.SDK.BaseApp.Metrics type DefiningModule Metrics = "Tendermint.SDK.BaseApp.Metrics" |
withTimer :: forall r a. MemberWithError Metrics r => HistogramName -> Sem r a -> Sem r a Source #
data HistogramName Source #
HistogramName | |
|
Instances
Eq HistogramName Source # | |
Defined in Tendermint.SDK.BaseApp.Metrics (==) :: HistogramName -> HistogramName -> Bool # (/=) :: HistogramName -> HistogramName -> Bool # | |
Ord HistogramName Source # | |
Defined in Tendermint.SDK.BaseApp.Metrics compare :: HistogramName -> HistogramName -> Ordering # (<) :: HistogramName -> HistogramName -> Bool # (<=) :: HistogramName -> HistogramName -> Bool # (>) :: HistogramName -> HistogramName -> Bool # (>=) :: HistogramName -> HistogramName -> Bool # max :: HistogramName -> HistogramName -> HistogramName # min :: HistogramName -> HistogramName -> HistogramName # | |
IsString HistogramName Source # | |
Defined in Tendermint.SDK.BaseApp.Metrics fromString :: String -> HistogramName # |
Transaction
type AnteHandler r = forall msg a. Endo (RoutingTx msg -> Sem r a) Source #
type family RouteTx layout (s :: EffectRow) :: Type Source #
Instances
type RouteTx EmptyTxServer r Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Router | |
type RouteTx (a :<|> b :: Type) s Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Router | |
type RouteTx (path :> sublayout :: Type) s Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Router | |
type RouteTx (TypedMessage msg :~> Return a :: Type) r Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Router |
data RouteContext Source #
Instances
Eq RouteContext Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Types (==) :: RouteContext -> RouteContext -> Bool # (/=) :: RouteContext -> RouteContext -> Bool # | |
Show RouteContext Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Types showsPrec :: Int -> RouteContext -> ShowS # show :: RouteContext -> String # showList :: [RouteContext] -> ShowS # |
Instances
Instances
data TypedMessage msg Source #
Instances
data EmptyTxServer Source #
Instances
class DefaultCheckTx api (r :: EffectRow) where Source #
type DefaultCheckTxT api r :: Type Source #
defaultCheckTx :: Proxy api -> Proxy r -> DefaultCheckTxT api r Source #
Instances
type family VoidReturn (api :: Type) :: Type where ... Source #
VoidReturn (a :<|> b) = VoidReturn a :<|> VoidReturn b | |
VoidReturn (path :> a) = path :> VoidReturn a | |
VoidReturn (TypedMessage msg :~> Return a) = TypedMessage msg :~> Return () |
Query
class QueryData a where Source #
This class is used to parse the 'data' field of the query request message. | The default method assumes that the 'data' is simply the key for the | value being queried.
Nothing
fromQueryData :: Base64String -> Either String a Source #
default fromQueryData :: RawKey a => Base64String -> Either String a Source #
toQueryData :: a -> Base64String Source #
default toQueryData :: RawKey a => a -> Base64String Source #
Instances
QueryData Word64 Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Types fromQueryData :: Base64String -> Either String Word64 Source # toQueryData :: Word64 -> Base64String Source # | |
QueryData () Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Types fromQueryData :: Base64String -> Either String () Source # toQueryData :: () -> Base64String Source # | |
QueryData Text Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Types fromQueryData :: Base64String -> Either String Text Source # toQueryData :: Text -> Base64String Source # | |
QueryData Address Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Types fromQueryData :: Base64String -> Either String Address Source # toQueryData :: Address -> Base64String Source # | |
QueryData PubKey_ Source # | |
Defined in Tendermint.SDK.Modules.Validators.Types fromQueryData :: Base64String -> Either String PubKey_ Source # toQueryData :: PubKey_ -> Base64String Source # |
type family RouteQ layout r :: Type Source #
A routeQ handler.
Instances
type RouteQ EmptyQueryServer r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router | |
type RouteQ (Leaf a :: Type) r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router | |
type RouteQ (a :<|> b :: Type) r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router | |
type RouteQ (StoreLeaf (Var a) :: Type) r Source # | |
type RouteQ (StoreLeaf (Map k v) :: Type) r Source # | |
type RouteQ (StoreLeaf (Array a) :: Type) r Source # | |
type RouteQ (QA a :> sublayout :: Type) r Source # | |
type RouteQ (Capture' mods capture a :> sublayout :: Type) r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router | |
type RouteQ (QueryParam' mods sym a :> sublayout :: Type) r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router | |
type RouteQ (path :> sublayout :: Type) r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router |
data QueryResult a Source #
Instances
Functor QueryResult Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Types fmap :: (a -> b) -> QueryResult a -> QueryResult b # (<$) :: a -> QueryResult b -> QueryResult a # | |
Eq a => Eq (QueryResult a) Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Types (==) :: QueryResult a -> QueryResult a -> Bool # (/=) :: QueryResult a -> QueryResult a -> Bool # | |
Show a => Show (QueryResult a) Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Types showsPrec :: Int -> QueryResult a -> ShowS # show :: QueryResult a -> String # showList :: [QueryResult a] -> ShowS # |
storeQueryHandler :: StoreQueryHandler ns h => ns -> h Source #
data EmptyQueryServer Source #
Instances
HasQueryRouter EmptyQueryServer r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router type RouteQ EmptyQueryServer r Source # routeQ :: Proxy EmptyQueryServer -> Proxy r -> Delayed (Sem r) env QueryRequest (RouteQ EmptyQueryServer (QueryEffs :& r)) -> Router env r QueryRequest Query Source # hoistQueryRouter :: forall (s :: EffectRow) (s' :: EffectRow). Proxy EmptyQueryServer -> Proxy r -> (forall a. Sem s a -> Sem s' a) -> RouteQ EmptyQueryServer s -> RouteQ EmptyQueryServer s' Source # | |
type RouteQ EmptyQueryServer r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router |
data RouterError Source #
Instances
Show RouterError Source # | |
Defined in Tendermint.SDK.BaseApp.Router.Types showsPrec :: Int -> RouterError -> ShowS # show :: RouterError -> String # showList :: [RouterError] -> ShowS # | |
IsAppError RouterError Source # | |
Defined in Tendermint.SDK.BaseApp.Router.Types makeAppError :: RouterError -> AppError Source # |
Block
data EndBlockResult Source #
Instances
HasCodec EndBlockResult Source # | |
Defined in Tendermint.SDK.BaseApp.Block encode :: EndBlockResult -> ByteString Source # decode :: ByteString -> Either Text EndBlockResult Source # |
defaultBeginBlocker :: BeginBlock -> Sem r () Source #
defaultEndBlocker :: EndBlock -> Sem r EndBlockResult Source #