Skip to content

Commit c8bf0c1

Browse files
committed
consensus-test: include near-future headers in ChainSync client test
This now exercises the real ChainSync InFutureCheck.
1 parent 64937e0 commit c8bf0c1

File tree

3 files changed

+355
-39
lines changed

3 files changed

+355
-39
lines changed

ouroboros-consensus/ouroboros-consensus.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ test-suite consensus-test
484484
build-depends:
485485
, async
486486
, base
487+
, base-deriving-via
487488
, cardano-binary
488489
, cardano-crypto-class
489490
, cardano-slotting
@@ -505,6 +506,7 @@ test-suite consensus-test
505506
, ouroboros-network-protocols:{ouroboros-network-protocols, testlib}
506507
, QuickCheck
507508
, quickcheck-state-machine
509+
, quiet
508510
, random
509511
, serialise
510512
, si-timers

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Util/Time.hs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
module Ouroboros.Consensus.Util.Time (
2-
-- Conversions
32
nominalDelay
3+
, multipleNominalDelay
44
, secondsToNominalDiffTime
55
) where
66

77
import Data.Time (DiffTime, NominalDiffTime)
88

9+
{-------------------------------------------------------------------------------
10+
Operations
11+
-------------------------------------------------------------------------------}
12+
13+
-- | Multiply a 'NominalDiffTime' by an integer
14+
--
15+
-- The right conversions to use are somewhat tricky. The key fact is that
16+
-- 'fromIntegral' interprets its argument as seconds.
17+
multipleNominalDelay :: Integral a => NominalDiffTime -> a -> NominalDiffTime
18+
multipleNominalDelay dur i = dur * fromIntegral i
19+
920
{-------------------------------------------------------------------------------
1021
Conversions
1122
-------------------------------------------------------------------------------}

0 commit comments

Comments
 (0)