Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump GHC to version 9.8.2 #4930

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
30 changes: 25 additions & 5 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ packages:
source-repository-package
type: git
location: https://github.com/biocad/servant-openapi3
tag: 4165b837d3a71debd1059c3735460075840000b5
--sha256: 1dngrr353kjhmwhn0b289jzqz5rf32llwcv79zcyq15ldpqpbib9
tag: 10c45b4e302567d7491cd0371317e52bf823b71c
--sha256: 1py1pip77q9qq5v49kpdpbp7p6yxyd0kwjn9c9bh9igp9p1d00a4

-- TODO: ADP-1713
source-repository-package
type: git
location: https://github.com/paolino/openapi3
tag: f22c31611c295637a3e72b341cd1c56d1d87b993
--sha256: 10l7wlaz9rcr3fysi1vwg7qqa826bb7nidkpx9jy1q7ja7ddw47i
tag: fab96d6d1df46418aa4658a7d6f60bf9f045b6dd
--sha256: 19wi7rhvb840j2ypmdfblpqk2yh11ac85x2r3y3406nml443f66k

-- END OpenAPI
--------------------------------------------------------------------------------
Expand Down Expand Up @@ -163,6 +163,26 @@ source-repository-package
lib/cardano-wallet-read

--------------------------------------------------------------------------------

source-repository-package
type: git
location: https://github.com/jonathanknowles/fgl.git
tag: d55661c79ca0bb451d7dc7e8d8b99d4f80108c10
--sha256: 0kkw3w37bxwaam9ynmvf4z315ms99ddbmz45k2wlnpq2dp7dha50

source-repository-package
type: git
location: https://github.com/jonathanknowles/wai.git
tag: 5ad3d1a5d472f398ded8817b0befc221a7a84cef
--sha256: 1nlbsqar46i9yzl8j5i8wwmya34n82b9zcnik27q3n43rxnvi1ri
subdir: wai-app-static

source-repository-package
type: git
location: https://github.com/paolino/int-cast.git
tag: 0232b037552a4247b4a7ac21f816cc77cc95f7a4
--sha256: 1pmghd9pz35ycxp0c3f5sz4fghfi6ywjmp6wm9n45f8l5ah9vhhw

-- BEGIN Constraints tweaking section

allow-newer:
Expand All @@ -172,7 +192,7 @@ allow-newer:
, ekg-wai:time

constraints:
base >= 4.18.2.0 && < 5
bimap >= 0.4.0
, openapi3 >= 3.2.0
, persistent ^>= 2.14.6.0

Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
cardano-cli = windowsPackages.cardano-cli;
cardano-node = windowsPackages.cardano-node;
tests = lib.collect lib.isDerivation windowsPackages.tests;
benchmarks = lib.collect lib.isDerivation windowsPackages.benchmarks;
# benchmarks = lib.collect lib.isDerivation windowsPackages.benchmarks;
};
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}

{-# OPTIONS_GHC -Wno-x-partial #-}
-- |
-- Copyright: © 2018-2020 IOHK
-- License: Apache-2.0
Expand Down
1 change: 1 addition & 0 deletions lib/api/src/Cardano/Wallet/Api/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}

