Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3142 from input-output-hk/ruhatch/CDEC-383
Browse files Browse the repository at this point in the history
[CDEC-383] Add stylish-haskell to nix and CI
  • Loading branch information
erikd authored Jun 27, 2018
2 parents a3c3f14 + f00e32a commit 3871fd5
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 34 deletions.
5 changes: 2 additions & 3 deletions bench/Client/Cardano/Wallet/Web/Endpoint/NewWallet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ import Universum
import Data.Time.Clock (getCurrentTime)

import Bench.Cardano.Wallet.Types (BenchEndpoint (..), CompleteConfig (..), Response,
ResponseReport (..))
ResponseReport (..))
import Client.Cardano.Wallet.Web.Analyze (analyzeResponseIfNeeded, checkResponse)
import Client.Cardano.Wallet.Web.Api (newWallet)
import Client.Cardano.Wallet.Web.Run (runEndpointClient)
import Pos.Util.Mnemonic (Mnemonic, entropyToMnemonic, genEntropy)
import Pos.Wallet.Web.ClientTypes (CBackupPhrase (..), CWallet (..),
CWalletAssurance (..), CWalletInit (..),
CWalletMeta (..))
CWalletAssurance (..), CWalletInit (..), CWalletMeta (..))

-- | Run 'NewWallet' client. As a result we will get a newly created wallet.
newWalletIO :: CompleteConfig -> IO ()
Expand Down
13 changes: 6 additions & 7 deletions server/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ import Pos.DB.DB (initNodeDBs)
import Pos.Infra.Diffusion.Types (Diffusion)
import Pos.Infra.Ntp.Configuration (NtpConfiguration, ntpClientSettings)
import Pos.Launcher (NodeParams (..), NodeResources (..), bpLoggingParams,
bracketNodeResources, loggerBracket, lpDefaultName, runNode,
withConfigurations)
bracketNodeResources, loggerBracket, lpDefaultName, runNode,
withConfigurations)
import Pos.Launcher.Configuration (AssetLockPath (..), ConfigurationOptions,
HasConfigurations)
HasConfigurations)
import Pos.Ssc.Types (SscParams)
import Pos.Txp (txpGlobalSettings)
import Pos.Util (logException)
import Pos.Util.CompileInfo (HasCompileInfo, withCompileInfo)
import Pos.Util.UserSecret (usVss)
import Pos.Wallet.Web (bracketWalletWS, bracketWalletWebDB, getSKById, getWalletAddresses,
runWRealMode)
runWRealMode)
import Pos.Wallet.Web.Mode (WalletWebMode)
import Pos.Wallet.Web.State (askWalletDB, askWalletSnapshot, flushWalletStorage)
import Pos.Wallet.Web.Tracking.Decrypt (eskToWalletDecrCredentials)
Expand All @@ -40,9 +40,8 @@ import qualified Cardano.Wallet.Kernel.Mode as Kernel.Mode

import Cardano.Wallet.Kernel (PassiveWallet)
import Cardano.Wallet.Server.CLI (ChooseWalletBackend (..), NewWalletBackendParams (..),
WalletBackendParams (..), WalletStartupOptions (..),
getWalletNodeOptions, walletDbPath, walletFlushDb,
walletRebuildDb)
WalletBackendParams (..), WalletStartupOptions (..), getWalletNodeOptions,
walletDbPath, walletFlushDb, walletRebuildDb)
import qualified Cardano.Wallet.Server.Plugins as Plugins
import Cardano.Wallet.WalletLayer (PassiveWalletLayer, bracketKernelPassiveWallet)

Expand Down
4 changes: 2 additions & 2 deletions src/Cardano/Wallet/API/V1/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ import qualified Pos.Core as Core
import Pos.Crypto (decodeHash, hashHexF)
import qualified Pos.Crypto.Signing as Core
import Pos.Infra.Diffusion.Subscription.Status (SubscriptionStatus (..))
import Pos.Infra.Util.LogSafe (BuildableSafeGen (..), SecureLog (..), buildSafe, buildSafeList,
buildSafeMaybe, deriveSafeBuildable, plainOrSecureF)
import Pos.Infra.Util.LogSafe (BuildableSafeGen (..), SecureLog (..), buildSafe,
buildSafeList, buildSafeMaybe, deriveSafeBuildable, plainOrSecureF)
import qualified Pos.Wallet.Web.State.Storage as OldStorage

import Test.Pos.Core.Arbitrary ()
Expand Down
10 changes: 4 additions & 6 deletions src/Cardano/Wallet/Kernel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ import Data.Acid.Memory (openMemoryState)

