Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader instance for BuildTxT #139

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading