Skip to content

Commit

Permalink
chore(#81): fourmolu
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabhxyz committed Aug 28, 2024
1 parent 9c6080b commit 741a8f2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion geniusyield-server-lib/src/GeniusYield/Server/Ctx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ runQueryWithReader ctx a q = do
providers = ctxProviders ctx
runGYTxQueryMonadIO nid providers $ runReaderT q a

runGYTxMonadNodeF :: forall t v. Traversable t => GYCoinSelectionStrategy -> GYNetworkId -> GYProviders -> [GYAddress] -> GYAddress -> Maybe (GYTxOutRef, Bool) -> GYTxBuilderMonadIO (t (GYTxSkeleton v)) -> IO (t GYTxBody)
runGYTxMonadNodeF t v. Traversable t GYCoinSelectionStrategy GYNetworkId GYProviders [GYAddress] GYAddress Maybe (GYTxOutRef, Bool) GYTxBuilderMonadIO (t (GYTxSkeleton v)) IO (t GYTxBody)
runGYTxMonadNodeF strat nid providers addrs change collateral act = runGYTxBuilderMonadIO nid providers addrs change collateral $ act >>= traverse (buildTxBodyWithStrategy strat)
42 changes: 21 additions & 21 deletions geniusyield-server-lib/src/GeniusYield/Server/ErrorMiddleware.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ errorJsonWrapMiddleware app req respond = app req $ \res → do
if lookup "Content-Type" headers
/= Just "application/json" -- Don't overwrite responses which are already json!
&& statusCode status
>= 400
>= 400
&& statusCode status
< 600
< 600
then do
lbs
if statusCode status == 404
Expand All @@ -59,10 +59,10 @@ errorJsonWrapMiddleware app req respond = app req $ \res → do
errorLoggerMiddleware (LT.Text IO ()) Wai.Middleware
errorLoggerMiddleware errorLogger app req respond = app req $ \res do
let (status, _headers, body) = Wai.responseToStream res
when (statusCode status >= 400 && statusCode status < 600) $
sinkStreamingBody body
>>= errorLogger
. lazyDecodeUtf8Lenient
when (statusCode status >= 400 && statusCode status < 600)
$ sinkStreamingBody body
>>= errorLogger
. lazyDecodeUtf8Lenient
respond res

{- | Reinterpret exceptions raised by the server (mostly contract exceptions) into 'GYApiError's.
Expand Down Expand Up @@ -134,23 +134,23 @@ exceptionHandler =
}
_anyOther someBackendError $ displayException' e
GYNoSuitableCollateralException minAmt addr
someBackendError $
"No suitable collateral of at least "
<> tShow minAmt
<> " was found at the address "
<> tShow addr
someBackendError
$ "No suitable collateral of at least "
<> tShow minAmt
<> " was found at the address "
<> tShow addr
GYSlotOverflowException slot advAmt
someBackendError $
"Slot value "
<> tShow slot
<> " overflows when advanced by "
<> tShow advAmt
someBackendError
$ "Slot value "
<> tShow slot
<> " overflows when advanced by "
<> tShow advAmt
GYTimeUnderflowException sysStart time
someBackendError $
"Timestamp "
<> tShow time
<> " is before known system start "
<> tShow sysStart
someBackendError
$ "Timestamp "
<> tShow time
<> " is before known system start "
<> tShow sysStart
GYQueryDatumException qdErr someBackendError $ tShow qdErr
GYDatumMismatch actualDatum scriptWitness someBackendError $ "Actual datum in UTxO is: " <> tShow actualDatum <> ", but witness has wrong corresponding datum information: " <> tShow scriptWitness
GYApplicationException e toApiError e,
Expand Down

0 comments on commit 741a8f2

Please sign in to comment.