import Cardano.Wallet.Kernel.Diffusion (WalletDiffusion (..))
import Cardano.Wallet.Kernel.PrefilterTx (PrefilteredBlock (..), prefilterBlock,
prefilterUtxo)
prefilterUtxo)
import Cardano.Wallet.Kernel.Types (WalletESKs, WalletId (..))

import Cardano.Wallet.Kernel.DB.AcidState (ApplyBlock (..), CancelPending (..),
CreateHdWallet (..), DB, NewPending (..),
NewPendingError, Snapshot (..), dbHdWallets,
defDB)
CreateHdWallet (..), DB, NewPending (..), NewPendingError, Snapshot (..),
dbHdWallets, defDB)
import Cardano.Wallet.Kernel.DB.BlockMeta (BlockMeta (..))
import Cardano.Wallet.Kernel.DB.HdWallet
import qualified Cardano.Wallet.Kernel.DB.HdWallet as HD
Expand All @@ -61,8 +60,7 @@ import Cardano.Wallet.Kernel.DB.Resolved (ResolvedBlock)
import Cardano.Wallet.Kernel.DB.Spec (singletonPending)
import qualified Cardano.Wallet.Kernel.DB.Spec.Read as Spec
import Cardano.Wallet.Kernel.Submission (Cancelled, WalletSubmission, addPending,
defaultResubmitFunction, exponentialBackoff,
newWalletSubmission, tick)
defaultResubmitFunction, exponentialBackoff, newWalletSubmission, tick)
import Cardano.Wallet.Kernel.Submission.Worker (tickSubmissionLayer)

import Pos.Core (AddressHash, Coin, Timestamp (..), TxAux (..))
Expand Down
2 changes: 1 addition & 1 deletion src/Cardano/Wallet/Kernel/DB/AcidState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import Pos.Core.Chrono (OldestFirst (..))
import Pos.Txp (Utxo)

import Cardano.Wallet.Kernel.PrefilterTx (AddrWithId, PrefilteredBlock (..),
PrefilteredUtxo)
PrefilteredUtxo)

import Cardano.Wallet.Kernel.DB.BlockMeta
import Cardano.Wallet.Kernel.DB.HdWallet
Expand Down
2 changes: 1 addition & 1 deletion src/Cardano/Wallet/Kernel/Submission.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import Test.QuickCheck
import Cardano.Wallet.Kernel.DB.HdWallet (HdAccountId)
import Cardano.Wallet.Kernel.DB.InDb (fromDb)
import Cardano.Wallet.Kernel.DB.Spec (Pending (..), emptyPending, pendingTransactions,
removePending, unionPending)
removePending, unionPending)
import qualified Pos.Core as Core

-- | Wallet Submission Layer
Expand Down
7 changes: 3 additions & 4 deletions src/Cardano/Wallet/Server/Plugins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ import qualified Cardano.Wallet.Kernel.Mode as Kernel
import qualified Cardano.Wallet.LegacyServer as LegacyServer
import qualified Cardano.Wallet.Server as Server
import Cardano.Wallet.Server.CLI (NewWalletBackendParams (..), RunMode,
WalletBackendParams (..), isDebugMode,
walletAcidInterval, walletDbOptions)
WalletBackendParams (..), isDebugMode, walletAcidInterval, walletDbOptions)
import Cardano.Wallet.WalletLayer (ActiveWalletLayer, PassiveWalletLayer,
bracketKernelActiveWallet)
bracketKernelActiveWallet)
import qualified Pos.Wallet.Web.Error.Types as V0

import Control.Exception (fromException)
Expand All @@ -41,7 +40,7 @@ import Network.HTTP.Types.Status (badRequest400)
import Network.Wai (Application, Middleware, Response, responseLBS)
import Network.Wai.Handler.Warp (defaultSettings, setOnExceptionResponse)
import Network.Wai.Middleware.Cors (cors, corsMethods, corsRequestHeaders,
simpleCorsResourcePolicy, simpleMethods)
simpleCorsResourcePolicy, simpleMethods)
import Ntp.Client (NtpStatus)
import Pos.Infra.Diffusion.Types (Diffusion (..))
import Pos.Wallet.Web (cleanupAcidStatePeriodically)
Expand Down
2 changes: 1 addition & 1 deletion src/Cardano/Wallet/WalletLayer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import qualified Cardano.Wallet.WalletLayer.Kernel as Kernel
import qualified Cardano.Wallet.WalletLayer.Legacy as Legacy
import qualified Cardano.Wallet.WalletLayer.QuickCheck as QuickCheck
import Cardano.Wallet.WalletLayer.Types (ActiveWalletLayer (..), PassiveWalletLayer (..),
applyBlocks, rollbackBlocks)
applyBlocks, rollbackBlocks)

