Skip to content

Commit

Permalink
Merge #2610
Browse files Browse the repository at this point in the history
2610: No implicit prelude for cardano-submit-api r=newhoggy a=newhoggy



Co-authored-by: John Ky <john.ky@iohk.io>
  • Loading branch information
iohk-bors[bot] and newhoggy authored Apr 15, 2021
2 parents 3c5900f + 7da0eab commit 186c04e
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cardano-submit-api/app/Main.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Main where

import Cardano.TxSubmit (opts, runTxSubmitWebapi)
import Control.Monad ((=<<))
import System.IO (IO)

import qualified Options.Applicative as Opt

Expand Down
7 changes: 5 additions & 2 deletions cardano-submit-api/cardano-submit-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ common project-config
default-language: Haskell2010

ghc-options: -Wall
-fwarn-incomplete-patterns
-fwarn-redundant-constraints
-Wcompat
-Werror
-Wincomplete-record-updates
Expand All @@ -61,6 +59,11 @@ common project-config
-Wno-unsafe
-Wunused-packages

-XNoImplicitPrelude

-fwarn-incomplete-patterns
-fwarn-redundant-constraints

library
import: base, project-config
, aeson
Expand Down
1 change: 1 addition & 0 deletions cardano-submit-api/src/Cardano/TxSubmit/CLI/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Cardano.TxSubmit.CLI.Types

import Cardano.Api (AnyConsensusModeParams, NetworkId (..))
import Cardano.TxSubmit.Rest.Types (WebserverConfig)
import System.IO (FilePath)

-- | The product type of all command line arguments
data TxSubmitNodeParams = TxSubmitNodeParams
Expand Down
3 changes: 3 additions & 0 deletions cardano-submit-api/src/Cardano/TxSubmit/ErrorRender.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ module Cardano.TxSubmit.ErrorRender
import Cardano.Chain.Byron.API (ApplyMempoolPayloadErr (..))
import Cardano.Chain.UTxO.UTxO (UTxOError (..))
import Cardano.Chain.UTxO.Validation (TxValidationError (..), UTxOValidationError (..))
import Data.Function ((.))
import Data.Monoid (Monoid (mconcat), (<>))
import Data.Text (Text)
import Formatting (build, sformat, stext, (%))
import Ouroboros.Consensus.Cardano.Block (EraMismatch (..))
import Text.Show (Show (show))

import qualified Data.Text as T

Expand Down
3 changes: 3 additions & 0 deletions cardano-submit-api/src/Cardano/TxSubmit/Rest/Parsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ module Cardano.TxSubmit.Rest.Parsers
) where

import Cardano.TxSubmit.Rest.Types (WebserverConfig (..))
import Control.Applicative (Applicative (pure), (<$>))
import Data.Function (($))
import Data.Semigroup ((<>))
import Data.String (fromString)
import Network.Wai.Handler.Warp (HostPreference, Port)
import Options.Applicative (Parser, auto, help, long, metavar, option, showDefault,
Expand Down
2 changes: 2 additions & 0 deletions cardano-submit-api/src/Cardano/TxSubmit/Rest/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module Cardano.TxSubmit.Rest.Types
) where

import Data.Function ((&))
import Data.Semigroup ((<>))
import Text.Show (Show (..))

import qualified Network.Wai.Handler.Warp as Warp

Expand Down
4 changes: 4 additions & 0 deletions cardano-submit-api/src/Cardano/TxSubmit/Rest/Web.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ module Cardano.TxSubmit.Rest.Web

import Cardano.BM.Trace (Trace, logInfo)
import Control.Exception (bracket)
import Data.Function (($))
import Data.Semigroup ((<>))
import Data.Streaming.Network (bindPortTCP)
import Data.Text (Text)
import Network.Socket (close, getSocketName, withSocketsDo)
import Network.Wai.Handler.Warp (Settings, getHost, getPort, runSettingsSocket)
import Servant (Application)
import System.IO (IO)
import Text.Show (Show (..))

