Skip to content

Commit

Permalink
Minor fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ffakenz committed Jan 3, 2024
1 parent 4ccf879 commit bd6e763
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions hydra-cluster/test/Test/EndToEndSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,14 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do
let node = RunningNode{nodeSocket, networkId = defaultNetworkId, pparams}
hydraScriptsTxId <- publishHydraScriptsAs node Faucet
chainConfig <- chainConfigFor Alice tmpDir nodeSocket hydraScriptsTxId [] cperiod
withHydraNode' chainConfig tmpDir 1 aliceSk [] [1] pparams Nothing $ \out mStdErr ph -> do
withHydraNode' chainConfig tmpDir 1 aliceSk [] [1] pparams Nothing $ \out stdErr ph -> do
-- Assert nominal startup
waitForLog 5 out "missing NodeOptions" (Text.isInfixOf "NodeOptions")

waitUntilEpoch tmpDir args node 1

waitForProcess ph `shouldReturn` ExitFailure 1
errorOutputs <- maybe (pure "Should not happen™") hGetContents mStdErr
errorOutputs <- hGetContents stdErr
errorOutputs `shouldContain` "Received blocks in unsupported era"
errorOutputs `shouldContain` "upgrade your hydra-node"

Expand All @@ -539,9 +539,9 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do

waitUntilEpoch tmpDir args node 2

withHydraNode' chainConfig tmpDir 1 aliceSk [] [1] pparams Nothing $ \_out mStdErr ph -> do
withHydraNode' chainConfig tmpDir 1 aliceSk [] [1] pparams Nothing $ \_out stdErr ph -> do
waitForProcess ph `shouldReturn` ExitFailure 1
errorOutputs <- maybe (pure "Should not happen™") hGetContents mStdErr
errorOutputs <- hGetContents stdErr
errorOutputs `shouldContain` "Connected to cardano-node in unsupported era"
errorOutputs `shouldContain` "upgrade your hydra-node"

Expand Down
3 changes: 2 additions & 1 deletion hydra-node/src/Hydra/Chain/Direct/ScriptRegistry.hs
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,14 @@ registryUTxO scriptRegistry =
--
-- Can throw at least 'NewScriptRegistryException' on failure.
queryScriptRegistry ::
(MonadIO m, MonadThrow m) =>
-- | cardano-node's network identifier.
-- A combination of network discriminant + magic number.
NetworkId ->
-- | Filepath to the cardano-node's domain socket
SocketPath ->
TxId ->
IO ScriptRegistry
m ScriptRegistry
queryScriptRegistry networkId socketPath txId = do
utxo <- liftIO $ queryUTxOByTxIn networkId socketPath QueryTip candidates
case newScriptRegistry utxo of
Expand Down
10 changes: 6 additions & 4 deletions hydra-node/src/Hydra/Node/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import Hydra.Prelude hiding (fromList)

import Hydra.API.Server (Server (..), withAPIServer)
import Hydra.API.ServerOutput (ServerOutput (..))
import Hydra.Cardano.Api (ProtocolParametersConversionError)
import Hydra.Cardano.Api (
ProtocolParametersConversionError,
)
import Hydra.Chain (maximumNumberOfParties)
import Hydra.Chain.CardanoClient (QueryPoint (..), queryGenesisParameters)
import Hydra.Chain.Direct (loadChainContext, mkTinyWallet, withDirectChain)
Expand Down Expand Up @@ -129,9 +131,9 @@ getGlobalsForChain = \case
Offline OfflineChainConfig{ledgerGenesisFile} ->
loadGenesisFile ledgerGenesisFile
>>= newGlobals
Direct DirectChainConfig{networkId, nodeSocket} -> do
params <- queryGenesisParameters networkId nodeSocket QueryTip
newGlobals params
Direct DirectChainConfig{networkId, nodeSocket} ->
queryGenesisParameters networkId nodeSocket QueryTip
>>= newGlobals

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

0 comments on commit bd6e763

Please sign in to comment.