Skip to content

Commit

Permalink
Reader instance for BuildTxT
Browse files Browse the repository at this point in the history
  • Loading branch information
amirmrad committed Apr 10, 2024
1 parent 57954ef commit b347a26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/base/lib/Convex/BuildTx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ import Control.Lens (_1, _2, at, mapped, over, set,
view, (&))
import qualified Control.Lens as L
import Control.Monad.Except (MonadError (..))
import Control.Monad.Reader.Class (MonadReader (..))
import qualified Control.Monad.State as LazyState
import Control.Monad.State.Class (MonadState (..))
import qualified Control.Monad.State.Strict as StrictState
Expand Down Expand Up @@ -228,6 +229,10 @@ instance MonadError e m => MonadError e (BuildTxT m) where
throwError = lift . throwError
catchError m action = BuildTxT (unBuildTxT $ catchError m action)

instance MonadReader e m => MonadReader e (BuildTxT m) where
ask = lift ask
local f = BuildTxT . local f . unBuildTxT

instance MonadBlockchain m => MonadBlockchain (BuildTxT m) where
sendTx = lift . sendTx
utxoByTxIn = lift . utxoByTxIn
Expand Down

0 comments on commit b347a26

Please sign in to comment.