diff --git a/ouroboros-consensus-cardano/src/byron/Ouroboros/Consensus/Byron/Ledger/Ledger.hs b/ouroboros-consensus-cardano/src/byron/Ouroboros/Consensus/Byron/Ledger/Ledger.hs index cdb22fdd0a..93fbb54a84 100644 --- a/ouroboros-consensus-cardano/src/byron/Ouroboros/Consensus/Byron/Ledger/Ledger.hs +++ b/ouroboros-consensus-cardano/src/byron/Ouroboros/Consensus/Byron/Ledger/Ledger.hs @@ -1,7 +1,7 @@ -{-# LANGUAGE DerivingVia #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE EmptyCase #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} diff --git a/ouroboros-consensus-cardano/src/unstable-byronspec/Ouroboros/Consensus/ByronSpec/Ledger/Ledger.hs b/ouroboros-consensus-cardano/src/unstable-byronspec/Ouroboros/Consensus/ByronSpec/Ledger/Ledger.hs index f1e9326b15..ca0e4c621c 100644 --- a/ouroboros-consensus-cardano/src/unstable-byronspec/Ouroboros/Consensus/ByronSpec/Ledger/Ledger.hs +++ b/ouroboros-consensus-cardano/src/unstable-byronspec/Ouroboros/Consensus/ByronSpec/Ledger/Ledger.hs @@ -1,11 +1,10 @@ -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE DerivingVia #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS -Wno-orphans #-} diff --git a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/HardFork/Combinator.hs b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/HardFork/Combinator.hs index 8da199af3e..a506e7577a 100644 --- a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/HardFork/Combinator.hs +++ b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/HardFork/Combinator.hs @@ -500,14 +500,14 @@ injectTx_AtoB = -------------------------------------------------------------------------------} instance BlockSupportsHFLedgerQuery '[BlockA, BlockB] where - answerBlockQueryHFLookup IZ _ q = case q of {} - answerBlockQueryHFLookup (IS IZ) _cfg q = case q of {} + answerBlockQueryHFLookup IZ _ q = case q of {} + answerBlockQueryHFLookup (IS IZ) _cfg q = case q of {} answerBlockQueryHFLookup (IS (IS idx)) _cfg _q = case idx of {} - answerBlockQueryHFTraverse IZ _cfg q = case q of {} - answerBlockQueryHFTraverse (IS IZ) _cfg q = case q of {} + answerBlockQueryHFTraverse IZ _cfg q = case q of {} + answerBlockQueryHFTraverse (IS IZ) _cfg q = case q of {} answerBlockQueryHFTraverse (IS (IS idx)) _cfg _q = case idx of {} - queryLedgerGetTraversingFilter IZ q = case q of {} - queryLedgerGetTraversingFilter (IS IZ) q = case q of {} + queryLedgerGetTraversingFilter IZ q = case q of {} + queryLedgerGetTraversingFilter (IS IZ) q = case q of {} queryLedgerGetTraversingFilter (IS (IS idx)) _q = case idx of {} diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/InjectTxs.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/InjectTxs.hs index 0835f0188e..d9cf212198 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/InjectTxs.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/InjectTxs.hs @@ -104,7 +104,7 @@ matchPolyTx is tx = -- translations. data TxWithOriginal tx xs blk = TxWithOriginal { origTx :: !(NS tx xs) - , blkTx :: !(tx blk) + , blkTx :: !(tx blk) } -- | A list of 'TxWithOriginal' that is ready to be partially applied by having diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Query.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Query.hs index 494c3c0fee..7ac83f1f57 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Query.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Query.hs @@ -61,8 +61,8 @@ import Ouroboros.Consensus.Ledger.Query.Version import Ouroboros.Consensus.Node.NetworkProtocolVersion (BlockNodeToClientVersion) import Ouroboros.Consensus.Node.Serialisation - (SerialiseNodeToClient (..), SerialiseResult (..), - SerialiseBlockQueryResult (..)) + (SerialiseBlockQueryResult (..), + SerialiseNodeToClient (..), SerialiseResult (..)) import Ouroboros.Consensus.Storage.LedgerDB import qualified Ouroboros.Consensus.Storage.LedgerDB as LedgerDB import Ouroboros.Consensus.Util (ShowProxy (..), SomeSecond (..)) diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Tables.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Tables.hs index 52dc7ecf4c..0541e3756e 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Tables.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Tables.hs @@ -184,7 +184,7 @@ module Ouroboros.Consensus.Ledger.Tables ( , valuesMKEncoder -- * Special classes , LedgerTablesAreTrivial - , TrivialLedgerTables(..) + , TrivialLedgerTables (..) , convertMapKind , trivialLedgerTables ) where diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Tables/Utils.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Tables/Utils.hs index 6f93a4fbd7..96550914f2 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Tables/Utils.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Tables/Utils.hs @@ -23,7 +23,6 @@ module Ouroboros.Consensus.Ledger.Tables.Utils ( , attachAndApplyDiffs , attachAndApplyDiffs' , attachEmptyDiffs - , valuesAsDiffs , calculateDifference , calculateDifference' , emptyLedgerTables @@ -38,6 +37,7 @@ module Ouroboros.Consensus.Ledger.Tables.Utils ( , reapplyTracking , restrictValues , restrictValues' + , valuesAsDiffs -- * Testing , rawApplyDiffs , rawAttachAndApplyDiffs diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Node/Serialisation.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Node/Serialisation.hs index 2b1247a01d..c13c26cbf4 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Node/Serialisation.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Node/Serialisation.hs @@ -17,10 +17,10 @@ -- both directions and we don't have access to the bytestrings that could be -- used for the annotations (we use CBOR-in-CBOR in those cases). module Ouroboros.Consensus.Node.Serialisation ( - SerialiseNodeToClient (..) + SerialiseBlockQueryResult (..) + , SerialiseNodeToClient (..) , SerialiseNodeToNode (..) , SerialiseResult (..) - , SerialiseBlockQueryResult (..) -- * Defaults , defaultDecodeCBORinCBOR , defaultEncodeCBORinCBOR diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/Impl/Snapshots.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/Impl/Snapshots.hs index 3c9a59b8e1..166ba5dc9d 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/Impl/Snapshots.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/Impl/Snapshots.hs @@ -39,8 +39,8 @@ module Ouroboros.Consensus.Storage.LedgerDB.Impl.Snapshots ( , TraceSnapshotEvent (..) -- * Testing , decodeLBackwardsCompatible - , encodeL , destroySnapshots + , encodeL ) where import Codec.CBOR.Decoding diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/Impl/Validate.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/Impl/Validate.hs index fd3ae0f2f5..dae8bd4acc 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/Impl/Validate.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/Impl/Validate.hs @@ -1,10 +1,10 @@ -{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -17,8 +17,8 @@ module Ouroboros.Consensus.Storage.LedgerDB.Impl.Validate ( ResolveBlock , ResolvesBlocks (..) -- * Validation - , ValidateArgs (..) , ValidLedgerState (..) + , ValidateArgs (..) , validate -- * Testing , defaultResolveWithErrors diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/Args.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/Args.hs index d9a132a18e..0e82b29c11 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/Args.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/Args.hs @@ -15,9 +15,9 @@ module Ouroboros.Consensus.Storage.LedgerDB.V2.Args ( , LedgerDbFlavorArgs (..) ) where +import Data.Void (Void) import GHC.Generics import NoThunks.Class -import Data.Void (Void) data LedgerDbFlavorArgs f m = V2Args HandleArgs diff --git a/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Golden.hs b/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Golden.hs index 8654e5c67e..35b386da50 100644 --- a/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Golden.hs +++ b/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Golden.hs @@ -64,8 +64,8 @@ import Ouroboros.Consensus.Node.Run (SerialiseDiskConstraints, SerialiseNodeToClientConstraints, SerialiseNodeToNodeConstraints) import Ouroboros.Consensus.Node.Serialisation - (SerialiseNodeToClient (..), SerialiseNodeToNode (..), - SerialiseBlockQueryResult (..)) + (SerialiseBlockQueryResult (..), + SerialiseNodeToClient (..), SerialiseNodeToNode (..)) import Ouroboros.Consensus.Storage.Serialisation (EncodeDisk (..)) import Ouroboros.Consensus.Util.CBOR (decodeAsFlatTerm) import Ouroboros.Consensus.Util.Condense (Condense (..)) diff --git a/ouroboros-consensus/test/consensus-test/Test/Consensus/Mempool/Fairness/TestBlock.hs b/ouroboros-consensus/test/consensus-test/Test/Consensus/Mempool/Fairness/TestBlock.hs index 7bcf9fb081..023a1fd40c 100644 --- a/ouroboros-consensus/test/consensus-test/Test/Consensus/Mempool/Fairness/TestBlock.hs +++ b/ouroboros-consensus/test/consensus-test/Test/Consensus/Mempool/Fairness/TestBlock.hs @@ -1,11 +1,11 @@ -{-# LANGUAGE DerivingVia #-} -{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} module Test.Consensus.Mempool.Fairness.TestBlock ( diff --git a/ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB/StateMachine/TestBlock.hs b/ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB/StateMachine/TestBlock.hs index 7788737bf5..8f1b4a7cb1 100644 --- a/ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB/StateMachine/TestBlock.hs +++ b/ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB/StateMachine/TestBlock.hs @@ -32,7 +32,7 @@ import qualified Codec.CBOR.Encoding as CBOR import Codec.Serialise (Serialise) import qualified Codec.Serialise as S import Data.Foldable (toList) -import Data.List.NonEmpty (NonEmpty( (:|) )) +import Data.List.NonEmpty (NonEmpty ((:|))) import qualified Data.Map.Diff.Strict.Internal as DS import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map diff --git a/ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB/V1/BackingStore.hs b/ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB/V1/BackingStore.hs index d16615c024..345766fb77 100644 --- a/ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB/V1/BackingStore.hs +++ b/ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB/V1/BackingStore.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE TypeApplications #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} @@ -11,6 +10,7 @@ {-# LANGUAGE Rank2Types #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -40,10 +40,10 @@ import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.Args as BS import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore as BS import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.InMemory as InMemory import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.LMDB as LMDB -import Test.Ouroboros.Storage.LedgerDB.V1.LMDB import Ouroboros.Consensus.Util.Args import Ouroboros.Consensus.Util.IOLike hiding (MonadMask (..), newMVar, newTVarIO, readMVar) +import Ouroboros.Network.Testing.QuickCheck import qualified System.Directory as Dir import System.FS.API hiding (Handle) import System.FS.IO (ioHasFS) @@ -53,6 +53,7 @@ import System.IO.Temp (createTempDirectory) import Test.Ouroboros.Storage.LedgerDB.V1.BackingStore.Lockstep import qualified Test.Ouroboros.Storage.LedgerDB.V1.BackingStore.Mock as Mock import Test.Ouroboros.Storage.LedgerDB.V1.BackingStore.Registry +import Test.Ouroboros.Storage.LedgerDB.V1.LMDB import qualified Test.QuickCheck as QC import Test.QuickCheck (Arbitrary (..), Property) import "quickcheck-dynamic" Test.QuickCheck.Extras @@ -66,7 +67,6 @@ import Test.Tasty.QuickCheck (QuickCheckTests (..), testProperty) import Test.Util.LedgerStateOnlyTables import Test.Util.Orphans.Arbitrary () import Test.Util.Orphans.IOLike () -import Ouroboros.Network.Testing.QuickCheck import Test.Util.Orphans.ToExpr () {-------------------------------------------------------------------------------