Skip to content

Commit

Permalink
typed-protocols: udpated upstream dependencies
Browse files Browse the repository at this point in the history
Updated: `ouroboros-network-framework`, `ouroboros-network` and
`ouroboros-consensus` after restructuring `typed-protocols` packages.
  • Loading branch information
coot committed Oct 7, 2021
1 parent c81f148 commit 1e048ad
Show file tree
Hide file tree
Showing 36 changed files with 67 additions and 44 deletions.
1 change: 1 addition & 0 deletions ouroboros-consensus-test/ouroboros-consensus-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ library
, tasty
, tasty-golden
, tasty-quickcheck
, typed-protocols
, template-haskell
, text >=1.2 && <1.3
, time
Expand Down
7 changes: 4 additions & 3 deletions ouroboros-consensus-test/src/Test/ThreadNet/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ import Data.Void (Void)
import GHC.Stack
import System.Random (mkStdGen)

import Network.TypedProtocol.Codec (AnyMessage (..), CodecFailure,
mapFailureCodec)
import qualified Network.TypedProtocol.Codec as Codec

import qualified Ouroboros.Network.AnchoredFragment as AF
import Ouroboros.Network.BlockFetch (BlockFetchConfiguration (..),
TraceLabelPeer (..))
import Ouroboros.Network.Channel
import Ouroboros.Network.Codec (AnyMessage (..), CodecFailure,
mapFailureCodec)
import qualified Ouroboros.Network.Codec as Codec
import Ouroboros.Network.MockChain.Chain (Chain (Genesis))
import Ouroboros.Network.Point (WithOrigin (..))
import qualified Ouroboros.Network.Protocol.ChainSync.Type as CS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,20 @@ module Ouroboros.Consensus.Network.NodeToClient (

import Codec.CBOR.Decoding (Decoder)
import Codec.CBOR.Encoding (Encoding)
import Codec.CBOR.Read (DeserialiseFailure)
import Codec.Serialise (Serialise)

import Control.Tracer
import Data.ByteString.Lazy (ByteString)
import Data.Void (Void)

import Network.TypedProtocol.Codec

import qualified Ouroboros.Network.AnchoredFragment as AF
import Ouroboros.Network.Block (Serialised, decodePoint, decodeTip,
encodePoint, encodeTip)
import Ouroboros.Network.BlockFetch
import Ouroboros.Network.Channel
import Ouroboros.Network.Codec
import Ouroboros.Network.Driver
import Ouroboros.Network.Mux
import Ouroboros.Network.NodeToClient hiding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module Ouroboros.Consensus.Network.NodeToNode (

import Codec.CBOR.Decoding (Decoder)
import Codec.CBOR.Encoding (Encoding)
import Codec.CBOR.Read (DeserialiseFailure)
import Control.Monad (forever)
import Control.Monad.Class.MonadTime (MonadTime)
import Control.Monad.Class.MonadTimer (MonadTimer)
Expand All @@ -42,14 +43,15 @@ import Data.ByteString.Lazy (ByteString)
import Data.Map.Strict (Map)
import Data.Void (Void)

import Network.TypedProtocol.Codec

import Ouroboros.Network.AnchoredFragment (AnchoredFragment)
import Ouroboros.Network.Block (Serialised (..), decodePoint,
decodeTip, encodePoint, encodeTip)
import Ouroboros.Network.BlockFetch
import Ouroboros.Network.BlockFetch.Client (BlockFetchClient,
blockFetchClient)
import Ouroboros.Network.Channel
import Ouroboros.Network.Codec
import Ouroboros.Network.DeltaQ
import Ouroboros.Network.Driver
import Ouroboros.Network.KeepAlive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ module Ouroboros.Network.Driver.Simple (
) where

import Network.TypedProtocol.Core
import Network.TypedProtocol.Codec
import Network.TypedProtocol.Pipelined
import Network.TypedProtocol.Driver

import Ouroboros.Network.Util.ShowProxy

import Ouroboros.Network.Channel
import Ouroboros.Network.Codec

import Control.Monad.Class.MonadSTM
import Control.Monad.Class.MonadAsync
Expand Down
2 changes: 1 addition & 1 deletion ouroboros-network-framework/src/Ouroboros/Network/Mux.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import Data.Void (Void)
import qualified Data.ByteString.Lazy as LBS

import Network.TypedProtocol.Core
import Network.TypedProtocol.Codec
import Network.TypedProtocol.Pipelined

import qualified Network.Mux.Compat as Mux
Expand All @@ -50,7 +51,6 @@ import Network.Mux

import Ouroboros.Network.Channel
import Ouroboros.Network.ConnectionId
import Ouroboros.Network.Codec
import Ouroboros.Network.Driver
import Ouroboros.Network.Util.ShowProxy (ShowProxy)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ import qualified Data.Map as Map
import Data.Maybe (mapMaybe)
import Text.Printf

import Network.TypedProtocol.Codec.CBOR

import qualified Codec.CBOR.Encoding as CBOR
import qualified Codec.CBOR.Decoding as CBOR
import qualified Codec.CBOR.Read as CBOR
import qualified Codec.CBOR.Term as CBOR

import Ouroboros.Network.Codec
import Ouroboros.Network.CodecCBORTerm
import Ouroboros.Network.Driver.Limits

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import Data.Text (Text)
import qualified Data.Text as T
import Data.ByteString.Lazy (ByteString)

import Ouroboros.Network.Codec
import Ouroboros.Network.CodecCBORTerm
import Network.TypedProtocol.Codec

import Ouroboros.Network.CodecCBORTerm
import Ouroboros.Network.Protocol.Handshake.Codec
import Ouroboros.Network.Protocol.Handshake.Type
import Ouroboros.Network.Protocol.Handshake.Version
Expand Down
4 changes: 2 additions & 2 deletions ouroboros-network-framework/src/Ouroboros/Network/Socket.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ import qualified Network.Socket as Socket
import Control.Tracer

import qualified Network.Mux.Compat as Mx
import Network.Mux.DeltaQ.TraceTransformer
import Network.Mux.DeltaQ.TraceTransformer
import Network.TypedProtocol.Codec hiding (encode, decode)

import Ouroboros.Network.ConnectionId
import Ouroboros.Network.Codec hiding (encode, decode)
import Ouroboros.Network.Driver.Limits
import Ouroboros.Network.Mux
import Ouroboros.Network.ErrorPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
module Test.Ouroboros.Network.Driver (tests) where

import Network.TypedProtocol.Core
import Network.TypedProtocol.Codec

import Ouroboros.Network.Codec
import Ouroboros.Network.Channel
import Ouroboros.Network.Driver
import Ouroboros.Network.Driver.Limits
Expand Down
3 changes: 2 additions & 1 deletion ouroboros-network/demo/chain-sync.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import System.Random

import qualified Codec.Serialise as CBOR

import Network.TypedProtocol.Codec

import qualified Ouroboros.Network.AnchoredFragment as AF
import Ouroboros.Network.Block
import qualified Ouroboros.Network.MockChain.Chain as Chain
Expand All @@ -49,7 +51,6 @@ import Ouroboros.Network.Snocket
import Ouroboros.Network.Socket
import Ouroboros.Network.Testing.ConcreteBlock

import Ouroboros.Network.Codec
import Ouroboros.Network.Driver
import Ouroboros.Network.Protocol.Handshake.Codec
import Ouroboros.Network.Protocol.Handshake.Unversioned
Expand Down
8 changes: 6 additions & 2 deletions ouroboros-network/ouroboros-network.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ library
network-mux >=0.1 && <1.0,
ouroboros-network-framework
>=0.1 && <1.0,
typed-protocols >=0.1 && < 1.0
typed-protocols >=0.1 && < 1.0,
typed-protocols-cborg
>=0.1 && < 1.0

ghc-options: -Wall
-Wno-unticked-promoted-constructors
Expand Down Expand Up @@ -314,7 +316,8 @@ test-suite test
ouroboros-network-framework,
ouroboros-network-testing,
ouroboros-protocol-tests,
typed-protocols
typed-protocols,
typed-protocols-examples

if os(windows)
build-depends: Win32-network <0.2.0.0,
Expand Down Expand Up @@ -377,6 +380,7 @@ executable demo-chain-sync

contra-tracer,

typed-protocols,
network-mux,
ouroboros-network-framework,
ouroboros-network
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import Control.Monad.IOSim (runSimOrThrow)
import Control.Tracer (nullTracer)

import Network.TypedProtocol.Proofs
import Network.TypedProtocol.Codec

import Ouroboros.Network.Channel
import Ouroboros.Network.Codec
import Ouroboros.Network.Driver.Simple (runConnectedPeers)

import Ouroboros.Network.Block (Serialised (..),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import Control.Tracer (nullTracer)
import Control.Monad.IOSim (runSimOrThrow)

import Network.TypedProtocol.Proofs (connect, connectPipelined)
import Network.TypedProtocol.Codec

import Ouroboros.Network.Channel
import Ouroboros.Network.Codec
import Ouroboros.Network.Driver

import Ouroboros.Network.Block (pattern GenesisPoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import Control.Monad.Class.MonadThrow ( MonadCatch
import Control.Tracer (nullTracer)

import Network.TypedProtocol.Core
import Network.TypedProtocol.Codec
import Network.TypedProtocol.Proofs

import Test.Ouroboros.Network.Testing.Utils (prop_codec_cborM,
prop_codec_valid_cbor_encoding, splits2, splits3)

import Ouroboros.Network.Channel
import Ouroboros.Network.Codec
import Ouroboros.Network.CodecCBORTerm
import Ouroboros.Network.Driver.Simple ( runPeer
, runConnectedPeers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as BL

import Network.TypedProtocol.Core
import Network.TypedProtocol.Codec hiding (prop_codec)
import Network.TypedProtocol.Proofs

import Ouroboros.Network.Channel
import Ouroboros.Network.Codec hiding (prop_codec)
import Ouroboros.Network.Driver.Limits
import Ouroboros.Network.Driver.Simple (runConnectedPeers)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ import Control.Monad.IOSim
import Control.Monad.ST (runST)
import Control.Tracer (nullTracer)

import Codec.Serialise (DeserialiseFailure)
import qualified Codec.Serialise as Serialise (decode, encode)

import Network.TypedProtocol.Proofs
import Network.TypedProtocol.Codec hiding (prop_codec)

import Ouroboros.Network.Codec hiding (prop_codec)
import Ouroboros.Network.Channel
import Ouroboros.Network.Driver.Simple (runConnectedPeers)
import Ouroboros.Network.Util.ShowProxy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import Control.Monad.Class.MonadST (MonadST)
import Control.Monad.Class.MonadThrow (MonadCatch)
import Control.Tracer (nullTracer)

import Codec.Serialise (Serialise)
import Codec.Serialise (Serialise, DeserialiseFailure)
import qualified Codec.Serialise as Serialise (encode, decode)

import Network.TypedProtocol.Core
import Network.TypedProtocol.Proofs
import Network.TypedProtocol.Codec hiding (prop_codec)

import Ouroboros.Network.Channel
import Ouroboros.Network.Codec hiding (prop_codec)
import Ouroboros.Network.Driver.Simple (runConnectedPeers)
import Ouroboros.Network.Util.ShowProxy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import Cardano.Slotting.Slot (SlotNo (..))
import Control.Monad.IOSim (runSimOrThrow)
import Network.TypedProtocol.Pipelined (Nat (Succ, Zero), natToInt, unsafeIntToNat)
import Network.TypedProtocol.Proofs
import Network.TypedProtocol.Codec

import Ouroboros.Network.Channel
import Ouroboros.Network.Codec
import Ouroboros.Network.Driver
import Ouroboros.Network.Util.ShowProxy (ShowProxy)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ import Control.Monad.Class.MonadST (MonadST)
import Control.Monad.Class.MonadThrow (MonadCatch)
import Control.Tracer (Tracer(..), nullTracer)

import Codec.Serialise (Serialise)
import Codec.Serialise (Serialise, DeserialiseFailure)
import qualified Codec.Serialise as Serialise (encode, decode)

import Network.TypedProtocol.Core
import Network.TypedProtocol.Codec hiding (prop_codec)
import Network.TypedProtocol.Proofs

import Ouroboros.Network.Codec hiding (prop_codec)
import Ouroboros.Network.Channel
import Ouroboros.Network.Driver.Simple
(runConnectedPeersPipelined)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ import Control.Monad.Class.MonadAsync (MonadAsync)
import Control.Monad.Class.MonadST (MonadST)
import Control.Monad.Class.MonadThrow (MonadCatch)

import Codec.Serialise (DeserialiseFailure)
import qualified Codec.Serialise as Serialise (encode, decode)

import Network.TypedProtocol.Proofs
import Network.TypedProtocol.Codec hiding (prop_codec)

import Ouroboros.Network.Channel
import Ouroboros.Network.Codec hiding (prop_codec)
import Ouroboros.Network.Driver.Simple
(runConnectedPeersPipelined)
import Ouroboros.Network.Protocol.Trans.Hello.Type (Hello)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import qualified Codec.CBOR.Read as CBOR
import qualified Codec.CBOR.Term as CBOR
import qualified Codec.CBOR.FlatTerm as CBOR

import Ouroboros.Network.Codec
import Network.TypedProtocol.Codec

import Test.QuickCheck

Expand Down Expand Up @@ -47,7 +47,7 @@ prop_codec_cborM codec (AnyMessageAndAgency stok msg)
--
prop_codec_valid_cbor_encoding
:: forall ps.
Codec ps DeserialiseFailure IO ByteString
Codec ps CBOR.DeserialiseFailure IO ByteString
-> AnyMessageAndAgency ps
-> Property
prop_codec_valid_cbor_encoding Codec {encode} (AnyMessageAndAgency stok msg) =
Expand All @@ -57,7 +57,7 @@ prop_codec_valid_cbor_encoding Codec {encode} (AnyMessageAndAgency stok msg) =
where
deserialise :: [CBOR.TermToken]
-> ByteString
-> Either DeserialiseFailure [CBOR.TermToken]
-> Either CBOR.DeserialiseFailure [CBOR.TermToken]
deserialise !as bs =
case CBOR.deserialiseFromBytes CBOR.decodeTermToken bs of
Left e -> Left e
Expand Down
2 changes: 1 addition & 1 deletion ouroboros-network/src/Ouroboros/Network/NodeToClient.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ import qualified Codec.CBOR.Read as CBOR
import qualified Codec.CBOR.Term as CBOR

import Network.TypedProtocol (Peer)
import Network.TypedProtocol.Codec
import Network.Mux (WithMuxBearer (..))
import Network.Mux.Types (MuxRuntimeError (..))

import Ouroboros.Network.Codec
import Ouroboros.Network.Driver (TraceSendRecv(..))
import Ouroboros.Network.Driver.Simple (DecoderFailure)
import Ouroboros.Network.Driver.Limits (ProtocolLimitFailure (..))
Expand Down
3 changes: 2 additions & 1 deletion ouroboros-network/src/Ouroboros/Network/NodeToNode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ import Network.Mux (WithMuxBearer (..))
import Network.Mux.Types (MuxRuntimeError (..))
import qualified Network.Socket as Socket

import Ouroboros.Network.Codec
import Network.TypedProtocol.Codec.CBOR

import Ouroboros.Network.Driver (TraceSendRecv(..))
import Ouroboros.Network.Driver.Simple (DecoderFailure)
import Ouroboros.Network.Driver.Limits (ProtocolLimitFailure (..))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import qualified Codec.CBOR.Encoding as CBOR
import qualified Codec.CBOR.Read as CBOR
import Text.Printf

import Ouroboros.Network.Codec
import Network.TypedProtocol.Codec.CBOR

import Ouroboros.Network.Driver.Limits
import Ouroboros.Network.Protocol.BlockFetch.Type
import Ouroboros.Network.Protocol.Limits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ module Ouroboros.Network.Protocol.ChainSync.Codec
import Control.Monad.Class.MonadST
import Control.Monad.Class.MonadTime

import Ouroboros.Network.Codec
import Network.TypedProtocol.Codec.CBOR

import Ouroboros.Network.Driver.Limits
import Ouroboros.Network.Protocol.ChainSync.Type
import Ouroboros.Network.Protocol.Limits
Expand Down
Loading

0 comments on commit 1e048ad

Please sign in to comment.