@@ -32,8 +32,8 @@ import Test.QuickCheck.Arbitrary.Generic (genericArbitrary,
32
32
import Pos.Binary.Class (biSize )
33
33
import Pos.Chain.Block (HeaderHash )
34
34
import qualified Pos.Chain.Block as Block
35
- import Pos.Core (GenesisHash (.. ), HasGenesisHash , genesisHash ,
36
- localSlotIndexMaxBound , localSlotIndexMinBound )
35
+ import Pos.Core (GenesisHash (.. ), localSlotIndexMaxBound ,
36
+ localSlotIndexMinBound )
37
37
import qualified Pos.Core as Core
38
38
import Pos.Core.Attributes (areAttributesKnown )
39
39
import qualified Pos.Core.Delegation as Core
@@ -46,7 +46,7 @@ import Test.Pos.Chain.Ssc.Arbitrary (SscPayloadDependsOnSlot (..),
46
46
import Test.Pos.Chain.Update.Arbitrary (genUpdatePayload )
47
47
import Test.Pos.Core.Arbitrary (genSlotId )
48
48
import Test.Pos.Core.Arbitrary.Txp (genTxPayload )
49
- import Test.Pos.Core.Dummy (dummyEpochSlots )
49
+ import Test.Pos.Core.Dummy (dummyEpochSlots , dummyGenesisHash )
50
50
import Test.Pos.Crypto.Dummy (dummyProtocolMagic )
51
51
52
52
newtype BodyDependsOnSlot b = BodyDependsOnSlot
@@ -96,9 +96,9 @@ instance Arbitrary Block.GenesisBody where
96
96
arbitrary = genericArbitrary
97
97
shrink = genericShrink
98
98
99
- instance HasGenesisHash => Arbitrary Block. GenesisBlock where
99
+ instance Arbitrary Block. GenesisBlock where
100
100
arbitrary = Block. mkGenesisBlock dummyProtocolMagic
101
- <$> (maybe (Left ( GenesisHash genesisHash) ) Right <$> arbitrary)
101
+ <$> (maybe (Left dummyGenesisHash ) Right <$> arbitrary)
102
102
<*> arbitrary
103
103
<*> arbitrary
104
104
shrink = genericShrink
@@ -234,7 +234,7 @@ genMainBlock pm prevHash difficulty = do
234
234
<*> pure extraHeaderData
235
235
pure $ Block. UnsafeGenericBlock header body extraBodyData
236
236
237
- instance HasGenesisHash => Arbitrary Block. MainBlock where
237
+ instance Arbitrary Block. MainBlock where
238
238
arbitrary = do
239
239
slot <- arbitrary
240
240
BodyDependsOnSlot {.. } <- arbitrary :: Gen (BodyDependsOnSlot Block. MainBlockchain )
@@ -247,7 +247,7 @@ instance HasGenesisHash => Arbitrary Block.MainBlock where
247
247
<*> pure (hash extraBodyData)
248
248
header <-
249
249
Block. mkMainHeader dummyProtocolMagic
250
- <$> (maybe (Left ( GenesisHash genesisHash) ) Right <$> arbitrary)
250
+ <$> (maybe (Left dummyGenesisHash ) Right <$> arbitrary)
251
251
<*> pure slot
252
252
<*> arbitrary
253
253
<*> pure Nothing
@@ -357,11 +357,11 @@ bhlEpochs = 2
357
357
--
358
358
-- Note that a leader is generated for each slot.
359
359
-- (Not exactly a leader - see previous comment)
360
- instance HasGenesisHash => Arbitrary BlockHeaderList where
360
+ instance Arbitrary BlockHeaderList where
361
361
arbitrary = do
362
362
incompleteEpochSize <- choose (1 , dummyEpochSlots - 1 )
363
363
let slot = Core. SlotId 0 localSlotIndexMinBound
364
- generateBHL ( GenesisHash genesisHash) True slot (dummyEpochSlots * bhlEpochs + incompleteEpochSize)
364
+ generateBHL dummyGenesisHash True slot (dummyEpochSlots * bhlEpochs + incompleteEpochSize)
365
365
366
366
generateBHL
367
367
:: GenesisHash
@@ -404,13 +404,13 @@ newtype HeaderAndParams = HAndP
404
404
-- already been done in the 'Arbitrary' instance of the 'BlockHeaderList'
405
405
-- type, so it is used here and at most 3 blocks are taken from the generated
406
406
-- list.
407
- instance HasGenesisHash => Arbitrary HeaderAndParams where
407
+ instance Arbitrary HeaderAndParams where
408
408
arbitrary = do
409
409
-- This integer is used as a seed to randomly choose a slot down below
410
410
seed <- arbitrary :: Gen Int
411
411
startSlot <- Core. SlotId <$> choose (0 , bhlMaxStartingEpoch) <*> arbitrary
412
412
(headers, leaders) <- first reverse . getHeaderList <$>
413
- (generateBHL ( GenesisHash genesisHash) True startSlot =<< choose (1 , 2 ))
413
+ (generateBHL dummyGenesisHash True startSlot =<< choose (1 , 2 ))
414
414
let num = length headers
415
415
-- 'skip' is the random number of headers that should be skipped in
416
416
-- the header chain. This ensures different parts of it are chosen
0 commit comments