------------------------------------------------------------
-- Kernel
Expand Down
1 change: 0 additions & 1 deletion src/Cardano/Wallet/WalletLayer/Kernel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import Pos.Util.Mnemonic (Mnemonic, mnemonicToSeed)
import qualified Cardano.Wallet.Kernel.Actions as Actions
import qualified Data.Map.Strict as Map
import Pos.Crypto.Signing
import Pos.Util.BackupPhrase

-- | Initialize the passive wallet.
-- The passive wallet cannot send new transactions.
Expand Down
8 changes: 4 additions & 4 deletions src/Cardano/Wallet/WalletLayer/Legacy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import Cardano.Wallet.WalletLayer.Types (ActiveWalletLayer (..), Passi
import Cardano.Wallet.API.V1.Migration (migrate)
import Cardano.Wallet.API.V1.Migration.Types ()
import Cardano.Wallet.API.V1.Types (Account, AccountIndex, AccountUpdate, Address,
NewAccount (..), NewWallet (..), V1 (..), Wallet,
WalletId, WalletOperation (..), WalletUpdate)
NewAccount (..), NewWallet (..), V1 (..), Wallet, WalletId,
WalletOperation (..), WalletUpdate)
import Cardano.Wallet.Kernel.Diffusion (WalletDiffusion (..))

import Pos.Client.KeyStorage (MonadKeys)
Expand All @@ -30,13 +30,13 @@ import Pos.Crypto (PassPhrase)
import Pos.Util (HasLens', maybeThrow)
import Pos.Wallet.Web.Account (GenSeed (..))
import Pos.Wallet.Web.ClientTypes.Types (CBackupPhrase (..), CWallet (..),
CWalletInit (..), CWalletMeta (..))
CWalletInit (..), CWalletMeta (..))
import qualified Pos.Wallet.Web.Error.Types as V0
import Pos.Wallet.Web.Methods.Logic (MonadWalletLogicRead)
import qualified Pos.Wallet.Web.Methods.Logic as V0
import Pos.Wallet.Web.Methods.Restore (newWallet, restoreWalletFromSeed)
import Pos.Wallet.Web.State.State (WalletDbReader, askWalletDB, askWalletSnapshot,
getWalletAddresses, setWalletMeta)
getWalletAddresses, setWalletMeta)
import Pos.Wallet.Web.State.Storage (getWalletInfo)
import Pos.Wallet.Web.Tracking.Types (SyncQueue)

Expand Down
2 changes: 1 addition & 1 deletion src/Cardano/Wallet/WalletLayer/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Universum
import Control.Lens (makeLenses)

import Cardano.Wallet.API.V1.Types (Account, AccountIndex, AccountUpdate, Address,
NewAccount, NewWallet, Wallet, WalletId, WalletUpdate)
NewAccount, NewWallet, Wallet, WalletId, WalletUpdate)

import Pos.Block.Types (Blund)
import Pos.Core.Chrono (NE, NewestFirst (..), OldestFirst (..))
Expand Down
6 changes: 3 additions & 3 deletions test/unit/Test/Spec/Submission.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module Test.Spec.Submission (
import Universum hiding (elems)

import Cardano.Wallet.Kernel.DB.HdWallet (HdAccountId (..), HdAccountIx (..),
HdRootId (..))
HdRootId (..))
import Cardano.Wallet.Kernel.DB.InDb (InDb (..), fromDb)
import Cardano.Wallet.Kernel.DB.Spec (Pending (..), emptyPending, pendingTransactions,
removePending)
removePending)
import Cardano.Wallet.Kernel.Submission
import Control.Lens (at, non, to)
import qualified Data.ByteString as BS
Expand All @@ -32,7 +32,7 @@ import Serokell.Util.Text (listJsonIndent)
import qualified Test.Pos.Txp.Arbitrary as Core

import Test.QuickCheck (Gen, Property, arbitrary, choose, conjoin, forAll, listOf,
shuffle, vectorOf, (===))
shuffle, vectorOf, (===))
import Test.QuickCheck.Property (counterexample)
import Util (disjoint)
import Util.Buildable (ShowThroughBuild (..))
Expand Down

0 comments on commit 3871fd5

Please sign in to comment.