Skip to content

Commit 6a2fb64

Browse files
committed
Fix invocation of cardano-cli and pin-point the root cause
1 parent 4a69ba4 commit 6a2fb64

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

hydra-cluster/src/CardanoNode.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Hydra.Cardano.Api (
1616
AsType (AsPaymentKey),
1717
File (..),
1818
NetworkId,
19+
NetworkMagic (..),
1920
PaymentKey,
2021
SigningKey,
2122
SocketPath,
@@ -441,7 +442,7 @@ cliQueryProtocolParameters nodeSocket networkId = do
441442
]
442443
<> case networkId of
443444
Api.Mainnet -> ["--mainnet"]
444-
Api.Testnet magic -> ["--testnet-magic", show magic]
445+
Api.Testnet (NetworkMagic magic) -> ["--testnet-magic", show magic]
445446
<> [ "--out-file"
446447
, "/dev/stdout"
447448
]

hydra-cluster/src/HydraNode.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ withHydraNode' chainConfig workDir hydraNodeId hydraSKey hydraVKeys allNodeIds p
310310
withSystemTempDirectory "hydra-node" $ \dir -> do
311311
let cardanoLedgerProtocolParametersFile = dir </> "protocol-parameters.json"
312312
case chainConfig of
313-
Offline _ -> undefined
313+
Offline _ -> undefined -- TODO: should write default ProtocolParameters to cardanoLedgerProtocolParametersFile
314314
Direct DirectChainConfig{nodeSocket, networkId} -> do
315315
-- NOTE: This implicitly tests of cardano-cli with hydra-node
316316
protocolParameters <- cliQueryProtocolParameters nodeSocket networkId

hydra-node/src/Hydra/Ledger/Cardano/Configuration.hs

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ newGlobals genesisParameters = do
8080

8181
-- * LedgerEnv
8282

83+
-- | Decode protocol parameters using the 'ProtocolParameters' instance as this
84+
-- is used by cardano-cli and matches the schema. TODO: define the schema
8385
pparamsFromJson :: Json.Value -> Json.Parser (PParams LedgerEra)
8486
pparamsFromJson = parseJSON
8587

0 commit comments

Comments
 (0)