Skip to content

Commit

Permalink
Parse scripts from list as well
Browse files Browse the repository at this point in the history
  • Loading branch information
noonio committed Dec 9, 2024
1 parent 0e09fc6 commit 8d18dab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion demo/seed-devnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ function publishReferenceScripts() {
hnode publish-scripts \
--testnet-magic ${NETWORK_ID} \
--node-socket ${DEVNET_DIR}/node.socket \
--cardano-signing-key devnet/credentials/faucet.sk
--cardano-signing-key devnet/credentials/faucet.sk \
| tr '\n' ',' \
| head -c -1
}

function queryPParams() {
Expand Down
17 changes: 16 additions & 1 deletion hydra-node/src/Hydra/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ directChainConfigParser =
DirectChainConfig
<$> networkIdParser
<*> nodeSocketParser
<*> many hydraScriptsTxIdParser
<*> (hydraScriptsTxIdsParser <|> many hydraScriptsTxIdParser)
<*> cardanoSigningKeyFileParser
<*> many cardanoVerificationKeyFileParser
<*> optional startChainFromParser
Expand Down Expand Up @@ -700,6 +700,21 @@ startChainFromParser =
_emptyOrSingularList ->
Nothing

hydraScriptsTxIdsParser :: Parser [TxId]
hydraScriptsTxIdsParser =
option
(eitherReader $ left show . parseFromHex . BSC.split ',' . BSC.pack)
( long "hydra-scripts-tx-id"
<> metavar "TXID"
<> help
"The transaction which is expected to have published Hydra scripts as \
\reference scripts in its outputs. Note: All scripts need to be in the \
\first 10 outputs. See release notes for pre-published versions. You \
\can use the 'publish-scripts' sub-command to publish them yourself."
)
where
parseFromHex = mapM (deserialiseFromRawBytesHex AsTxId)

hydraScriptsTxIdParser :: Parser TxId
hydraScriptsTxIdParser =
option
Expand Down

0 comments on commit 8d18dab

Please sign in to comment.