Skip to content

Commit 34a5f5b

Browse files
authored
storage-test: move TestBlock to testlib (#1587)
This PR moves the `Test.Ouroboros.Storage.TestBlock` module form `storage-test` to `unstable-consensus-testlib` so that it could be used in a wider context. Specifically, I'd like to use it for Peras-related benchmarking in #1583
2 parents 8ba1f59 + fa901e0 commit 34a5f5b

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

ouroboros-consensus/ouroboros-consensus.cabal

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ library unstable-consensus-testlib
380380
Test.Ouroboros.Consensus.DiffusionPipelining
381381
Test.Ouroboros.Consensus.Protocol
382382
Test.Ouroboros.Consensus.QuickCheck.Extras
383+
Test.Ouroboros.Storage.TestBlock
383384
Test.Util.BoolProps
384385
Test.Util.ChainDB
385386
Test.Util.ChainUpdates
@@ -449,6 +450,7 @@ library unstable-consensus-testlib
449450
fs-api ^>=0.3,
450451
fs-sim ^>=0.3,
451452
generics-sop,
453+
hashable,
452454
io-classes,
453455
io-sim,
454456
mempack,
@@ -717,7 +719,6 @@ test-suite storage-test
717719
Test.Ouroboros.Storage.LedgerDB.V1.DbChangelog
718720
Test.Ouroboros.Storage.LedgerDB.V1.LMDB
719721
Test.Ouroboros.Storage.Orphans
720-
Test.Ouroboros.Storage.TestBlock
721722
Test.Ouroboros.Storage.VolatileDB
722723
Test.Ouroboros.Storage.VolatileDB.Mock
723724
Test.Ouroboros.Storage.VolatileDB.Model
@@ -728,10 +729,8 @@ test-suite storage-test
728729
aeson,
729730
base,
730731
bifunctors,
731-
binary,
732732
bytestring,
733733
cardano-binary,
734-
cardano-crypto-class ^>=2.2,
735734
cardano-ledger-binary:testlib,
736735
cardano-ledger-core:{cardano-ledger-core, testlib},
737736
cardano-slotting:{cardano-slotting, testlib},
@@ -746,7 +745,6 @@ test-suite storage-test
746745
fs-api ^>=0.3,
747746
fs-sim ^>=0.3,
748747
generics-sop,
749-
hashable,
750748
io-classes,
751749
io-sim,
752750
mempack,

ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/TestBlock.hs renamed to ouroboros-consensus/src/unstable-consensus-testlib/Test/Ouroboros/Storage/TestBlock.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ import qualified Ouroboros.Network.Mock.Chain as Chain
125125
import System.FS.API.Lazy
126126
import Test.Cardano.Slotting.Numeric ()
127127
import Test.Cardano.Slotting.TreeDiff ()
128-
import Test.Ouroboros.Storage.ChainDB.Model
129128
import Test.QuickCheck
130129
import Test.Util.Orphans.Arbitrary ()
131130
import Test.Util.Orphans.SignableRepresentation ()
@@ -935,8 +934,6 @@ deriving instance ToExpr (HeaderEnvelopeError TestBlock)
935934
deriving instance ToExpr BftValidationErr
936935
deriving instance ToExpr (ExtValidationError TestBlock)
937936

938-
instance ModelSupportsBlock TestBlock
939-
940937
deriving anyclass instance ToExpr FsPath
941938
deriving anyclass instance ToExpr BlocksPerFile
942939
deriving instance ToExpr BinaryBlockInfo

ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/ChainDB/StateMachine.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ deriving instance
344344
(TestConstraints blk, Show it, Show flr) =>
345345
Show (Success blk it flr)
346346

347+
instance ModelSupportsBlock TestBlock
348+
347349
-- | Short-hand
348350
type TestIterator m blk = WithEq (Iterator m blk (AllComponents blk))
349351

0 commit comments

Comments
 (0)