Skip to content
Permalink
Browse files

Fix doc and other minor whitespace issues

  • Loading branch information...
intricate committed Jul 11, 2019
1 parent 9548052 commit 47b43937bdf5a9487aa727e0cb203085b6a2a8a3
@@ -471,4 +471,4 @@ instance B.Buildable (BoundaryValidationData a) where
where
buildBoundaryHash :: Either GenesisHash HeaderHash -> Builder
buildBoundaryHash (Left (GenesisHash _)) = fromText "Genesis"
buildBoundaryHash (Right h) = B.build h
buildBoundaryHash (Right h) = B.build h
@@ -198,10 +198,10 @@ genBoundaryValidationData = do
<*> genChainDifficulty
<*> pure ()
where
genBVDHash = Gen.choice
[ ((,) <$> Gen.word64 (Range.constantFrom 10 1 100)
genBVDHash = Gen.choice
[ ((,) <$> Gen.word64 (Range.constantFrom 10 1 100)
<*> (Right <$> genHeaderHash))
, ((,) <$> pure 0
<*> (Left . GenesisHash . coerce <$> genTextHash)
)
]
]
@@ -96,10 +96,12 @@ genProtocolMagic =
<$> (Annotated <$> genProtocolMagicId <*> pure ())
<*> genRequiresNetworkMagic

-- Whilst protocol magic is represented as a `Word32` in cardano-ledger, in
-- `cardano-sl` it was an `Int32`. In order to tolerate this, and since we don't care about
-- | Whilst 'ProtocolMagicId' is represented as a 'Word32' in cardano-ledger,
-- in @cardano-sl@ it was an 'Int32'. In order to tolerate this, and since we
-- don't care about testing compatibility with negative values, we only
-- generate values between @0@ and @(maxBound :: Int32) - 1@, inclusive.
genProtocolMagicId :: Gen ProtocolMagicId
genProtocolMagicId = ProtocolMagicId
genProtocolMagicId = ProtocolMagicId
<$> Gen.word32 (Range.constant 0 $ fromIntegral (maxBound :: Int32) - 1)

genRequiresNetworkMagic :: Gen RequiresNetworkMagic

0 comments on commit 47b4393

Please sign in to comment.
You can’t perform that action at this time.