{-# OPTIONS_GHC -fno-warn-orphans #-}
-- |
-- Copyright: © 2018-2020 IOHK
-- License: Apache-2.0
Expand Down
6 changes: 2 additions & 4 deletions lib/api/src/Cardano/Wallet/Api/Http/Shelley/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ import Cardano.Wallet.Address.Derivation
, stakeDerivationPath
)
import Cardano.Wallet.Address.Derivation.Byron
( ByronKey
, mkByronKeyFromMasterKey
( mkByronKeyFromMasterKey
)
import Cardano.Wallet.Address.Derivation.Icarus
( IcarusKey
Expand Down Expand Up @@ -1531,10 +1530,9 @@ mkLegacyWallet ctx wid cp meta _ pending progress = do
W.withRootKey @s db wid mempty Prelude.id (\_ _ -> pure ())

postRandomWallet
:: forall ctx s k n.
:: forall ctx s n.
( ctx ~ ApiLayer s
, s ~ RndState n
, k ~ ByronKey
)
=> ctx
-> ByronWalletPostData '[12,15,18,21,24]
Expand Down
1 change: 1 addition & 0 deletions lib/balance-tx/lib/main/Cardano/Write/Tx.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE DuplicateRecordFields #-}
-- |
-- Copyright: © 2023-2024 Cardano Foundation
-- License: Apache-2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ViewPatterns #-}

{-# OPTIONS_GHC -Wno-x-partial #-}
{- HLINT ignore "Use null" -}
{- HLINT ignore "Use camelCase" -}

Expand Down
1 change: 1 addition & 0 deletions lib/benchmarks/exe/db-bench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# OPTIONS_GHC -Wno-x-partial #-}

{-# OPTIONS_GHC -Wno-ambiguous-fields #-}

Expand Down
1 change: 0 additions & 1 deletion lib/customer-deposit-wallet/customer-deposit-wallet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ test-suite scenario
, customer-deposit-wallet
, delta-store
, hspec

other-modules:
Test.Scenario.Blockchain
Test.Scenario.Wallet.Deposit.Exchanges
Expand Down
2 changes: 2 additions & 0 deletions lib/delta-store/src/Test/Store.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ViewPatterns #-}

{-# OPTIONS_GHC -Wno-x-partial #-}

-- |
-- Copyright: © 2023 IOHK
-- License: Apache-2.0
Expand Down
3 changes: 0 additions & 3 deletions lib/exe/cardano-wallet-exe.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ executable cardano-wallet
import: language, opts-exe
main-is: cardano-wallet.hs

-- other-modules:
-- other-extensions:
build-depends: base ^>=4.18.2.0
hs-source-dirs: app
default-language: Haskell2010
build-depends:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

{-# OPTIONS_GHC -Wno-x-partial #-}

module Test.Integration.Framework.DSL.Wallet
( createARandomWalletWithMnemonics
, createWalletFromMnemonics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}

{-# OPTIONS_GHC -Wno-x-partial #-}

module Test.Integration.Scenario.API.Byron.Migrations
( spec
) where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}

{-# OPTIONS_GHC -Wno-x-partial #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}

{-# OPTIONS_GHC -Wno-x-partial #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NumericUnderscores #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}

{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# OPTIONS_GHC -Wno-x-partial #-}

module Test.Integration.Scenario.API.Shelley.Addresses
( spec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}

{-# OPTIONS_GHC -Wno-x-partial #-}

module Test.Integration.Scenario.API.Shelley.Migrations
( spec
) where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}

{-# OPTIONS_GHC -Wno-x-partial #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}

module Test.Integration.Scenario.API.Shelley.StakePools (spec) where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}

{-# OPTIONS_GHC -Wno-x-partial #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}

{- HLINT ignore "Use head" -}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}

{-# OPTIONS_GHC -Wno-x-partial #-}
{-# OPTIONS_GHC -Wno-unused-imports #-} -- temportary, until addRequiredSigners is fixed
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}

{-# OPTIONS_GHC -Wno-x-partial #-}

module Test.Integration.Scenario.API.Shelley.Wallets
( spec
) where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE ScopedTypeVariables #-}

{-# OPTIONS_GHC -Wno-x-partial #-}

module Cardano.Wallet.Launch.Cluster.CommandLine
( CommandLineOptions (..)
, WalletPresence (..)
Expand Down
2 changes: 2 additions & 0 deletions lib/network-layer/src/Cardano/Wallet/Network/Light.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}

{-# OPTIONS_GHC -Wno-x-partial #-}

module Cardano.Wallet.Network.Light
( -- * Interface
LightSyncSource (..)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}

module Cardano.Wallet.Primitive.Types.Address.Gen
(
-- * Generators and shrinkers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}

module Cardano.Wallet.Primitive.Types.AssetName.Gen
(
-- * Generators and shrinkers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,99 @@ instance ToJSON TxMetadataValue where

instance FromJSON TxMetadataValue where
parseJSON = either (fail . displayError) pure . metadataValueFromJsonNoSchema

-- when cardano-api exports metadataValueFromJsonNoSchema the below could be removed (together with cabal dependencies)
metadataValueFromJsonNoSchema
:: Aeson.Value
-> Either TxMetadataJsonSchemaError TxMetadataValue
metadataValueFromJsonNoSchema = conv
where
conv :: Aeson.Value -> Either TxMetadataJsonSchemaError TxMetadataValue
conv Aeson.Null = Left TxMetadataJsonNullNotAllowed
conv Aeson.Bool{} = Left TxMetadataJsonBoolNotAllowed

conv (Aeson.Number d) =
case Scientific.floatingOrInteger d :: Either Double Integer of
Left n -> Left (TxMetadataJsonNumberNotInteger n)
Right n -> Right (TxMetaNumber n)

conv (Aeson.String s)
| Just s' <- T.stripPrefix bytesPrefix s
, let bs' = T.encodeUtf8 s'
, Right bs <- B16.decode bs'
, not (B8.any (\c -> c >= 'A' && c <= 'F') bs')
= Right (TxMetaBytes bs)

conv (Aeson.String s) = Right (TxMetaText s)

conv (Aeson.Array vs) =
fmap TxMetaList
. traverse conv
$ V.toList vs

conv (Aeson.Object kvs) =
fmap
( TxMetaMap
. sortCanonicalForCbor
)
. traverse
((\(k, v) -> (,) (convKey k) <$> conv v) . first Aeson.toText)
$ Aeson.toList kvs

convKey :: Text -> TxMetadataValue
convKey s =
fromMaybe (TxMetaText s) $
parseAll ((fmap TxMetaNumber pSigned <* Atto.endOfInput)
<|> (fmap TxMetaBytes pBytes <* Atto.endOfInput)) s

bytesPrefix :: Text
bytesPrefix = "0x"

parseAll :: Atto.Parser a -> Text -> Maybe a
parseAll p =
either (const Nothing) Just
. Atto.parseOnly p
. T.encodeUtf8

pUnsigned :: Atto.Parser Integer
pUnsigned = do
bs <- Atto.takeWhile1 Atto.isDigit
-- no redundant leading 0s allowed, or we cannot round-trip properly
guard (not (BS.length bs > 1 && B8.head bs == '0'))
return $! BS.foldl' step 0 bs
where
step a w = a * 10 + fromIntegral (w - 48)

pSigned :: Atto.Parser Integer
pSigned = Atto.signed pUnsigned

pBytes :: Atto.Parser ByteString
pBytes = do
_ <- Atto.string "0x"
remaining <- Atto.takeByteString
when (B8.any hexUpper remaining) $ fail ("Unexpected uppercase hex characters in " <> show remaining)
case B16.decode remaining of
Right bs -> return bs
_ -> fail ("Expecting base16 encoded string, found: " <> show remaining)
where
hexUpper c = c >= 'A' && c <= 'F'

sortCanonicalForCbor
:: [(TxMetadataValue, TxMetadataValue)] -> [(TxMetadataValue, TxMetadataValue)]
sortCanonicalForCbor =
map snd
. L.sortOn fst
. map (\e@(k, _) -> (CBOR.uintegerFromBytes $ serialiseKey k, e))
where
serialiseKey = CBOR.serialize' CBOR.shelleyProtVer . toShelleyMetadatum

toShelleyMetadatum :: TxMetadataValue -> Ledger.Metadatum
toShelleyMetadatum (TxMetaNumber x) = Ledger.I x
toShelleyMetadatum (TxMetaBytes x) = Ledger.B x
toShelleyMetadatum (TxMetaText x) = Ledger.S x
toShelleyMetadatum (TxMetaList xs) =
Ledger.List [ toShelleyMetadatum x | x <- xs ]
toShelleyMetadatum (TxMetaMap xs) =
Ledger.Map [ (toShelleyMetadatum k,
toShelleyMetadatum v)
| (k,v) <- xs ]
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}

module Cardano.Wallet.Primitive.Types.RewardAccount.Gen
( genRewardAccount
, shrinkRewardAccount
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}

module Cardano.Wallet.Primitive.Types.TokenPolicyId.Gen
(
-- * Generators and shrinkers
Expand Down
2 changes: 1 addition & 1 deletion lib/primitive/lib/Cardano/Wallet/Primitive/Types/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ data TxChange derivationPath = TxChange
, amount :: Coin
, assets :: TokenMap
, derivationPath :: derivationPath
} deriving (Show, Generic, Eq, Ord)
} deriving (Show, Generic, Eq)

{-------------------------------------------------------------------------------
Conversions (Unsafe)
Expand Down
Loading
Loading