import qualified Data.Text as T

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ import Cardano.BM.Data.Tracer (HasPrivacyAnnotation, HasSeverityAnnota
HasTextFormatter, ToObject (toObject), Transformable (..), mkObject,
trStructured)
import Data.Aeson ((.=))
import Data.String (String)
import Data.Text (Text)
import Ouroboros.Network.NodeToClient (ErrorPolicyTrace (..), WithAddr (..))
import System.IO (IO)
import Text.Show (Show (..))

import qualified Network.Socket as Socket

Expand Down
7 changes: 7 additions & 0 deletions cardano-submit-api/src/Cardano/TxSubmit/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ import Cardano.Binary (DecoderError)
import Cardano.TxSubmit.Util (textShow)
import Data.Aeson (ToJSON (..), Value (..))
import Data.ByteString.Char8 (ByteString)
import Data.Either (Either (Right))
import Data.Eq (Eq (..))
import Data.Function (id, (.))
import Data.Functor (Functor (fmap))
import Data.Int (Int)
import Data.Monoid (Monoid (mconcat), (<>))
import Data.Text (Text)
import Formatting (build, sformat)
import GHC.Generics (Generic)
Expand All @@ -28,6 +34,7 @@ import Ouroboros.Consensus.Cardano.Block (EraMismatch (..))
import Servant (Accept (..), JSON, MimeRender (..), MimeUnrender (..), PostAccepted,
ReqBody, (:>))
import Servant.API.Generic (ToServantApi, (:-))
import Text.Show (Show (..))

import qualified Data.ByteString.Lazy.Char8 as LBS
import qualified Data.List as L
Expand Down
11 changes: 9 additions & 2 deletions cardano-submit-api/src/Cardano/TxSubmit/Web.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import Cardano.TxSubmit.Types (EnvSocketError (..), RawCborDecodeError
TxSubmitApi, TxSubmitApiRecord (..), TxSubmitWebApiError (TxSubmitFail),
renderTxCmdError)
import Cardano.TxSubmit.Util (logException)
import Control.Applicative (Applicative (pure), (<$>))
import Control.Monad (Functor (fmap), Monad (return), (=<<))
import Control.Monad.Except (ExceptT, MonadError (throwError), MonadIO (liftIO),
runExceptT)
import Control.Monad.IO.Class (liftIO)
Expand All @@ -38,15 +40,20 @@ import Control.Monad.Trans.Except.Extra (firstExceptT, handleIOExceptT
import Data.Aeson (ToJSON (..))
import Data.Bifunctor (first, second)
import Data.ByteString.Char8 (ByteString)
import Data.Either (isRight, lefts, partitionEithers, rights)
import Data.Maybe (listToMaybe)
import Data.Either (Either (..), partitionEithers)
import Data.Function (($), (.))
import Data.Maybe (listToMaybe, maybe)
import Data.Proxy (Proxy (..))
import Data.Semigroup (Semigroup ((<>)))
import Data.String (String)
import Data.Text (Text)
import Ouroboros.Consensus.Cardano.Block (EraMismatch (..))
import Servant (Application, Handler, ServerError (..), err400, throwError)
import Servant.API.Generic (toServant)
import Servant.Server.Generic (AsServerT)
import System.Environment (lookupEnv)
import System.IO (IO)
import Text.Show (Show (show))

import qualified Cardano.Crypto.Hash.Class as Crypto
import qualified Cardano.TxSubmit.Rest.Web as Web
Expand Down
6 changes: 5 additions & 1 deletion cardano-submit-api/test/test.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

import System.IO (IO)

import qualified System.IO as IO

main :: IO ()
main = putStrLn "cardano-tx-submit test"
main = IO.putStrLn "cardano-tx-submit test"

0 comments on commit 186c04e

Please sign in to comment.