Permalink
Browse files

Remove completely un-needed ViewPatterns

  • Loading branch information...
erikd committed Feb 11, 2019
1 parent 3b33de4 commit 427986974f48221e06a7108be814e540ff062053
Showing with 2 additions and 3 deletions.
  1. +2 −3 chain/test/Test/Pos/Chain/Block/BlockSpec.hs
@@ -2,7 +2,6 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ViewPatterns #-}

-- | Specification of Pos.Chain.Block and Pos.Chain.Block.Pure.

@@ -157,14 +156,14 @@ mainHeaderFormation pm prevHeader slotId signer body extra =

validateGoodMainHeader :: ProtocolMagic -> Gen Bool
validateGoodMainHeader pm = do
(BT.getHAndP -> (params, header)) <- BT.genHeaderAndParams pm
(params, header) <- BT.getHAndP <$> BT.genHeaderAndParams pm
pure $ isVerSuccess $ Block.verifyHeader pm params header

-- FIXME should sharpen this test to ensure that it fails with the expected
-- reason.
validateBadProtocolMagicMainHeader :: ProtocolMagic -> Gen Bool
validateBadProtocolMagicMainHeader pm = do
(BT.getHAndP -> (params, header)) <- BT.genHeaderAndParams pm
(params, header) <- BT.getHAndP <$> BT.genHeaderAndParams pm
let protocolMagicId' = ProtocolMagicId (getProtocolMagic pm + 1)
header' = case header of
BlockHeaderGenesis h -> BlockHeaderGenesis (h & gbhProtocolMagicId .~ protocolMagicId')

0 comments on commit 4279869

Please sign in to comment.