Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type BaseAppEffs = [RawStore, Metrics, Logger, Resource, Error AppError]
- type family (as :: [a]) :& (bs :: [a]) :: [a] where ...
- type BaseApp r = BaseAppEffs :& r
- type ScopedBaseApp (s :: ConnectionScope) r = ApplyScope s (BaseApp r)
- compileToCoreEffs :: AuthTreeGetter s => forall a. Sem (ScopedBaseApp s CoreEffs) a -> Sem CoreEffs a
- compileScopedEff :: ScopedEff CoreEffs a -> Sem CoreEffs a
- type CoreEffs = '[MergeScopes, Reader LogConfig, Reader (Maybe PrometheusEnv), Reader AuthTreeState, Embed IO]
- data Context = Context {}
- contextLogConfig :: Lens' Context LogConfig
- contextPrometheusEnv :: Lens' Context (Maybe PrometheusEnv)
- contextAuthTree :: Lens' Context AuthTreeState
- makeContext :: InitialLogNamespace -> Maybe MetricsScrapingConfig -> IO Context
- runCoreEffs :: Context -> forall a. Sem CoreEffs a -> IO a
- data RawStore m a
- class RawKey k where
- rawKey :: Iso' k ByteString
- class RawKey k => IsKey k ns where
- type Value k ns = a | a -> ns k
- prefixWith :: Proxy k -> Proxy ns -> ByteString
- newtype StoreKey n = StoreKey ByteString
- put :: forall k r ns. IsKey k ns => HasCodec (Value k ns) => Member RawStore r => StoreKey ns -> k -> Value k ns -> Sem r ()
- get :: forall k r ns. IsKey k ns => HasCodec (Value k ns) => Members [RawStore, Error AppError] r => StoreKey ns -> k -> Sem r (Maybe (Value k ns))
- delete :: forall k ns r. IsKey k ns => Member RawStore r => StoreKey ns -> k -> Sem r ()
- data Leaf (a :: *)
- data QA (a :: *)
- data ConnectionScope
- applyScope :: forall s r. forall a. Sem (RawStore ': r) a -> Sem (Tagged s RawStore ': r) a
- data AppError = AppError {
- appErrorCode :: Word32
- appErrorCodespace :: Text
- appErrorMessage :: Text
- class IsAppError e where
- makeAppError :: e -> AppError
- data SDKError
- = InternalError
- | ParseError Text
- | UnmatchedRoute Text
- | OutOfGasException
- | MessageValidation [Text]
- | SignatureRecoveryError Text
- | NonceException Word64 Word64
- throwSDKError :: Member (Error AppError) r => SDKError -> Sem r a
- data Event = Event {
- eventType :: Text
- eventAttributes :: [KVPair]
- class ToEvent e where
- makeEventType :: Proxy e -> String
- makeEventData :: e -> [(ByteString, ByteString)]
- 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
- data Logger m a
- log :: forall r. MemberWithError Logger r => Severity -> Text -> Sem r ()
- addContext :: forall r x a. (MemberWithError Logger r, Select x, ToJSON x) => x -> Sem r a -> Sem r a
- data LogSelect
- 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 TransactionApplication m = RoutingTx ByteString -> m TxResult
- data RoutingTx msg where
- data RouteContext
- type family RouteTx layout r c :: *
- type Return = Return' OnCheckUnit
- data msg :~> a
- data TypedMessage msg
- type TxEffs = [Output Event, GasMeter, Error AppError]
- data EmptyTxServer
- emptyTxServer :: RouteTx EmptyTxServer r c
- serveTxApplication :: HasTxRouter layout r c => Proxy layout -> Proxy r -> Proxy (c :: RouteContext) -> RouteTx layout r c -> TransactionApplication (Sem r)
- class DefaultCheckTx api (r :: EffectRow) where
- type DefaultCheckTxT api r :: *
- defaultCheckTx :: Proxy api -> Proxy r -> DefaultCheckTxT api r
- class HasCodec a => Queryable a where
- class FromQueryData a where
- fromQueryData :: Base64String -> Either String a
- type family QueryApi kvs :: *
- type family RouteQ layout r :: *
- data QueryResult a = QueryResult {}
- storeQueryHandlers :: StoreQueryHandlers kvs ns r => Proxy kvs -> StoreKey ns -> Proxy r -> RouteQ (QueryApi kvs) r
- serveQueryApplication :: HasQueryRouter layout r => Proxy layout -> Proxy r -> RouteQ layout r -> QueryApplication (Sem r)
- data EmptyQueryServer
- emptyQueryServer :: RouteQ EmptyQueryServer r
BaseApp
type BaseAppEffs = [RawStore, 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.
type family (as :: [a]) :& (bs :: [a]) :: [a] where ... infixr 5 Source #
This type family gives a nice syntax for combining multiple lists of effects.
type BaseApp r = BaseAppEffs :& r Source #
type ScopedBaseApp (s :: ConnectionScope) r = ApplyScope s (BaseApp r) Source #
compileToCoreEffs :: AuthTreeGetter s => forall a. Sem (ScopedBaseApp s CoreEffs) a -> Sem CoreEffs a Source #
An intermediary interpeter, bringing BaseApp
down to CoreEff
.
CoreEff
type CoreEffs = '[MergeScopes, Reader LogConfig, Reader (Maybe PrometheusEnv), Reader AuthTreeState, 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 #
contextAuthTree :: Lens' Context AuthTreeState Source #
runCoreEffs :: Context -> forall a. Sem CoreEffs a -> IO a Source #
The standard interpeter for CoreEffs
.
Store
rawKey :: Iso' k ByteString Source #
Instances
RawKey Address Source # | |
Defined in Tendermint.SDK.BaseApp.Store.RawStore rawKey :: Iso' Address ByteString Source # |
class RawKey k => IsKey k ns where Source #
Nothing
prefixWith :: Proxy k -> Proxy ns -> ByteString Source #
prefixWith :: Proxy k -> Proxy ns -> ByteString Source #
Instances
IsKey Address AuthModule Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types prefixWith :: Proxy Address -> Proxy AuthModule -> ByteString Source # |
put :: forall k r ns. IsKey k ns => HasCodec (Value k ns) => Member RawStore r => StoreKey ns -> k -> Value k ns -> Sem r () Source #
get :: forall k r ns. IsKey k ns => HasCodec (Value k ns) => Members [RawStore, Error AppError] r => StoreKey ns -> k -> Sem r (Maybe (Value k ns)) Source #
Query Routes
Instances
(FromQueryData a, HasQueryRouter sublayout r) => HasQueryRouter (QA a :> sublayout :: Type) r Source # | |
type RouteQ (QA a :> sublayout :: Type) r Source # | |
Scope
data ConnectionScope Source #
Instances
(Members CoreEffs r, AuthTreeGetter s) => ResolveScope (s :: ConnectionScope) r Source # | |
Defined in Tendermint.SDK.BaseApp.CoreEff resolveScope :: Sem (Tagged s RawStore ': r) a -> Sem r a Source # |
applyScope :: forall s r. forall a. Sem (RawStore ': r) a -> Sem (Tagged s RawStore ': r) a Source #
Errors
This type represents a common error response for the query, checkTx, | and deliver tx abci-messages.
AppError | |
|
Instances
Eq AppError Source # | |
Show AppError Source # | |
Exception AppError Source # | |
Defined in Tendermint.SDK.BaseApp.Errors toException :: AppError -> SomeException # fromException :: SomeException -> Maybe AppError # displayException :: AppError -> String # |
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 # |
These errors originate from the SDK itself. The "sdk" namespace is reserved | for this error type and should not be used in modules or applications.
InternalError | Something went wrong and we have no idea what. |
ParseError Text | Parsing errors for SDK specific types, e.g. |
UnmatchedRoute Text | The name of the route that failed to match. |
OutOfGasException | |
MessageValidation [Text] | |
SignatureRecoveryError Text | |
NonceException Word64 Word64 |
Instances
IsAppError SDKError Source # | |
Defined in Tendermint.SDK.BaseApp.Errors makeAppError :: SDKError -> AppError Source # |
throwSDKError :: Member (Error AppError) r => SDKError -> Sem r a 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 | |
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-CSbCBfElGIr9n2xrkSCrY5" 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.
makeEventType :: Proxy e -> String Source #
makeEventData :: e -> [(ByteString, ByteString)] Source #
makeEventData :: ToJSON e => e -> [(ByteString, ByteString)] 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 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 #
CountName | |
|
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 TransactionApplication m = RoutingTx ByteString -> m TxResult Source #
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 # |
type family RouteTx layout r c :: * Source #
Instances
type RouteTx EmptyTxServer r c Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Router | |
type RouteTx (a :<|> b :: Type) r c Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Router | |
type RouteTx (path :> sublayout :: Type) r c Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Router | |
type RouteTx (TypedMessage msg :~> Return' oc a :: Type) r c Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Router type RouteTx (TypedMessage msg :~> Return' oc a :: Type) r c = RoutingTx msg -> Sem (TxEffs :& r) (OnCheckReturn c oc a) |
type Return = Return' OnCheckUnit Source #
Instances
data TypedMessage msg Source #
Instances
data EmptyTxServer Source #
Instances
DefaultCheckTx EmptyTxServer r Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Checker type DefaultCheckTxT EmptyTxServer r :: Type Source # defaultCheckTx :: Proxy EmptyTxServer -> Proxy r -> DefaultCheckTxT EmptyTxServer r Source # | |
HasTxRouter EmptyTxServer r c Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Router type RouteTx EmptyTxServer r c :: Type Source # routeTx :: Proxy EmptyTxServer -> Proxy r -> Proxy c -> Delayed (Sem r) env (RoutingTx ByteString) (RouteTx EmptyTxServer r c) -> Router env r (RoutingTx ByteString) TxResult Source # | |
type DefaultCheckTxT EmptyTxServer r Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Checker | |
type RouteTx EmptyTxServer r c Source # | |
Defined in Tendermint.SDK.BaseApp.Transaction.Router |
emptyTxServer :: RouteTx EmptyTxServer r c Source #
serveTxApplication :: HasTxRouter layout r c => Proxy layout -> Proxy r -> Proxy (c :: RouteContext) -> RouteTx layout r c -> TransactionApplication (Sem r) Source #
class DefaultCheckTx api (r :: EffectRow) where Source #
type DefaultCheckTxT api r :: * Source #
defaultCheckTx :: Proxy api -> Proxy r -> DefaultCheckTxT api r Source #
Instances
Query
class HasCodec a => Queryable a Source #
class representing objects which can be queried via the hs-abci query message.
| Here the Name
is the leaf of the query url, e.g. if you can access a token
| balance of type Balance
at "token/balance", then 'Name Balance ~ "balance"'.
class FromQueryData 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 #
fromQueryData :: RawKey a => Base64String -> Either String a Source #
Instances
FromQueryData Address Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Types |
type family QueryApi kvs :: * Source #
Instances
type QueryApi ((k, a) ': ((k', a') ': as)) Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Store | |
type QueryApi ((k, a) ': ([] :: [Type])) Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Store |
type family RouteQ layout r :: * 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 a :: Type) r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Store | |
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 (QA a :> sublayout :: Type) r Source # | |
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 # | |
(IsKey k ns, a ~ Value k ns, HasCodec a, Members ((RawStore :: (Type -> Type) -> Type -> Type) ': ((Error AppError :: (Type -> Type) -> Type -> Type) ': ([] :: [(Type -> Type) -> Type -> Type]))) r) => StoreQueryHandler (a :: Type) ns (QueryArgs k -> Sem r (QueryResult a)) Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Store storeQueryHandler :: Proxy a -> StoreKey ns -> QueryArgs k -> Sem r (QueryResult a) Source # |
storeQueryHandlers :: StoreQueryHandlers kvs ns r => Proxy kvs -> StoreKey ns -> Proxy r -> RouteQ (QueryApi kvs) r Source #
serveQueryApplication :: HasQueryRouter layout r => Proxy layout -> Proxy r -> RouteQ layout r -> QueryApplication (Sem r) Source #
data EmptyQueryServer Source #
Instances
HasQueryRouter EmptyQueryServer r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router type RouteQ EmptyQueryServer r :: Type Source # routeQ :: Proxy EmptyQueryServer -> Proxy r -> Delayed (Sem r) env QueryRequest (RouteQ EmptyQueryServer r) -> Router env r QueryRequest Query Source # | |
type RouteQ EmptyQueryServer r Source # | |
Defined in Tendermint.SDK.BaseApp.Query.Router |