@@ -20,8 +20,6 @@ import Data.ByteString (hGetContents)
2020import Data.List qualified as List
2121import Data.Text qualified as T
2222import Hydra.API.HTTPServer (DraftCommitTxRequest (.. ), DraftCommitTxResponse (.. ))
23- import Hydra.Chain.Backend (ChainBackend )
24- import Hydra.Chain.Backend qualified as Backend
2523import Hydra.Chain.Blockfrost.Client qualified as Blockfrost
2624import Hydra.Cluster.Util (readConfigFile )
2725import Hydra.HeadLogic.State (SeenSnapshot )
@@ -281,9 +279,9 @@ getMetrics HydraClient{hydraNodeId, apiHost = Host{hostname}} = do
281279-- XXX: The two lists need to be of same length. Also the verification keys can
282280-- be derived from the signing keys.
283281withHydraCluster ::
284- ( HasCallStack , ChainBackend backend ) =>
282+ HasCallStack =>
285283 Tracer IO HydraNodeLog ->
286- backend ->
284+ NominalDiffTime ->
287285 FilePath ->
288286 SocketPath ->
289287 -- | First node id
@@ -297,7 +295,7 @@ withHydraCluster ::
297295 ContestationPeriod ->
298296 (NonEmpty HydraClient -> IO a ) ->
299297 IO a
300- withHydraCluster tracer backend workDir nodeSocket firstNodeId allKeys hydraKeys hydraScriptsTxId contestationPeriod action = do
298+ withHydraCluster tracer blockTime workDir nodeSocket firstNodeId allKeys hydraKeys hydraScriptsTxId contestationPeriod action = do
301299 when (clusterSize == 0 ) $
302300 failure " Cannot run a cluster with 0 number of nodes"
303301 when (length allKeys /= length hydraKeys) $
@@ -335,7 +333,7 @@ withHydraCluster tracer backend workDir nodeSocket firstNodeId allKeys hydraKeys
335333 }
336334 withHydraNode
337335 tracer
338- backend
336+ blockTime
339337 chainConfig
340338 workDir
341339 nodeId
@@ -440,16 +438,15 @@ prepareHydraNode chainConfig workDir hydraNodeId hydraSKey hydraVKeys allNodeIds
440438
441439-- | Run a hydra-node with given 'RunOptions' and in sync with chain backend.
442440withPreparedHydraNodeInSync ::
443- ( HasCallStack , ChainBackend backend ) =>
441+ HasCallStack =>
444442 Tracer IO HydraNodeLog ->
445- backend ->
443+ NominalDiffTime ->
446444 FilePath ->
447445 Int ->
448446 RunOptions ->
449447 (HydraClient -> IO a ) ->
450448 IO a
451- withPreparedHydraNodeInSync tracer backend workDir hydraNodeId runOptions action = do
452- blockTime <- Backend. getBlockTime backend
449+ withPreparedHydraNodeInSync tracer blockTime workDir hydraNodeId runOptions action = do
453450 let waitTime = blockTime * waitFactor
454451 withPreparedHydraNode tracer workDir hydraNodeId runOptions (action' waitTime)
455452 where
@@ -500,9 +497,9 @@ withPreparedHydraNode tracer workDir hydraNodeId runOptions action =
500497-- | Run a hydra-node with given 'ChainConfig' and using the config from
501498-- config/.
502499withHydraNode ::
503- ( HasCallStack , ChainBackend backend ) =>
500+ HasCallStack =>
504501 Tracer IO HydraNodeLog ->
505- backend ->
502+ NominalDiffTime ->
506503 ChainConfig ->
507504 FilePath ->
508505 Int ->
@@ -511,9 +508,9 @@ withHydraNode ::
511508 [Int ] ->
512509 (HydraClient -> IO a ) ->
513510 IO a
514- withHydraNode tracer backend chainConfig workDir hydraNodeId hydraSKey hydraVKeys allNodeIds action = do
511+ withHydraNode tracer blockTime chainConfig workDir hydraNodeId hydraSKey hydraVKeys allNodeIds action = do
515512 opts <- prepareHydraNode chainConfig workDir hydraNodeId hydraSKey hydraVKeys allNodeIds id
516- withPreparedHydraNodeInSync tracer backend workDir hydraNodeId opts action
513+ withPreparedHydraNodeInSync tracer blockTime workDir hydraNodeId opts action
517514
518515-- | Run a hydra-node with given 'ChainConfig' and using the config from
519516-- config and catching up with chain backend/.
0 commit comments