Skip to content

Commit

Permalink
Import ShowProxy from consensus instead of network where possible
Browse files Browse the repository at this point in the history
Instead of:
```
import Ouroboros.Network.Util.ShowProxy
```
Do:
```
import Ouroboros.Consensus.Util (ShowProxy)
```
This reduces the number of times consensus needs to import something from
network. This will make #2614 easier.
  • Loading branch information
mrBliss committed Oct 26, 2020
1 parent 3fbbff9 commit 843a7e0
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 12 deletions.
Expand Up @@ -45,14 +45,13 @@ import NoThunks.Class (NoThunks)

import Cardano.Slotting.EpochInfo

import Ouroboros.Network.Util.ShowProxy

import Ouroboros.Consensus.Block.Abstract
import Ouroboros.Consensus.Config
import qualified Ouroboros.Consensus.HardFork.History as History
import Ouroboros.Consensus.Ledger.Abstract
import Ouroboros.Consensus.Protocol.Abstract
import Ouroboros.Consensus.TypeFamilyWrappers
import Ouroboros.Consensus.Util (ShowProxy)
import Ouroboros.Consensus.Util.SOP (fn_5)

import Ouroboros.Consensus.HardFork.Combinator.Abstract
Expand Down
Expand Up @@ -30,12 +30,10 @@ import Data.Typeable (Typeable)
import Data.Word
import NoThunks.Class (NoThunks)

import Ouroboros.Network.Util.ShowProxy

import Ouroboros.Consensus.Block
import Ouroboros.Consensus.HeaderValidation
import Ouroboros.Consensus.TypeFamilyWrappers
import Ouroboros.Consensus.Util ((.:))
import Ouroboros.Consensus.Util (ShowProxy, (.:))
import Ouroboros.Consensus.Util.SOP

import Ouroboros.Consensus.HardFork.Combinator.Abstract
Expand Down
Expand Up @@ -45,14 +45,14 @@ import Data.Type.Equality
import Data.Typeable (Typeable)

import Cardano.Binary (enforceSize)
import Ouroboros.Network.Util.ShowProxy

import Ouroboros.Consensus.HardFork.Abstract (hardForkSummary)
import Ouroboros.Consensus.HardFork.History (Bound (..), EraParams,
Shape (..))
import qualified Ouroboros.Consensus.HardFork.History as History
import Ouroboros.Consensus.Ledger.Abstract
import Ouroboros.Consensus.Node.Serialisation (Some (..))
import Ouroboros.Consensus.Util (ShowProxy)
import Ouroboros.Consensus.Util.Counting (getExactly)
import Ouroboros.Consensus.Util.DepPair

Expand Down
Expand Up @@ -31,12 +31,11 @@ import GHC.Generics (Generic)
import GHC.Stack (HasCallStack)
import NoThunks.Class (NoThunks)

import Ouroboros.Network.Util.ShowProxy

import Ouroboros.Consensus.Block
import Ouroboros.Consensus.Ledger.Abstract
import Ouroboros.Consensus.Ledger.SupportsMempool
import Ouroboros.Consensus.TypeFamilyWrappers
import Ouroboros.Consensus.Util (ShowProxy)

import Ouroboros.Consensus.HardFork.Combinator.Abstract
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras
Expand Down
Expand Up @@ -59,7 +59,6 @@ import Ouroboros.Network.Protocol.LocalStateQuery.Type
import Ouroboros.Network.Protocol.LocalTxSubmission.Codec
import Ouroboros.Network.Protocol.LocalTxSubmission.Server
import Ouroboros.Network.Protocol.LocalTxSubmission.Type
import Ouroboros.Network.Util.ShowProxy

import Ouroboros.Consensus.Block
import Ouroboros.Consensus.Config
Expand All @@ -73,6 +72,7 @@ import Ouroboros.Consensus.Node.Run
import Ouroboros.Consensus.Node.Serialisation
import qualified Ouroboros.Consensus.Node.Tracers as Node
import Ouroboros.Consensus.NodeKernel
import Ouroboros.Consensus.Util (ShowProxy)
import Ouroboros.Consensus.Util.IOLike
import Ouroboros.Consensus.Util.Orphans ()
import Ouroboros.Consensus.Util.ResourceRegistry
Expand Down
Expand Up @@ -73,7 +73,6 @@ import Ouroboros.Network.Protocol.TxSubmission.Server
import Ouroboros.Network.Protocol.TxSubmission.Type
import Ouroboros.Network.TxSubmission.Inbound
import Ouroboros.Network.TxSubmission.Outbound
import Ouroboros.Network.Util.ShowProxy

import Ouroboros.Consensus.Block
import Ouroboros.Consensus.Ledger.SupportsMempool
Expand All @@ -86,6 +85,7 @@ import Ouroboros.Consensus.Node.Run
import Ouroboros.Consensus.Node.Serialisation
import qualified Ouroboros.Consensus.Node.Tracers as Node
import Ouroboros.Consensus.NodeKernel
import Ouroboros.Consensus.Util (ShowProxy)
import Ouroboros.Consensus.Util.IOLike
import Ouroboros.Consensus.Util.Orphans ()
import Ouroboros.Consensus.Util.ResourceRegistry
Expand Down
2 changes: 1 addition & 1 deletion ouroboros-consensus/src/Ouroboros/Consensus/Node/Run.hs
Expand Up @@ -18,7 +18,6 @@ module Ouroboros.Consensus.Node.Run (
) where

import Ouroboros.Network.Block (Serialised)
import Ouroboros.Network.Util.ShowProxy

import Ouroboros.Consensus.Block
import Ouroboros.Consensus.Config.SupportsNode
Expand All @@ -31,6 +30,7 @@ import Ouroboros.Consensus.Ledger.SupportsProtocol
import Ouroboros.Consensus.Node.InitStorage
import Ouroboros.Consensus.Node.NetworkProtocolVersion
import Ouroboros.Consensus.Node.Serialisation
import Ouroboros.Consensus.Util (ShowProxy)

import Ouroboros.Consensus.Storage.ChainDB
(ImmutableDbSerialiseConstraints,
Expand Down
Expand Up @@ -72,13 +72,13 @@ import Cardano.Binary (enforceSize)
import Ouroboros.Network.Block (Serialised (..), fromSerialised,
mkSerialised)
import Ouroboros.Network.BlockFetch (SizeInBytes)
import Ouroboros.Network.Util.ShowProxy

import Ouroboros.Consensus.Block
import Ouroboros.Consensus.Protocol.Abstract
import Ouroboros.Consensus.Storage.Common (BinaryBlockInfo (..),
PrefixLen (..), addPrefixLen, takePrefix)
import Ouroboros.Consensus.TypeFamilyWrappers
import Ouroboros.Consensus.Util (ShowProxy (..))
import Ouroboros.Consensus.Util.RedundantConstraints

{-------------------------------------------------------------------------------
Expand Down

0 comments on commit 843a7e0

Please sign in to comment.