File tree Expand file tree Collapse file tree 3 files changed +355
-39
lines changed
src/ouroboros-consensus/Ouroboros/Consensus/Util
test/consensus-test/Test/Consensus/MiniProtocol/ChainSync Expand file tree Collapse file tree 3 files changed +355
-39
lines changed Original file line number Diff line number Diff line change @@ -484,6 +484,7 @@ test-suite consensus-test
484
484
build-depends :
485
485
, async
486
486
, base
487
+ , base-deriving-via
487
488
, cardano-binary
488
489
, cardano-crypto-class
489
490
, cardano-slotting
@@ -505,6 +506,7 @@ test-suite consensus-test
505
506
, ouroboros-network-protocols :{ouroboros-network-protocols, testlib}
506
507
, QuickCheck
507
508
, quickcheck-state-machine
509
+ , quiet
508
510
, random
509
511
, serialise
510
512
, si-timers
Original file line number Diff line number Diff line change 1
1
module Ouroboros.Consensus.Util.Time (
2
- -- Conversions
3
2
nominalDelay
3
+ , multipleNominalDelay
4
4
, secondsToNominalDiffTime
5
5
) where
6
6
7
7
import Data.Time (DiffTime , NominalDiffTime )
8
8
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
+
9
20
{- ------------------------------------------------------------------------------
10
21
Conversions
11
22
-------------------------------------------------------------------------------}
You can’t perform that action at this time.
0 commit comments