Skip to content

Commit af5c305

Browse files
authored
Quickfix for the network tests to use the correct format for the published script addresses (#1784)
The recent PR #1782 removed behaviour that the _network tests_ relied on (as they use the latest code from this repo) but _broke_ the demo. I think the essential lesson is at least a few things: 1. We need to test the demo in CI 2. One script doing two things is confusing
2 parents 5748b3c + a8f6f52 commit af5c305

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

hydra-cluster/hydra-cluster.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ test-suite tests
178178
, lens-aeson
179179
, process
180180
, QuickCheck
181+
, split
181182
, stm
182183
, text
183184
, time

hydra-cluster/test/Test/DirectChainSpec.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import CardanoNode (NodeLog, withCardanoNodeDevnet)
1919
import Control.Concurrent.STM (newEmptyTMVarIO, takeTMVar)
2020
import Control.Concurrent.STM.TMVar (putTMVar)
2121
import Control.Lens ((<>~))
22-
import Data.List qualified as List
22+
import Data.List.Split (splitWhen)
2323
import Data.Set qualified as Set
2424
import Hydra.Cardano.Api (
2525
ChainPoint (..),
@@ -427,7 +427,7 @@ spec = around (showLogsOnFailure "DirectChainSpec") $ do
427427
)
428428
)
429429
""
430-
let hydraScriptsTxId = fromString <$> List.lines hydraScriptsTxIdStr
430+
let hydraScriptsTxId = fromString <$> splitWhen (== ',') (filter (/= '\n') hydraScriptsTxIdStr)
431431
failAfter 5 $ void $ queryScriptRegistry networkId nodeSocket hydraScriptsTxId
432432

433433
it "can only contest once" $ \tracer -> do

hydra-node/exe/hydra-node/Main.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
module Main where
44

5-
import Hydra.Prelude hiding (fromList)
5+
import Hydra.Prelude hiding (fromList, intercalate)
66

7+
import Data.ByteString (intercalate)
78
import Hydra.Cardano.Api (
89
serialiseToRawBytesHex,
910
)
@@ -34,7 +35,7 @@ main = do
3435
(_, sk) <- readKeyPair (publishSigningKey opts)
3536
let PublishOptions{publishNetworkId = networkId, publishNodeSocket} = opts
3637
txIds <- publishHydraScripts networkId publishNodeSocket sk
37-
mapM_ putBSLn (serialiseToRawBytesHex <$> txIds)
38+
putBSLn $ intercalate "," (serialiseToRawBytesHex <$> txIds)
3839

3940
identifyNode :: RunOptions -> RunOptions
4041
identifyNode opt@RunOptions{verbosity = Verbose "HydraNode", nodeId} = opt{verbosity = Verbose $ "HydraNode-" <> show nodeId}

hydra-node/hydra-node.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ executable hydra-node
201201
hs-source-dirs: exe/hydra-node
202202
main-is: Main.hs
203203
build-depends:
204+
, bytestring
204205
, hydra-cardano-api
205206
, hydra-node
206207
, hydra-prelude

0 commit comments

Comments
 (0)