Skip to content

Commit

Permalink
Remove some deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd authored and jonathanknowles committed Mar 16, 2023
1 parent d2f87f7 commit 66e9a34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
14 changes: 8 additions & 6 deletions lib/wallet/src/Cardano/Wallet/DB/Sqlite/Types.hs
Expand Up @@ -8,9 +8,6 @@

{-# OPTIONS_GHC -fno-warn-orphans #-}

-- TODO: https://input-output.atlassian.net/browse/ADP-2841
{-# OPTIONS_GHC -fno-warn-deprecations #-}

-- |
-- Copyright: © 2018-2020 IOHK
-- License: Apache-2.0
Expand Down Expand Up @@ -112,7 +109,7 @@ import Data.Text.Encoding
import Data.Time.Clock.POSIX
( POSIXTime, posixSecondsToUTCTime, utcTimeToPOSIXSeconds )
import Data.Time.Format
( defaultTimeLocale, formatTime, iso8601DateFormat, parseTimeM )
( defaultTimeLocale, formatTime, parseTimeM )
import Data.Word
( Word32, Word64 )
import Data.Word.Odd
Expand Down Expand Up @@ -710,12 +707,12 @@ instance PersistFieldSql TxScriptValidity where
instance PersistField POSIXTime where
toPersistValue = PersistText
. T.pack
. formatTime defaultTimeLocale (iso8601DateFormat (Just "%H:%M:%S"))
. formatTime defaultTimeLocale iso8601DateFormatHMS
. posixSecondsToUTCTime
fromPersistValue (PersistText time) =
utcTimeToPOSIXSeconds <$>
getEitherText (parseTimeM True defaultTimeLocale
(iso8601DateFormat (Just "%H:%M:%S")) (T.unpack time))
iso8601DateFormatHMS (T.unpack time))
fromPersistValue _ = Left
"Could not parse POSIX time value"

Expand Down Expand Up @@ -751,3 +748,8 @@ instance PersistField BlockHeight where

instance PersistFieldSql BlockHeight where
sqlType _ = sqlType (Proxy @Word32)

iso8601DateFormatHMS :: String
-- Equivalent to `iso8601DateFormatHMS (Just "%H:%M:%S")`
-- The function `iso8601DateFormatHMS` has been deprecated from the `time` library.
iso8601DateFormatHMS = "%Y-%m-%d %H:%M:%S"
11 changes: 1 addition & 10 deletions lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs
Expand Up @@ -24,9 +24,6 @@
{-# LANGUAGE ViewPatterns #-}
{- HLINT ignore "Use <$>" -}

-- TODO: https://input-output.atlassian.net/browse/ADP-2841
{-# OPTIONS_GHC -fno-warn-deprecations #-}

-- |
-- Copyright: © 2020 IOHK
-- License: Apache-2.0
Expand Down Expand Up @@ -2427,14 +2424,8 @@ mkUnsignedTx
-> Map AssetId (Script KeyHash)
-> Map TxIn (Script KeyHash)
-> Either ErrMkTransaction (Cardano.TxBody era)
-- mkUnsignedTx
-- era ttl cs md wdrls certs fees mintData burnData mintingScripts inpsScripts =
-- left toErrMkTx $ fmap removeDummyInput $ Cardano.createAndValidateTransactionBody
mkUnsignedTx era ttl cs md wdrls certs fees mintData burnData mintingScripts inpsScripts = extractValidatedOutputs cs >>= \outs ->
left toErrMkTx $ fmap removeDummyInput $ Cardano.makeTransactionBody
-- mkUnsignedTx
-- era ttl cs md wdrls certs fees mintData burnData mintingScripts inpsScripts =
-- left toErrMkTx $ fmap removeDummyInput $ Cardano.createAndValidateTransactionBody
left toErrMkTx $ fmap removeDummyInput $ Cardano.createAndValidateTransactionBody
Cardano.TxBodyContent
{ Cardano.txIns = inputWits

Expand Down

0 comments on commit 66e9a34

Please sign in to comment.