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

Commit 3b6317a

Browse files
nc6edsko
authored andcommitted
[CBR-150] Fix warnings, placate hlint
1 parent 20b192f commit 3b6317a

File tree

6 files changed

+13
-16
lines changed

6 files changed

+13
-16
lines changed

wallet-new/src/Cardano/Wallet/Kernel/DB/AcidState.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ fillInDefaults :: forall p e.
260260
-> Map HdAccountId p -- ^ Map with values per account
261261
-> Update' HdWallets e (Map HdAccountId p)
262262
fillInDefaults def accs =
263-
aux <$> IxSet.toMap <$> use hdWalletsAccounts
263+
aux . IxSet.toMap <$> use hdWalletsAccounts
264264
where
265265
aux :: Map HdAccountId HdAccount -> Map HdAccountId p
266266
aux = Map.Merge.merge newAccount needsDefault valueForExistingAcc accs

wallet-new/src/Cardano/Wallet/Kernel/Types.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import qualified Data.Map.Strict as Map
2626
import Data.Word (Word32)
2727
import Formatting.Buildable (Buildable (..))
2828

29-
import Pos.Core.Block (GenesisBlock, MainBlock, gbBody, mainBlockSlot,
30-
mbTxs, mbWitnesses)
29+
import Pos.Core.Block (MainBlock, gbBody, mainBlockSlot, mbTxs,
30+
mbWitnesses)
3131
import Pos.Core.Txp (Tx, TxAux (..), TxId, TxIn (..), TxOut,
3232
TxOutAux (..), txInputs, txOutputs)
3333
import Pos.Crypto.Hashing (hash)

wallet-new/test/unit/UTxO/Interpreter.hs

+3-4
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ import Cardano.Wallet.Kernel.Util (at)
4545
import Pos.Client.Txp
4646
import Pos.Core
4747
import Pos.Core.Block (Block, BlockHeader (..), GenesisBlock,
48-
MainBlock, gbHeader, genBlockEpoch, genBlockLeaders,
49-
mkGenesisBlock)
48+
MainBlock, gbHeader, genBlockLeaders, mkGenesisBlock)
5049
import Pos.Core.Chrono
5150
import Pos.Core.Delegation (DlgPayload (..))
5251
import Pos.Core.Genesis (GenesisWStakeholders, gdBootStakeholders,
@@ -631,8 +630,8 @@ instance DSL.Hash h Addr => Interpret h (DSL.Chain h Addr) where
631630

632631
int :: forall e m. Monad m
633632
=> DSL.Chain h Addr -> IntT h e m (OldestFirst [] Block)
634-
int (OldestFirst blocks) = OldestFirst <$>
635-
concatMap flatten <$> mapM int blocks
633+
int (OldestFirst blocks) =
634+
OldestFirst . concatMap flatten <$> mapM int blocks
636635
where
637636
flatten :: (RawResolvedBlock, Maybe GenesisBlock) -> [Block]
638637
flatten (b, Nothing) = [Right (rawResolvedBlock b)]

wallet-new/test/unit/Wallet/Inductive/History.hs

+3-4
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ dslEvent (History events) ev ws = History $
6464
Constructing histories when comparing DSL to kernel
6565
-------------------------------------------------------------------------------}
6666

67-
kernelInit :: Hash h Addr
68-
=> Wallet h Addr -- ^ Initial pure wallet
67+
kernelInit :: Wallet h Addr -- ^ Initial pure wallet
6968
-> IntCtxt h -- ^ Initial interpretation context
7069
-> History
7170
kernelInit w ic = History $
@@ -87,12 +86,12 @@ kernelEvent (History events) ev w = History $
8786
events
8887

8988
-- | Record that we interpreted the event
90-
kernelInt :: Hash h Addr => History -> IntCtxt h -> History
89+
kernelInt :: History -> IntCtxt h -> History
9190
kernelInt (History events) ic = History $
9291
liftNewestFirst (\es -> Event ["interpret", pretty ic] : es) events
9392

9493
-- | Record that we rolled back the interpretation state
95-
kernelRollback :: Hash h Addr => History -> IntCtxt h -> History
94+
kernelRollback :: History -> IntCtxt h -> History
9695
kernelRollback (History events) ic = History $
9796
liftNewestFirst (\es -> Event ["rollback", pretty ic] : es) events
9897

wallet-new/test/unit/Wallet/Rollback/Full.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ initState = State {
7575
Construction
7676
-------------------------------------------------------------------------------}
7777

78-
mkWallet :: (Hash h a, Buildable st, Buildable a)
78+
mkWallet :: (Hash h a, Buildable st)
7979
=> Ours a -> Lens' st (State h a) -> WalletConstr h a st
8080
mkWallet ours l self st = (Incr.mkWallet ours (l . stateIncr) self st) {
8181
applyBlock = \b ->
@@ -102,7 +102,7 @@ walletEmpty ours = fix (mkWallet ours identity) initState
102102
Implementation
103103
-------------------------------------------------------------------------------}
104104

105-
applyBlock' :: (Hash h a, Buildable a)
105+
applyBlock' :: Hash h a
106106
=> (Set (Input h a), Utxo h a)
107107
-> State h a -> State h a
108108
applyBlock' (ins, outs) State{..} = State{
@@ -116,7 +116,7 @@ applyBlock' (ins, outs) State{..} = State{
116116
Checkpoint{..} = _stateCurrent
117117
Incr.State{..} = _checkpointIncr
118118

119-
rollback' :: (Hash h a, Buildable a) => State h a -> State h a
119+
rollback' :: Hash h a => State h a -> State h a
120120
rollback' State{ _stateCheckpoints = [] } = error "rollback': no checkpoints"
121121
rollback' State{ _stateCheckpoints = prev : checkpoints'
122122
, _stateCurrent = curr

wallet/test/Test/Pos/Wallet/Arbitrary/Web/ClientTypes.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ module Test.Pos.Wallet.Arbitrary.Web.ClientTypes
88
(
99
) where
1010

11-
import Universum
12-
1311
import qualified Data.ByteString.Char8 as B8
1412
import qualified Serokell.Util.Base64 as B64
1513
import Test.QuickCheck (Arbitrary (..), vectorOf)
@@ -19,6 +17,7 @@ import Pos.Wallet.Web.ClientTypes.Types (CHash (..), CId (..),
1917
import Pos.Wallet.Web.State (WAddressMeta (..))
2018

2119
import Test.Pos.Core.Arbitrary ()
20+
import Universum
2221

2322
instance Arbitrary CHash where
2423
arbitrary = CHash . B64.encode . B8.pack <$> vectorOf 64 arbitrary

0 commit comments

Comments
 (0)