haskoin-store 1.2.0 → 1.2.1
raw patch · 2 files changed
+13/−17 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- haskoin-store.cabal +1/−1
- src/Haskoin/Store/Web.hs +12/−16
haskoin-store.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: haskoin-store-version: 1.2.0+version: 1.2.1 synopsis: Storage and index for Bitcoin and Bitcoin Cash description: Please see the README on GitHub at <https://github.com/haskoin/haskoin-store#readme> category: Bitcoin, Finance, Network
src/Haskoin/Store/Web.hs view
@@ -510,7 +510,6 @@ S.scottyOptsT opts (runner . flip runReaderT state) $ do S.middleware $ webSocketEvents state S.middleware logger- S.defaultHandler defHandler handlePaths config S.notFound $ raise ThingNotFound where@@ -578,15 +577,18 @@ | otherwise = Nothing raise :: (MonadIO m) => Except -> ActionT m a-raise err = do+raise e = do askl (.metrics) >>= mapM_ \m -> do liftIO $ mapM_ (`incrementCounter` 1) $ if- | statusIsClientError (errStatus err) -> Just m.clientErrors- | statusIsServerError (errStatus err) -> Just m.serverErrors+ | statusIsClientError (errStatus e) -> Just m.clientErrors+ | statusIsServerError (errStatus e) -> Just m.serverErrors | otherwise -> Nothing- S.raiseStatus (errStatus err) (TL.pack (show err))+ setHeaders+ S.status $ errStatus e+ S.json e+ S.finish errStatus :: Except -> Status errStatus ThingNotFound = status404@@ -598,12 +600,6 @@ errStatus ServerTimeout = status500 errStatus RequestTooLarge = status413 -defHandler :: (MonadIO m) => S.ErrorHandler (ReaderT WebState m)-defHandler = S.Handler $ \e -> do- setHeaders- S.status $ errStatus e- S.json e- handlePaths :: (MonadUnliftIO m, MonadLoggerIO m) => WebConfig ->@@ -611,11 +607,6 @@ handlePaths cfg = do -- Block Paths pathCompact- (GetBlock <$> paramLazy <*> paramDef)- scottyBlock- (marshalEncoding net)- (marshalValue net)- pathCompact (GetBlockBest <$> paramDef) scottyBlockBest (marshalEncoding net)@@ -633,6 +624,11 @@ pathCompact (GetBlockMTP <$> paramLazy <*> paramDef) scottyBlockMTP+ (marshalEncoding net)+ (marshalValue net)+ pathCompact+ (GetBlock <$> paramLazy <*> paramDef)+ scottyBlock (marshalEncoding net) (marshalValue net) pathCompact