Skip to content

Commit

Permalink
lint: stylish-haskell
Browse files Browse the repository at this point in the history
  • Loading branch information
nbacquey authored and facundominguez committed Aug 6, 2024
1 parent fded94a commit 512f637
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
Expand Down Expand Up @@ -60,14 +60,14 @@ data GenesisConfig = GenesisConfig

-- | Genesis configuration flags and low-level args, as parsed from config file or CLI
data GenesisConfigFlags = GenesisConfigFlags
{ gcfEnableCSJ :: Bool
, gcfEnableLoEAndGDD :: Bool
, gcfEnableLoP :: Bool
, gcfBulkSyncGracePeriod :: Maybe Integer
, gcfBucketCapacity :: Maybe Integer
, gcfBucketRate :: Maybe Integer
, gcfCSJJumpSize :: Maybe Integer
, gcfGDDRateLimit :: Maybe DiffTime
{ gcfEnableCSJ :: Bool
, gcfEnableLoEAndGDD :: Bool
, gcfEnableLoP :: Bool
, gcfBulkSyncGracePeriod :: Maybe Integer
, gcfBucketCapacity :: Maybe Integer
, gcfBucketRate :: Maybe Integer
, gcfCSJJumpSize :: Maybe Integer
, gcfGDDRateLimit :: Maybe DiffTime
} deriving stock (Eq, Generic, Show)

defaultGenesisConfigFlags :: GenesisConfigFlags
Expand Down Expand Up @@ -153,7 +153,7 @@ data LoEAndGDDNodeKernelArgs m blk = LoEAndGDDNodeKernelArgs {
-- opened the ChainDB (which happens before we initialize the NodeKernel).
-- After that, this TVar will not be modified again.
lgnkaLoEFragmentTVar :: !(StrictTVar m (ChainDB.GetLoEFragment m blk))
, lgnkaGDDRateLimit :: DiffTime
, lgnkaGDDRateLimit :: DiffTime
}
-- | Create the initial 'GenesisNodeKernelArgs" (with a temporary
-- 'ChainDB.GetLoEFragment' that will be replaced via 'setGetLoEFragment') and a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ import Ouroboros.Consensus.MiniProtocol.ChainSync.Client
import Ouroboros.Consensus.MiniProtocol.ChainSync.Client.InFutureCheck
(SomeHeaderInFutureCheck)
import Ouroboros.Consensus.Node.Genesis (GenesisNodeKernelArgs (..),
LoEAndGDDConfig (..), LoEAndGDDNodeKernelArgs (..), setGetLoEFragment)
LoEAndGDDConfig (..), LoEAndGDDNodeKernelArgs (..),
setGetLoEFragment)
import Ouroboros.Consensus.Node.GSM (GsmNodeKernelArgs (..))
import qualified Ouroboros.Consensus.Node.GSM as GSM
import Ouroboros.Consensus.Node.Run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import Test.Tasty.QuickCheck
import Test.Util.Orphans.IOLike ()
import Test.Util.PartialAccessors
import Test.Util.TestBlock (TestBlock)
import Test.Util.TestEnv (adjustQuickCheckMaxSize, adjustQuickCheckTests)
import Test.Util.TestEnv (adjustQuickCheckMaxSize,
adjustQuickCheckTests)

tests :: TestTree
tests =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ import Ouroboros.Consensus.Config.SecurityParam
import Ouroboros.Consensus.Genesis.Governor (DensityBounds,
densityDisconnect, sharedCandidatePrefix)
import Ouroboros.Consensus.MiniProtocol.ChainSync.Client
(ChainSyncClientException (..),
ChainSyncState (..))
(ChainSyncClientException (..), ChainSyncState (..))
import Ouroboros.Consensus.Util.Condense (condense)
import Ouroboros.Network.AnchoredFragment (AnchoredFragment)
import qualified Ouroboros.Network.AnchoredFragment as AF
Expand Down Expand Up @@ -474,10 +473,10 @@ prop_densityDisconnectTriggersChainSel =
let
othersCount = Map.size (adversarialPeers $ psSchedule gtSchedule)
exnCorrect = case exceptionsByComponent ChainSyncClient stateView of
[fromException -> Just DensityTooLow] -> True
[fromException -> Just DensityTooLow] -> True
[fromException -> Just CandidateTooSparse{}] -> True
[] | othersCount == 0 -> True
_ -> False
[] | othersCount == 0 -> True
_ -> False
tipPointCorrect = Just (getTrunkTip gtBlockTree) == svTipBlock
in counterexample "Unexpected exceptions" exnCorrect
.&&.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import Test.Tasty
import Test.Tasty.QuickCheck
import Test.Util.Orphans.IOLike ()
import Test.Util.PartialAccessors
import Test.Util.TestEnv (adjustQuickCheckMaxSize, adjustQuickCheckTests)
import Test.Util.TestEnv (adjustQuickCheckMaxSize,
adjustQuickCheckTests)

