Skip to content

Commit

Permalink
Fix fetchDelistedPools
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Ospald committed Nov 19, 2020
1 parent 421cf8b commit 5737a43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/core/src/Cardano/Pool/Metadata.hs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ metadaFetchEp pid (StakePoolMetadataHash bytes)
healthCheckEP :: String
healthCheckEP = T.unpack $ T.intercalate "/" ["api", "v1", "status"]

delistedEP :: String
delistedEP = T.unpack $ T.intercalate "/" ["api", "v1", "delisted"]

-- | TODO: import SMASH types
newtype SMASHPoolId = SMASHPoolId
{ poolId :: T.Text
Expand Down Expand Up @@ -247,7 +250,9 @@ fetchDelistedPools
-> Manager
-> IO (Maybe [PoolId])
fetchDelistedPools tr uri manager = runExceptTLog $ do
pl <- smashRequest tr uri manager
pl <- smashRequest tr
(uri { uriPath = "/" <> delistedEP , uriQuery = "", uriFragment = "" })
manager
smashPids <- except $ eitherDecodeStrict @[SMASHPoolId] pl
forM smashPids $ except . first getTextDecodingError . toPoolId
where
Expand Down

0 comments on commit 5737a43

Please sign in to comment.