Skip to content

Commit 0c6d8f5

Browse files
dmq: integrate LedgerPeerSnapshot changes
1 parent c46c527 commit 0c6d8f5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

dmq-node/src/DMQ/Configuration.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE DataKinds #-}
12
{-# LANGUAGE DeriveGeneric #-}
23
{-# LANGUAGE DerivingVia #-}
34
{-# LANGUAGE FlexibleContexts #-}
@@ -69,7 +70,7 @@ import Ouroboros.Network.OrphanInstances ()
6970
import Ouroboros.Network.PeerSelection.Governor.Types
7071
(PeerSelectionTargets (..), makePublicPeerSelectionStateVar)
7172
import Ouroboros.Network.PeerSelection.LedgerPeers.Type
72-
(LedgerPeerSnapshot (..))
73+
(LedgerPeerSnapshot (..), LedgerPeersKind (..))
7374
import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (..))
7475
import Ouroboros.Network.Server.RateLimiting (AcceptedConnectionsLimit (..))
7576
import Ouroboros.Network.Snocket (LocalAddress (..), RemoteAddress)
@@ -569,8 +570,8 @@ mkDiffusionConfiguration
569570
updateLedgerPeerSnapshot :: HasCallStack
570571
=> FilePath
571572
-> STM IO (Maybe FilePath)
572-
-> (Maybe LedgerPeerSnapshot -> STM IO ())
573-
-> IO (Maybe LedgerPeerSnapshot)
573+
-> (Maybe (LedgerPeerSnapshot BigLedgerPeers) -> STM IO ())
574+
-> IO (Maybe (LedgerPeerSnapshot BigLedgerPeers))
574575
updateLedgerPeerSnapshot topologyDir readLedgerPeerPath writeVar = do
575576
mPeerSnapshotFile <- atomically readLedgerPeerPath
576577
mLedgerPeerSnapshot <- case mPeerSnapshotFile of
@@ -604,5 +605,3 @@ data ConfigurationError =
604605

605606
instance Exception ConfigurationError where
606607
displayException NoAddressInformation = "no ipv4 or ipv6 address specified, use --host-addr or --host-ipv6-addr"
607-
608-

dmq-node/src/DMQ/Configuration/Topology.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE DataKinds #-}
12
{-# LANGUAGE DeriveGeneric #-}
23
{-# LANGUAGE FlexibleInstances #-}
34
{-# LANGUAGE NamedFieldPuns #-}
@@ -16,7 +17,7 @@ import Data.Text qualified as Text
1617
import Ouroboros.Network.Diffusion.Topology (NetworkTopology (..))
1718
import Ouroboros.Network.OrphanInstances (localRootPeersGroupsFromJSON,
1819
networkTopologyFromJSON, networkTopologyToJSON)
19-
import Ouroboros.Network.PeerSelection.LedgerPeers.Type (LedgerPeerSnapshot)
20+
import Ouroboros.Network.PeerSelection.LedgerPeers.Type (LedgerPeerSnapshot, LedgerPeersKind (..))
2021
import System.Exit (die)
2122

2223
data NoExtraConfig = NoExtraConfig
@@ -69,7 +70,7 @@ readTopologyFileOrError nc =
6970
>>= either (die . Text.unpack)
7071
pure
7172

72-
readPeerSnapshotFile :: FilePath -> IO (Either Text LedgerPeerSnapshot)
73+
readPeerSnapshotFile :: FilePath -> IO (Either Text (LedgerPeerSnapshot BigLedgerPeers))
7374
readPeerSnapshotFile psf = do
7475
eBs <- try $ BS.readFile psf
7576
case eBs of
@@ -89,7 +90,7 @@ readPeerSnapshotFile psf = do
8990
, Text.pack err
9091
]
9192

92-
readPeerSnapshotFileOrError :: FilePath -> IO LedgerPeerSnapshot
93+
readPeerSnapshotFileOrError :: FilePath -> IO (LedgerPeerSnapshot BigLedgerPeers)
9394
readPeerSnapshotFileOrError psf =
9495
readPeerSnapshotFile psf
9596
>>= either (die . Text.unpack)

0 commit comments

Comments
 (0)