diff --git a/cardano-testnet/testnet/Main.hs b/cardano-testnet/app/cardano-testnet.hs similarity index 90% rename from cardano-testnet/testnet/Main.hs rename to cardano-testnet/app/cardano-testnet.hs index df7baa036dd..5ef8ebdae16 100644 --- a/cardano-testnet/testnet/Main.hs +++ b/cardano-testnet/app/cardano-testnet.hs @@ -5,7 +5,7 @@ import Data.Function import Data.Semigroup import Options.Applicative import System.IO (IO) -import Testnet.Commands +import Parsers main :: IO () main = join $ customExecParser diff --git a/cardano-testnet/cardano-testnet.cabal b/cardano-testnet/cardano-testnet.cabal index 4bc76af7f84..07994cfcf7f 100644 --- a/cardano-testnet/cardano-testnet.cabal +++ b/cardano-testnet/cardano-testnet.cabal @@ -29,10 +29,12 @@ library import: base, project-config build-depends: aeson + , ansi-terminal , base16-bytestring , bytestring , cardano-api , cardano-cli + , cardano-git-rev , cardano-node , containers , directory @@ -42,18 +44,26 @@ library , hedgehog-extras , http-client , http-types + , optparse-applicative-fork , ouroboros-network , process , random , resourcet , safe-exceptions + , stm , text , time , transformers , unordered-containers hs-source-dirs: src - exposed-modules: Test.Assert + exposed-modules: Parsers + Parsers.Babbage + Parsers.Byron + Parsers.Cardano + Parsers.Shelley + Parsers.Version + Test.Assert Test.Base Test.Process Test.Runtime @@ -62,40 +72,24 @@ library Testnet.Byron Testnet.Cardano Testnet.Conf - Testnet.List + Testnet.Run Testnet.Shelley Testnet.SubmitApi Testnet.Utils + other-modules: Paths_cardano_testnet + + autogen-modules: Paths_cardano_testnet + executable cardano-testnet import: base, project-config - hs-source-dirs: testnet + hs-source-dirs: app - main-is: Main.hs + main-is: cardano-testnet.hs - build-depends: ansi-terminal - , cardano-git-rev - , cardano-testnet - , directory - , filepath - , hedgehog - , hedgehog-extras + build-depends: cardano-testnet , optparse-applicative-fork - , resourcet - , stm - , text - - other-modules: Paths_cardano_testnet - Testnet.Commands - Testnet.Commands.Babbage - Testnet.Commands.Byron - Testnet.Commands.Cardano - Testnet.Commands.Shelley - Testnet.Commands.Version - Testnet.Run - - autogen-modules: Paths_cardano_testnet ghc-options: -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-T diff --git a/cardano-testnet/testnet/Testnet/Commands.hs b/cardano-testnet/src/Parsers.hs similarity index 69% rename from cardano-testnet/testnet/Testnet/Commands.hs rename to cardano-testnet/src/Parsers.hs index 1fdea2c9d71..e47dcd9ba2f 100644 --- a/cardano-testnet/testnet/Testnet/Commands.hs +++ b/cardano-testnet/src/Parsers.hs @@ -1,14 +1,14 @@ -module Testnet.Commands where +module Parsers where import Data.Function import Data.Monoid import Options.Applicative import System.IO (IO) -import Testnet.Commands.Babbage -import Testnet.Commands.Byron -import Testnet.Commands.Cardano -import Testnet.Commands.Shelley -import Testnet.Commands.Version +import Parsers.Babbage +import Parsers.Byron +import Parsers.Cardano +import Parsers.Shelley +import Parsers.Version {- HLINT ignore "Monoid law, left identity" -} diff --git a/cardano-testnet/testnet/Testnet/Commands/Babbage.hs b/cardano-testnet/src/Parsers/Babbage.hs similarity index 98% rename from cardano-testnet/testnet/Testnet/Commands/Babbage.hs rename to cardano-testnet/src/Parsers/Babbage.hs index 2a102388b03..b0e109215e0 100644 --- a/cardano-testnet/testnet/Testnet/Commands/Babbage.hs +++ b/cardano-testnet/src/Parsers/Babbage.hs @@ -1,4 +1,4 @@ -module Testnet.Commands.Babbage +module Parsers.Babbage ( BabbageOptions(..) , cmdBabbage , runBabbageOptions diff --git a/cardano-testnet/testnet/Testnet/Commands/Byron.hs b/cardano-testnet/src/Parsers/Byron.hs similarity index 98% rename from cardano-testnet/testnet/Testnet/Commands/Byron.hs rename to cardano-testnet/src/Parsers/Byron.hs index 189d29d1d15..48ba97b4d07 100644 --- a/cardano-testnet/testnet/Testnet/Commands/Byron.hs +++ b/cardano-testnet/src/Parsers/Byron.hs @@ -1,4 +1,4 @@ -module Testnet.Commands.Byron +module Parsers.Byron ( ByronOptions(..) , cmdByron , runByronOptions diff --git a/cardano-testnet/testnet/Testnet/Commands/Cardano.hs b/cardano-testnet/src/Parsers/Cardano.hs similarity index 99% rename from cardano-testnet/testnet/Testnet/Commands/Cardano.hs rename to cardano-testnet/src/Parsers/Cardano.hs index 4222ee6fc27..55aaa667b2c 100644 --- a/cardano-testnet/testnet/Testnet/Commands/Cardano.hs +++ b/cardano-testnet/src/Parsers/Cardano.hs @@ -1,6 +1,6 @@ {-# LANGUAGE TypeApplications #-} -module Testnet.Commands.Cardano +module Parsers.Cardano ( CardanoOptions(..) , cmdCardano , runCardanoOptions diff --git a/cardano-testnet/testnet/Testnet/Commands/Shelley.hs b/cardano-testnet/src/Parsers/Shelley.hs similarity index 98% rename from cardano-testnet/testnet/Testnet/Commands/Shelley.hs rename to cardano-testnet/src/Parsers/Shelley.hs index a79a52fd73e..4c7461d76c8 100644 --- a/cardano-testnet/testnet/Testnet/Commands/Shelley.hs +++ b/cardano-testnet/src/Parsers/Shelley.hs @@ -1,4 +1,4 @@ -module Testnet.Commands.Shelley +module Parsers.Shelley ( ShelleyOptions(..) , cmdShelley , runShelleyOptions diff --git a/cardano-testnet/testnet/Testnet/Commands/Version.hs b/cardano-testnet/src/Parsers/Version.hs similarity index 97% rename from cardano-testnet/testnet/Testnet/Commands/Version.hs rename to cardano-testnet/src/Parsers/Version.hs index 7838a23ab01..86fac359f2f 100644 --- a/cardano-testnet/testnet/Testnet/Commands/Version.hs +++ b/cardano-testnet/src/Parsers/Version.hs @@ -1,4 +1,4 @@ -module Testnet.Commands.Version +module Parsers.Version ( VersionOptions(..) , cmdVersion , runVersionOptions diff --git a/cardano-testnet/src/Testnet/List.hs b/cardano-testnet/src/Testnet/List.hs deleted file mode 100644 index aa8b844ab3e..00000000000 --- a/cardano-testnet/src/Testnet/List.hs +++ /dev/null @@ -1,12 +0,0 @@ -module Testnet.List - ( dropNth - ) where - -import Data.Int -import GHC.Num - --- | Drop the zero-based n-th element from the list. -dropNth :: Int -> [a] -> [a] -dropNth _ [] = [] -dropNth 0 (_:as) = as -dropNth i (a:as) = a:dropNth (i - 1) as diff --git a/cardano-testnet/testnet/Testnet/Run.hs b/cardano-testnet/src/Testnet/Run.hs similarity index 100% rename from cardano-testnet/testnet/Testnet/Run.hs rename to cardano-testnet/src/Testnet/Run.hs