module Tendermint.SDK.Modules.Auth
  ( Auth
  , authModule

  , module Tendermint.SDK.Modules.Auth.Keeper
  , module Tendermint.SDK.Modules.Auth.Query
  , module Tendermint.SDK.Modules.Auth.Types
  ) where

import           Polysemy                           (Members)
import           Tendermint.SDK.Application.Module  (Module (..), ModuleEffs)
import           Tendermint.SDK.BaseApp             (EmptyTxServer (..))
import           Tendermint.SDK.Modules.Auth.Keeper hiding (accountsMap)
import           Tendermint.SDK.Modules.Auth.Query
import           Tendermint.SDK.Modules.Auth.Types

type Auth =
  Module AuthName EmptyTxServer EmptyTxServer Api AuthEffs '[]

authModule
  :: Members (ModuleEffs Auth) r
  => Auth r
authModule :: Auth r
authModule = Module :: forall (name :: Symbol) check deliver query (es :: EffectRow)
       (deps :: [Component]) (r :: EffectRow).
RouteTx check r
-> RouteTx deliver r
-> RouteQ query r
-> (forall (s :: EffectRow) a.
    (Members TxEffs s, Members BaseEffs s,
     Members (DependencyEffs deps) s) =>
    Sem (es :& s) a -> Sem s a)
-> Module name check deliver query es deps r
Module
  { moduleTxDeliverer :: RouteTx EmptyTxServer r
moduleTxDeliverer = EmptyTxServer
RouteTx EmptyTxServer r
EmptyTxServer
  , moduleTxChecker :: RouteTx EmptyTxServer r
moduleTxChecker = EmptyTxServer
RouteTx EmptyTxServer r
EmptyTxServer
  , moduleQuerier :: RouteQ Api r
moduleQuerier = RouteQ Api r
forall (r :: EffectRow). Members QueryEffs r => RouteQ Api r
querier
  , moduleEval :: forall (s :: EffectRow) a.
(Members TxEffs s, Members BaseEffs s,
 Members (DependencyEffs '[]) s) =>
Sem (AuthEffs :& s) a -> Sem s a
moduleEval = forall (s :: EffectRow) a.
(Members TxEffs s, Members BaseEffs s,
 Members (DependencyEffs '[]) s) =>
Sem (AuthEffs :& s) a -> Sem s a
forall (r :: EffectRow) a.
Members '[ReadStore, WriteStore, Error AppError] r =>
Sem (Accounts : Error AuthError : r) a -> Sem r a
eval
  }