@@ -60,7 +60,7 @@ module Chainweb.Test.Orphans.Internal
6060) where
6161
6262import Control.Applicative
63- import Control.Lens (view )
63+ import Control.Lens (view , set )
6464import Control.Monad
6565import Control.Monad.Catch
6666
@@ -119,6 +119,7 @@ import Chainweb.Crypto.MerkleLog
119119import Chainweb.Cut.Create
120120import Chainweb.Cut.CutHashes
121121import Chainweb.Difficulty
122+ import Chainweb.ForkState
122123import Chainweb.Graph
123124import Chainweb.HostAddress
124125import Chainweb.Mempool.Mempool
@@ -166,7 +167,6 @@ import P2P.Test.Orphans ()
166167import System.Logger.Types
167168
168169import Utils.Logging
169- import Chainweb.ForkState
170170
171171-- -------------------------------------------------------------------------- --
172172-- Utils
@@ -299,7 +299,7 @@ instance Arbitrary NodeInfo where
299299 , nodeGraphHistory = graphs
300300 , nodeLatestBehaviorHeight = latestBehaviorAt v
301301 , nodeGenesisHeights = map (\ c -> (chainIdToText c, genesisHeight v c)) $ HS. toList $ chainIds v
302- , nodeHistoricalChains = ruleElems $ fmap ( HM. toList . HM. map HS. toList . toAdjacencySets) $ _versionGraphs v
302+ , nodeHistoricalChains = ruleElems $ HM. toList . HM. map HS. toList . toAdjacencySets <$> _versionGraphs v
303303 , nodeServiceDate = T. pack <$> _versionServiceDate v
304304 , nodeBlockDelay = _versionBlockDelay v
305305 }
@@ -329,7 +329,12 @@ instance Arbitrary EpochStartTime where
329329 arbitrary = EpochStartTime <$> arbitrary
330330
331331instance Arbitrary ForkState where
332- arbitrary = ForkState <$> arbitrary
332+ arbitrary = do
333+ votes <- chooseBoundedIntegral (0 , int forkEpochLength * voteStep)
334+ number <- chooseBoundedIntegral (0 , 100000000 )
335+ return $ ForkState 0
336+ & set forkVotes votes
337+ & set forkNumber number
333338
334339instance Arbitrary BlockHeader where
335340 arbitrary = arbitrary >>= arbitraryBlockHeaderVersion
0 commit comments