Skip to content

Commit

Permalink
HTTP chain observer fixes (#1828)
Browse files Browse the repository at this point in the history
The URL path parameter of `--explorer` posting in `hydra-chain-observer`
was wrong and this also extends the `singlePartyOpenAHead` function in
`hydra-cluster` to simplify the integration tests in `hydra-explorer`.

---

* [x] CHANGELOG not needed
* [x] Documentation update not needed
* [x] Haddocks update not needed
* [x] No new TODOs
  • Loading branch information
ch1bo authored Feb 5, 2025
2 parents af72d27 + cf09cb0 commit 0be6159
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions hydra-chain-observer/src/Hydra/ChainObserver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Hydra.Prelude

import Data.Version (showVersion)
import Hydra.Blockfrost.ChainObserver (blockfrostClient)
import Hydra.Cardano.Api (NetworkId (..))
import Hydra.Cardano.Api (NetworkId (..), NetworkMagic (..))
import Hydra.ChainObserver.NodeClient (ChainObservation, ChainObserverLog (..), NodeClient (..))
import Hydra.ChainObserver.Options (Backend (..), Options (..), hydraChainObserverOptions)
import Hydra.Contract qualified as Contract
Expand Down Expand Up @@ -43,7 +43,7 @@ reportObservation networkId baseURI observation = do
where
networkParam = case networkId of
Mainnet -> "mainnet"
(Testnet magic) -> show magic
(Testnet (NetworkMagic magic)) -> show magic

version = showVersion hydraNodeVersion

Expand Down
2 changes: 1 addition & 1 deletion hydra-cluster/exe/hydra-cluster/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ run options =
Nothing -> do
withCardanoNodeDevnet fromCardanoNode workDir $ \node -> do
txId <- publishOrReuseHydraScripts tracer node
singlePartyOpenAHead tracer workDir node txId $ \client walletSk -> do
singlePartyOpenAHead tracer workDir node txId $ \client walletSk _headId -> do
case scenario of
Idle -> forever $ pure ()
RespendUTxO -> do
Expand Down
6 changes: 3 additions & 3 deletions hydra-cluster/src/Hydra/Cluster/Scenarios.hs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ singlePartyOpenAHead ::
RunningNode ->
[TxId] ->
-- | Continuation called when the head is open
(HydraClient -> SigningKey PaymentKey -> IO ()) ->
IO ()
(HydraClient -> SigningKey PaymentKey -> HeadId -> IO a) ->
IO a
singlePartyOpenAHead tracer workDir node hydraScriptsTxId callback =
(`finally` returnFundsToFaucet tracer node Alice) $ do
refuelIfNeeded tracer node Alice 25_000_000
Expand Down Expand Up @@ -361,7 +361,7 @@ singlePartyOpenAHead tracer workDir node hydraScriptsTxId callback =
waitFor hydraTracer (10 * blockTime) [n1] $
output "HeadIsOpen" ["utxo" .= toJSON utxoToCommit, "headId" .= headId]

callback n1 walletSk
callback n1 walletSk headId
where
RunningNode{networkId, nodeSocket, blockTime} = node

Expand Down

0 comments on commit 0be6159

Please sign in to comment.