Skip to content

Commit

Permalink
disable payload batch endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundnoble committed Aug 25, 2024
1 parent 21f822f commit ea6734d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Chainweb/Payload/RestAPI/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ payloadHandler db k mh = liftIO (lookupPayloadDataWithHeight db mh k) >>= \case
[ "reason" .= ("key not found" :: String)
, "key" .= k
]
Just e -> return e
Just e -> return e

-- -------------------------------------------------------------------------- --
-- POST Payload Batch Handler
Expand All @@ -89,12 +89,8 @@ payloadBatchHandler
-> PayloadDb tbl
-> BatchBody
-> Handler PayloadDataList
payloadBatchHandler batchLimit db ks
= liftIO (PayloadDataList . catMaybes <$> lookupPayloadDataWithHeightBatch db ks')
where
limit = take (int batchLimit)
ks' | WithoutHeights xs <- ks = limit (fmap (Nothing,) xs)
| WithHeights xs <- ks = limit (fmap (over _1 Just) xs)
payloadBatchHandler _batchLimit _db _ks =
throwError (ServerError 404 "" "" [])

-- -------------------------------------------------------------------------- --
-- GET Outputs Handler
Expand Down

0 comments on commit ea6734d

Please sign in to comment.