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

Commit

Permalink
[CSL-2125] Re-enable disabled warning in some places
Browse files Browse the repository at this point in the history
  • Loading branch information
gromakovsky authored and chshersh committed Mar 5, 2018
1 parent a8fc739 commit d89d872
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
6 changes: 2 additions & 4 deletions block/src/Pos/Block/Types.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# OPTIONS_GHC -fno-warn-simplifiable-class-constraints #-}

-- | Types used for block processing: most importantly, 'Undo' and 'Blund'.

module Pos.Block.Types
Expand All @@ -24,6 +22,7 @@ import qualified Data.Text.Buildable
import Formatting (bprint, build, (%))
import Serokell.Util.Text (listJson)

import Pos.Block.BHelpers ()
import Pos.Block.Slog.Types (SlogUndo (..))
import Pos.Communication.Protocol (NodeId)
import Pos.Core (HasConfiguration, HasDifficulty (..), HasHeaderHash (..))
Expand Down Expand Up @@ -61,8 +60,7 @@ instance HasConfiguration => Buildable Undo where
instance HasDifficulty Blund where
difficultyL = _1 . difficultyL

-- TODO: warning here, doesn't work w/o constraint
instance HasHeaderHash Block => HasHeaderHash Blund where
instance HasConfiguration => HasHeaderHash Blund where
headerHash = headerHash . fst

-- | For a description of what these types mean,
Expand Down
9 changes: 3 additions & 6 deletions block/src/Pos/DB/Block/Load.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# OPTIONS_GHC -fno-warn-simplifiable-class-constraints #-}

-- | Loading sequence of blunds.

module Pos.DB.Block.Load
Expand Down Expand Up @@ -30,7 +28,7 @@ import Pos.Core.Configuration (genesisHash)
import Pos.Crypto (shortHashF)
import Pos.DB.Block (getBlund)
import Pos.DB.BlockIndex (getHeader)
import Pos.DB.Class (MonadBlockDBRead, MonadDBRead, getBlock)
import Pos.DB.Class (MonadDBRead, getBlock)
import Pos.DB.Error (DBError (..))
import Pos.DB.GState.Common (getTip)
import Pos.Util.Chrono (NewestFirst (..))
Expand Down Expand Up @@ -113,9 +111,8 @@ loadBlundsByDepth = loadDataByDepth getBlundThrow (const True)

-- | Load blocks starting from block with header hash equal to given hash
-- and while @predicate@ is true.
-- TODO: really strange warning here
loadBlocksWhile
:: MonadBlockDBRead m
:: MonadDBRead m
=> (Block -> Bool) -> HeaderHash -> m (NewestFirst [] Block)
loadBlocksWhile = loadDataWhile getBlockThrow

Expand Down Expand Up @@ -157,7 +154,7 @@ loadBlundsFromTipByDepth d = getTip >>= loadBlundsByDepth d
----------------------------------------------------------------------------

getBlockThrow
:: MonadBlockDBRead m
:: MonadDBRead m
=> HeaderHash -> m Block
getBlockThrow hash =
maybeThrow (DBMalformed $ sformat errFmt hash) =<< getBlock hash
Expand Down
2 changes: 0 additions & 2 deletions core/Pos/Core/Block/Genesis/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# OPTIONS_GHC -fno-warn-simplifiable-class-constraints #-}

{-# LANGUAGE TypeOperators #-}

-- | Miscellaneous instances, etc. Related to the genesis blockchain of course.
Expand Down
9 changes: 3 additions & 6 deletions ssc/Pos/Ssc/Worker.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# OPTIONS_GHC -fno-warn-simplifiable-class-constraints #-}

{-# LANGUAGE RankNTypes #-}

module Pos.Ssc.Worker
Expand All @@ -22,7 +20,7 @@ import qualified System.Metrics.Gauge as Metrics
import qualified Test.QuickCheck as QC

import Pos.Arbitrary.Ssc ()
import Pos.Binary.Class (AsBinary, Bi, asBinary, fromBinary)
import Pos.Binary.Class (AsBinary, asBinary, fromBinary)
import Pos.Binary.Infra ()
import Pos.Binary.Ssc ()
import Pos.Communication.Protocol (OutSpecs)
Expand All @@ -31,8 +29,7 @@ import Pos.Core (EpochIndex, HasConfiguration, SlotId (..), Stakeholde
bvdMpcThd, getOurSecretKey, getOurStakeholderId, getSlotIndex, lookupVss,
memberVss, mkLocalSlotIndex, mkVssCertificate, slotSecurityParam,
vssMaxTTL)
import Pos.Core.Ssc (Commitment (..), InnerSharesMap, Opening, SignedCommitment,
getCommitmentsMap)
import Pos.Core.Ssc (InnerSharesMap, Opening, SignedCommitment, getCommitmentsMap)
import Pos.Crypto (SecretKey, VssKeyPair, VssPublicKey, randomNumber, runSecureRandom)
import Pos.Crypto.SecretSharing (toVssPublicKey)
import Pos.DB (gsAdoptedBVData)
Expand Down Expand Up @@ -297,7 +294,7 @@ sendOurData sendIt msgTag dt epoch slMultiplier = do
-- synchronized).
generateAndSetNewSecret
:: forall ctx m.
(HasSscConfiguration, HasConfiguration, SscMode ctx m, Bi Commitment)
(HasSscConfiguration, HasConfiguration, SscMode ctx m)
=> SecretKey
-> SlotId -- ^ Current slot
-> m (Maybe SignedCommitment)
Expand Down

0 comments on commit d89d872

Please sign in to comment.