@@ -15,15 +15,15 @@ import Hydra.Chain (Chain (..), ChainEvent (..), OnChainTx (..), PostTxError (..
15
15
import Hydra.Chain.ChainState (ChainSlot (ChainSlot ), IsChainState )
16
16
import Hydra.Events (EventSink (.. ), EventSource (.. ), getEventId )
17
17
import Hydra.Events.Rotation (EventStore (.. ))
18
- import Hydra.HeadLogic (Input (.. ))
18
+ import Hydra.HeadLogic (Input (.. ), TTL )
19
19
import Hydra.HeadLogic.Outcome (StateChanged (HeadInitialized ), genStateChanged )
20
20
import Hydra.HeadLogic.StateEvent (StateEvent (.. ), genStateEvent )
21
21
import Hydra.HeadLogicSpec (inInitialState , receiveMessage , receiveMessageFrom , testSnapshot )
22
22
import Hydra.Ledger.Simple (SimpleChainState (.. ), SimpleTx (.. ), aValidTx , simpleLedger , utxoRef , utxoRefs )
23
23
import Hydra.Logging (Tracer , showLogsOnFailure , traceInTVar )
24
24
import Hydra.Logging qualified as Logging
25
25
import Hydra.Network (Network (.. ))
26
- import Hydra.Network.Message (Message (.. ))
26
+ import Hydra.Network.Message (Message (.. ), NetworkEvent ( .. ) )
27
27
import Hydra.Node (
28
28
DraftHydraNode ,
29
29
HydraNode (.. ),
@@ -264,9 +264,9 @@ spec = parallel $ do
264
264
sigBob = sign bobSk snapshot
265
265
inputs =
266
266
inputsToOpenHead
267
- <> [ receiveMessageFrom bob ReqTx {transaction = tx1}
268
- , receiveMessageFrom bob ReqTx {transaction = tx2}
269
- , receiveMessage ReqSn {snapshotVersion = 0 , snapshotNumber = 1 , transactionIds = [2 ], decommitTx = Nothing , depositTxId = Nothing }
267
+ <> [ NetworkInput testTTL $ ReceivedMessage {sender = bob, msg = ReqTx {transaction = tx1} }
268
+ , NetworkInput testTTL $ ReceivedMessage {sender = bob, msg = ReqTx {transaction = tx2} }
269
+ , NetworkInput testTTL $ ReceivedMessage {sender = alice, msg = ReqSn {snapshotVersion = 0 , snapshotNumber = 1 , transactionIds = [2 ], decommitTx = Nothing , depositTxId = Nothing } }
270
270
]
271
271
(node, getNetworkEvents) <-
272
272
testHydraNode tracer bobSk [alice, carol] cperiod inputs
@@ -452,6 +452,11 @@ testHydraNode tracer signingKey otherParties contestationPeriod inputs = do
452
452
-- as this is a simulated network.
453
453
participants = deriveOnChainId <$> (party : otherParties)
454
454
455
+ -- | A lot shorter than the real world ttl which requires to be long to overcome
456
+ -- some longer chain observation delays, but would just make tests longer.
457
+ testTTL :: TTL
458
+ testTTL = 5
459
+
455
460
recordNetwork :: HydraNode tx IO -> IO (HydraNode tx IO , IO [Message tx ])
456
461
recordNetwork node = do
457
462
(record, query) <- messageRecorder
0 commit comments