diff --git a/lib/network-layer/cardano-wallet-network-layer.cabal b/lib/network-layer/cardano-wallet-network-layer.cabal index d327d195fb6..d647afa603f 100644 --- a/lib/network-layer/cardano-wallet-network-layer.cabal +++ b/lib/network-layer/cardano-wallet-network-layer.cabal @@ -1,4 +1,4 @@ -cabal-version: 3.4 +cabal-version: 3.6 name: cardano-wallet-network-layer version: 0.1.0.0 synopsis: Node communication layer functionality. @@ -14,19 +14,39 @@ maintainer: hal@cardanofoundation.org category: Network build-type: Simple extra-doc-files: CHANGELOG.md - -- extra-source-files: -common warnings - ghc-options: -Wall +common language + default-language: + Haskell2010 + default-extensions: + NoImplicitPrelude + OverloadedStrings + +common opts-lib + ghc-options: -Wall -Wcompat -Wredundant-constraints + + if flag(release) + ghc-options: -O2 -Werror + +common opts-exe + import: opts-lib + ghc-options: -threaded -rtsopts + +flag release + description: Enable optimization and `-Werror` + default: False + manual: True library - import: warnings + import: language, opts-lib + hs-source-dirs: src exposed-modules: Cardano.Wallet.Network Cardano.Wallet.Network.Implementation Cardano.Wallet.Network.Implementation.Ouroboros Cardano.Wallet.Network.Implementation.UnliftIO + Cardano.Wallet.Network.Light Cardano.Wallet.Network.Logging Cardano.Wallet.Network.Logging.Aggregation @@ -73,5 +93,24 @@ library , unliftio , unliftio-core - hs-source-dirs: src - default-language: Haskell2010 +test-suite unit + import: language, opts-exe + type: exitcode-stdio-1.0 + hs-source-dirs: test + build-depends: + base + , bytestring + , cardano-wallet-network-layer + , cardano-wallet-primitive + , contra-tracer + , io-classes + , text + , transformers + , hspec + , QuickCheck + build-tool-depends: + hspec-discover:hspec-discover + main-is: + Main.hs + other-modules: + Cardano.Wallet.Network.LightSpec diff --git a/lib/network-layer/src/Cardano/Wallet/Network/Implementation/UnliftIO.hs b/lib/network-layer/src/Cardano/Wallet/Network/Implementation/UnliftIO.hs index b105cc9c6f7..8448b106ff6 100644 --- a/lib/network-layer/src/Cardano/Wallet/Network/Implementation/UnliftIO.hs +++ b/lib/network-layer/src/Cardano/Wallet/Network/Implementation/UnliftIO.hs @@ -4,6 +4,8 @@ module Cardano.Wallet.Network.Implementation.UnliftIO ) where +import Prelude + import qualified Control.Monad.Catch as Exceptions import qualified UnliftIO diff --git a/lib/wallet/src/Cardano/Wallet/Network/Light.hs b/lib/network-layer/src/Cardano/Wallet/Network/Light.hs similarity index 99% rename from lib/wallet/src/Cardano/Wallet/Network/Light.hs rename to lib/network-layer/src/Cardano/Wallet/Network/Light.hs index fc86eff1496..8b2d6e85f3d 100644 --- a/lib/wallet/src/Cardano/Wallet/Network/Light.hs +++ b/lib/network-layer/src/Cardano/Wallet/Network/Light.hs @@ -29,7 +29,7 @@ import Cardano.BM.Data.Tracer import Cardano.Wallet.Network ( ChainFollower (..) ) -import Cardano.Wallet.Primitive.Types +import Cardano.Wallet.Primitive.Types.Block ( BlockHeader (..) , ChainPoint (..) , chainPointFromBlockHeader diff --git a/lib/unit/test/unit/Cardano/Wallet/Network/LightSpec.hs b/lib/network-layer/test/Cardano/Wallet/Network/LightSpec.hs similarity index 99% rename from lib/unit/test/unit/Cardano/Wallet/Network/LightSpec.hs rename to lib/network-layer/test/Cardano/Wallet/Network/LightSpec.hs index b7a0f9ac5d0..853da6d51d8 100644 --- a/lib/unit/test/unit/Cardano/Wallet/Network/LightSpec.hs +++ b/lib/network-layer/test/Cardano/Wallet/Network/LightSpec.hs @@ -22,7 +22,7 @@ import Cardano.Wallet.Network.Light , hoistLightSyncSource , lightSync ) -import Cardano.Wallet.Primitive.Types +import Cardano.Wallet.Primitive.Types.Block ( BlockHeader (..) , ChainPoint (..) , chainPointFromBlockHeader diff --git a/lib/network-layer/test/Main.hs b/lib/network-layer/test/Main.hs index 3e2059e31f5..a824f8c30c8 100644 --- a/lib/network-layer/test/Main.hs +++ b/lib/network-layer/test/Main.hs @@ -1,4 +1 @@ -module Main (main) where - -main :: IO () -main = putStrLn "Test suite not yet implemented." +{-# OPTIONS_GHC -F -pgmF hspec-discover #-} diff --git a/lib/unit/cardano-wallet-unit.cabal b/lib/unit/cardano-wallet-unit.cabal index 3a54586c6db..38bf15f320e 100644 --- a/lib/unit/cardano-wallet-unit.cabal +++ b/lib/unit/cardano-wallet-unit.cabal @@ -240,7 +240,6 @@ test-suite unit Cardano.Wallet.DB.Store.WalletState.StoreSpec Cardano.Wallet.Delegation.ModelSpec Cardano.Wallet.DelegationSpec - Cardano.Wallet.Network.LightSpec Cardano.Wallet.Network.PortsSpec Cardano.Wallet.NetworkSpec Cardano.Wallet.Primitive.Delegation.StateSpec diff --git a/lib/wallet/cardano-wallet.cabal b/lib/wallet/cardano-wallet.cabal index a12ac77e24d..a40d7aa01b4 100644 --- a/lib/wallet/cardano-wallet.cabal +++ b/lib/wallet/cardano-wallet.cabal @@ -220,7 +220,6 @@ library Cardano.Wallet.Flavor Cardano.Wallet.Gen Cardano.Wallet.Network.Config - Cardano.Wallet.Network.Light Cardano.Wallet.Pools Cardano.Wallet.Primitive.Delegation.State Cardano.Wallet.Primitive.Delegation.UTxO