Skip to content

Commit eb493fa

Browse files
committed
Fix url
1 parent 16ccbe8 commit eb493fa

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

cardano-db-sync/src/Cardano/DbSync/OffChain/Http.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import Cardano.DbSync.Types (
2222
OffChainUrlType (..),
2323
SimplifiedOffChainPoolData (..),
2424
SimplifiedOffChainVoteData (..),
25-
getUrl,
25+
showUrl,
2626
)
2727
import Cardano.DbSync.Util (renderByteArray)
2828
import Cardano.Prelude hiding (show)
@@ -182,7 +182,7 @@ isPossiblyJsonObject bs =
182182
-------------------------------------------------------------------------------------
183183
parseOffChainUrl :: OffChainUrlType -> ExceptT OffChainFetchError IO Http.Request
184184
parseOffChainUrl url =
185-
handleExceptT wrapHttpException $ applyContentType <$> Http.parseRequest (getUrl url)
185+
handleExceptT wrapHttpException $ applyContentType <$> Http.parseRequest (showUrl url)
186186
where
187187
wrapHttpException :: HttpException -> OffChainFetchError
188188
wrapHttpException err = OCFErrHttpException url (textShow err)

cardano-db-sync/src/Cardano/DbSync/Types.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module Cardano.DbSync.Types (
2828
SimplifiedOffChainVoteData (..),
2929
PraosStandard,
3030
Retry (..),
31-
getUrl,
31+
showUrl,
3232
) where
3333

3434
import Cardano.Db (
@@ -55,6 +55,7 @@ import qualified Cardano.Ledger.Hashes as Ledger
5555
import Cardano.Ledger.Keys
5656
import Cardano.Prelude hiding (Meta, show)
5757
import Cardano.Slotting.Slot (EpochNo (..), EpochSize (..), SlotNo (..))
58+
import qualified Data.Text as Text
5859
import Data.Time.Clock (UTCTime)
5960
import Data.Time.Clock.POSIX (POSIXTime)
6061
import qualified Ouroboros.Consensus.Cardano.Block as Cardano
@@ -202,13 +203,13 @@ data OffChainUrlType
202203
deriving (Eq, Generic)
203204

204205
instance Show OffChainUrlType where
205-
show = getUrl
206+
show = showUrl
206207

207-
getUrl :: OffChainUrlType -> String
208-
getUrl =
208+
showUrl :: OffChainUrlType -> String
209+
showUrl =
209210
\case
210-
OffChainPoolUrl url -> show url
211-
OffChainVoteUrl url -> show url
211+
OffChainPoolUrl url -> Text.unpack $ DB.unPoolUrl url
212+
OffChainVoteUrl url -> Text.unpack $ DB.unVoteUrl url
212213

213214
-------------------------------------------------------------------------------------
214215
-- OffChain Fetch error for the HTTP client fetching the pool offchain metadata.

0 commit comments

Comments
 (0)