Skip to content

Commit 92dcb95

Browse files
noonioffakenz
authored andcommitted
Remove mandatory networkId from follow function
1 parent ec8c532 commit 92dcb95

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

hydra-chain-observer/src/Hydra/Blockfrost/ChainObserver.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ blockfrostClient ::
6969
NodeClient IO
7070
blockfrostClient tracer projectPath blockConfirmations = do
7171
NodeClient
72-
{ follow = \_ startChainFrom observerHandler -> do
72+
{ follow = \startChainFrom observerHandler -> do
7373
prj <- Blockfrost.projectFromFile projectPath
7474

7575
Blockfrost.Block{_blockHash = (Blockfrost.BlockHash genesisBlockHash)} <-

hydra-chain-observer/src/Hydra/ChainObserver.hs

+3-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ main observerHandler = do
1919
traceWith tracer KnownScripts{scriptInfo = Contract.scriptInfo}
2020
case opts of
2121
DirectOpts DirectOptions{networkId, nodeSocket, startChainFrom} -> do
22-
let NodeClient{follow} = ouroborusClient tracer nodeSocket
23-
follow networkId startChainFrom observerHandler
22+
let NodeClient{follow} = ouroborusClient tracer nodeSocket networkId
23+
follow startChainFrom observerHandler
2424
BlockfrostOpts BlockfrostOptions{projectPath, startChainFrom} -> do
2525
-- FIXME: should be configurable
2626
let blockConfirmations = 1
2727
NodeClient{follow} = blockfrostClient tracer projectPath blockConfirmations
28-
-- FIXME
29-
follow (error "not-used") startChainFrom observerHandler
28+
follow startChainFrom observerHandler

hydra-chain-observer/src/Hydra/ChainObserver/NodeClient.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ defaultObserverHandler :: Applicative m => ObserverHandler m
4343
defaultObserverHandler = const $ pure ()
4444

4545
newtype NodeClient m = NodeClient
46-
{ follow :: NetworkId -> Maybe ChainPoint -> ObserverHandler m -> m ()
46+
{ follow :: Maybe ChainPoint -> ObserverHandler m -> m ()
4747
}
4848

4949
type ChainObserverLog :: Type

hydra-chain-observer/src/Hydra/Ouroborus/ChainObserver.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ import Ouroboros.Network.Protocol.ChainSync.Client (
4646
ouroborusClient ::
4747
Tracer IO ChainObserverLog ->
4848
SocketPath ->
49+
NetworkId ->
4950
NodeClient IO
50-
ouroborusClient tracer nodeSocket =
51+
ouroborusClient tracer nodeSocket networkId =
5152
NodeClient
52-
{ follow = \networkId startChainFrom observerHandler -> do
53+
{ follow = \startChainFrom observerHandler -> do
5354
traceWith tracer ConnectingToNode{nodeSocket, networkId}
5455
chainPoint <- case startChainFrom of
5556
Nothing -> queryTip networkId nodeSocket

0 commit comments

Comments
 (0)