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

Commit

Permalink
[CBR-150] Fix warnings, placate hlint
Browse files Browse the repository at this point in the history
  • Loading branch information
nc6 authored and edsko committed Jul 26, 2018
1 parent b6a28bc commit 6a32c88
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion wallet-new/src/Cardano/Wallet/Kernel/DB/AcidState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ fillInDefaults :: forall p e.
-> Map HdAccountId p -- ^ Map with values per account
-> Update' HdWallets e (Map HdAccountId p)
fillInDefaults def accs =
aux <$> IxSet.toMap <$> use hdWalletsAccounts
aux . IxSet.toMap <$> use hdWalletsAccounts
where
aux :: Map HdAccountId HdAccount -> Map HdAccountId p
aux = Map.Merge.merge newAccount needsDefault valueForExistingAcc accs
Expand Down
3 changes: 1 addition & 2 deletions wallet-new/src/Cardano/Wallet/Kernel/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import qualified Data.Map.Strict as Map
import Data.Word (Word32)
import Formatting.Buildable (Buildable (..))

import Pos.Core (GenesisBlock, MainBlock, gbBody, mainBlockSlot,
mbTxs, mbWitnesses)
import Pos.Core (MainBlock, gbBody, mainBlockSlot, mbTxs, mbWitnesses)
import Pos.Core.Txp (Tx, TxAux (..), TxId, TxIn (..), TxOut,
TxOutAux (..), txInputs, txOutputs)
import Pos.Crypto.Hashing (hash)
Expand Down
4 changes: 2 additions & 2 deletions wallet-new/test/unit/UTxO/Interpreter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ instance DSL.Hash h Addr => Interpret h (DSL.Chain h Addr) where

int :: forall e m. Monad m
=> DSL.Chain h Addr -> IntT h e m (OldestFirst [] Block)
int (OldestFirst blocks) = OldestFirst <$>
concatMap flatten <$> mapM int blocks
int (OldestFirst blocks) =
OldestFirst . concatMap flatten <$> mapM int blocks
where
flatten :: (RawResolvedBlock, Maybe GenesisBlock) -> [Block]
flatten (b, Nothing) = [Right (rawResolvedBlock b)]
Expand Down
7 changes: 3 additions & 4 deletions wallet-new/test/unit/Wallet/Inductive/History.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ dslEvent (History events) ev ws = History $
Constructing histories when comparing DSL to kernel
-------------------------------------------------------------------------------}

kernelInit :: Hash h Addr
=> Wallet h Addr -- ^ Initial pure wallet
kernelInit :: Wallet h Addr -- ^ Initial pure wallet
-> IntCtxt h -- ^ Initial interpretation context
-> History
kernelInit w ic = History $
Expand All @@ -87,12 +86,12 @@ kernelEvent (History events) ev w = History $
events

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

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

Expand Down
6 changes: 3 additions & 3 deletions wallet-new/test/unit/Wallet/Rollback/Full.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ initState = State {
Construction
-------------------------------------------------------------------------------}

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

applyBlock' :: (Hash h a, Buildable a)
applyBlock' :: Hash h a
=> (Set (Input h a), Utxo h a)
-> State h a -> State h a
applyBlock' (ins, outs) State{..} = State{
Expand All @@ -116,7 +116,7 @@ applyBlock' (ins, outs) State{..} = State{
Checkpoint{..} = _stateCurrent
Incr.State{..} = _checkpointIncr

rollback' :: (Hash h a, Buildable a) => State h a -> State h a
rollback' :: Hash h a => State h a -> State h a
rollback' State{ _stateCheckpoints = [] } = error "rollback': no checkpoints"
rollback' State{ _stateCheckpoints = prev : checkpoints'
, _stateCurrent = curr
Expand Down
3 changes: 1 addition & 2 deletions wallet/test/Test/Pos/Wallet/Arbitrary/Web/ClientTypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ module Test.Pos.Wallet.Arbitrary.Web.ClientTypes
(
) where

import Universum

import qualified Data.ByteString.Char8 as B8
import qualified Serokell.Util.Base64 as B64
import Test.QuickCheck (Arbitrary (..), vectorOf)
Expand All @@ -19,6 +17,7 @@ import Pos.Wallet.Web.ClientTypes.Types (CHash (..), CId (..),
import Pos.Wallet.Web.State (WAddressMeta (..))

import Test.Pos.Core.Arbitrary ()
import Universum

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

0 comments on commit 6a32c88

Please sign in to comment.