tests :: TestTree
tests =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import Test.Tasty
import Test.Tasty.QuickCheck
import Test.Util.Orphans.IOLike ()
import Test.Util.PartialAccessors
import Test.Util.TestEnv (adjustQuickCheckMaxSize, adjustQuickCheckTests)
import Test.Util.TestEnv (adjustQuickCheckMaxSize,
adjustQuickCheckTests)

tests :: TestTree
tests =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ itIsTimeToRestartTheNode :: NodeLifecycle blk m -> DiffTime -> Bool
itIsTimeToRestartTheNode NodeLifecycle {nlMinDuration} duration =
case nlMinDuration of
Just minInterval -> duration > minInterval
Nothing -> False
Nothing -> False

-- | The 'Tick' contains a state update for a specific peer.
-- If the peer has not terminated by protocol rules, this will update its TMVar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ sharedCandidatePrefix curChain candidates =
-- When there is no intersection, we assume the candidate fragment is
-- empty and anchored at the immutable tip.
-- See Note [CSJ truncates the candidate fragments].
Nothing -> (peer, AF.takeOldest 0 curChain)
Nothing -> (peer, AF.takeOldest 0 curChain)
Just (_, suffix) -> (peer, suffix)

immutableTipSuffixes =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ import Ouroboros.Consensus.Util.STM (blockUntilJust,
forkLinkedWatcher)
import Ouroboros.Network.AnchoredFragment (AnchoredFragment)
import qualified Ouroboros.Network.AnchoredFragment as AF
import Ouroboros.Network.BlockFetch (BlockFetchConfiguration (..), GenesisBlockFetchConfiguration (..),
import Ouroboros.Network.BlockFetch (BlockFetchConfiguration (..),
BlockFetchConsensusInterface (..), FetchMode (..),
blockFetchLogic, bracketFetchClient,
bracketKeepAliveClient, bracketSyncWithFetchClient,
newFetchClientRegistry)
GenesisBlockFetchConfiguration (..), blockFetchLogic,
bracketFetchClient, bracketKeepAliveClient,
bracketSyncWithFetchClient, newFetchClientRegistry)
import Ouroboros.Network.BlockFetch.Client (blockFetchClient)
import Ouroboros.Network.ControlMessage (ControlMessage (..))
import Ouroboros.Network.Mock.Chain (Chain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ import Ouroboros.Consensus.MiniProtocol.ChainSync.Client
(CSJConfig (..), ChainDbView (..),
ChainSyncClientException,
ChainSyncClientHandleCollection (..),
ChainSyncClientResult (..),
ChainSyncLoPBucketConfig (..), ChainSyncState (..),
ChainSyncStateView (..), ConfigEnv (..), Consensus,
DynamicEnv (..), Our (..), Their (..),
TraceChainSyncClientEvent (..), bracketChainSyncClient,
chainSyncClient, chainSyncStateFor,
newChainSyncClientHandleCollection,
viewChainSyncState)
ChainSyncClientResult (..), ChainSyncLoPBucketConfig (..),
ChainSyncState (..), ChainSyncStateView (..),
ConfigEnv (..), Consensus, DynamicEnv (..), Our (..),
Their (..), TraceChainSyncClientEvent (..),
bracketChainSyncClient, chainSyncClient, chainSyncStateFor,
newChainSyncClientHandleCollection, viewChainSyncState)
import qualified Ouroboros.Consensus.MiniProtocol.ChainSync.Client.InFutureCheck as InFutureCheck
import Ouroboros.Consensus.Node.GsmState (GsmState (Syncing))
import Ouroboros.Consensus.Node.NetworkProtocolVersion
Expand Down

0 comments on commit 512f637

Please sign in to comment.