Skip to content

Commit

Permalink
Updated to use typed-protocols-0.3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed Oct 22, 2024
1 parent 8761e8c commit 29187e2
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2,178 deletions.
12 changes: 11 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2024-10-10T08:11:33Z
, cardano-haskell-packages 2024-10-14T23:19:53Z
, cardano-haskell-packages 2024-10-21T06:28:35Z

packages:
cardano-api
Expand Down Expand Up @@ -52,3 +52,13 @@ write-ghc-environment-files: always
constraints:
Cabal < 3.14,
cardano-ledger-shelley ^>= 1.14.1

-- coot/typed-protocols-new-api
source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus
tag: 254aa51558cc71baa5d23faa4bdb5b3ae1e7ba70
--sha256: sha256-Drnc35CQFB5QrYgHFYaqwn7Tnc8p11KJq3vp9DvpKoE=
subdir: ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-diffusion
6 changes: 3 additions & 3 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ library internal
ouroboros-consensus-diffusion ^>=0.18,
ouroboros-consensus-protocol ^>=0.9.0.2,
ouroboros-network,
ouroboros-network-api ^>=0.10,
ouroboros-network-api ^>=0.11,
ouroboros-network-framework,
ouroboros-network-protocols,
parsec,
Expand All @@ -222,7 +222,7 @@ library internal
time,
transformers,
transformers-except ^>=0.1.3,
typed-protocols ^>=0.1.1,
typed-protocols ^>=0.3,
vector,
yaml,

Expand Down Expand Up @@ -257,7 +257,7 @@ library
memory,
nothunks,
ouroboros-network-protocols,
typed-protocols ^>=0.1.1,
typed-protocols,

library gen
import: project-config
Expand Down
26 changes: 16 additions & 10 deletions cardano-api/internal/Cardano/Api/IPC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Client as Net.Tx

import Control.Concurrent.STM (TMVar, atomically, newEmptyTMVarIO, putTMVar, takeTMVar,
tryPutTMVar)
import Control.Exception (throwIO)
import Control.Monad (void)
import Control.Monad.IO.Class
import Control.Tracer (nullTracer)
Expand Down Expand Up @@ -202,15 +203,19 @@ connectToLocalNodeWithVersion
, localConsensusModeParams
}
clients =
liftIO $ Net.withIOManager $ \iomgr ->
Net.connectTo
(Net.localSnocket iomgr)
Net.NetworkConnectTracers
{ Net.nctMuxTracer = nullTracer
, Net.nctHandshakeTracer = nullTracer
}
versionedProtocls
(unFile localNodeSocketPath)
liftIO $ Net.withIOManager $ \iomgr -> do
r <-
Net.connectTo
(Net.localSnocket iomgr)
Net.NetworkConnectTracers
{ Net.nctMuxTracer = nullTracer
, Net.nctHandshakeTracer = nullTracer
}
versionedProtocls
(unFile localNodeSocketPath)
case r of
Left e -> throwIO e
Right _ -> pure ()
where
versionedProtocls =
-- First convert from the mode-parametrised view of things to the
Expand Down Expand Up @@ -302,10 +307,11 @@ mkVersionedProtocols networkid ptcl unversionedClients =
)
, localStateQueryProtocol =
Net.InitiatorProtocolOnly $
Net.mkMiniProtocolCbFromPeer $
Net.mkMiniProtocolCbFromPeerSt $
const
( nullTracer
, cStateQueryCodec
, Net.Query.StateIdle
, maybe
Net.localStateQueryPeerNull
Net.Query.localStateQueryClientPeer
Expand Down
Loading

0 comments on commit 29187e2

Please sign in to comment.