Skip to content

Commit

Permalink
consensus-test: include near-future headers in ChainSync client test
Browse files Browse the repository at this point in the history
This now exercises the real ChainSync InFutureCheck.
  • Loading branch information
nfrisby committed Nov 30, 2023
1 parent 2f90f2c commit a39cd95
Show file tree
Hide file tree
Showing 3 changed files with 356 additions and 40 deletions.
2 changes: 2 additions & 0 deletions ouroboros-consensus/ouroboros-consensus.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ test-suite consensus-test
build-depends:
, async
, base
, base-deriving-via
, cardano-binary
, cardano-crypto-class
, cardano-slotting
Expand All @@ -505,6 +506,7 @@ test-suite consensus-test
, ouroboros-network-protocols:{ouroboros-network-protocols, testlib}
, QuickCheck
, quickcheck-state-machine
, quiet
, random
, serialise
, si-timers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
module Ouroboros.Consensus.Util.Time (
-- Conversions
nominalDelay
multipleNominalDelay
, nominalDelay
, secondsToNominalDiffTime
) where

import Data.Time (DiffTime, NominalDiffTime)

{-------------------------------------------------------------------------------
Operations
-------------------------------------------------------------------------------}

-- | Multiply a 'NominalDiffTime' by an integer
--
-- The right conversions to use are somewhat tricky. The key fact is that
-- 'fromIntegral' interprets its argument as seconds.
multipleNominalDelay :: Integral a => NominalDiffTime -> a -> NominalDiffTime
multipleNominalDelay dur i = dur * fromIntegral i

{-------------------------------------------------------------------------------
Conversions
-------------------------------------------------------------------------------}
Expand Down
Loading

0 comments on commit a39cd95

Please sign in to comment.