File tree 1 file changed +10
-4
lines changed
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Chunks
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ import GHC.Generics (Generic)
49
49
import NoThunks.Class (NoThunks )
50
50
import Ouroboros.Consensus.Block
51
51
import Ouroboros.Consensus.Util.CallStack
52
- import Ouroboros.Consensus.Util.RedundantConstraints
52
+ import Ouroboros.Consensus.Util.RedundantConstraints ( keepRedundantConstraint )
53
53
54
54
-- | Size of the chunks of the immutable DB
55
55
--
@@ -251,35 +251,41 @@ data ChunkAssertionFailure
251
251
252
252
instance Exception ChunkAssertionFailure
253
253
254
+ {- FOURMOLU_DISABLE -}
254
255
assertSameChunk :: HasCallStack => ChunkNo -> ChunkNo -> a -> a
255
256
#if ENABLE_ASSERTIONS
256
257
assertSameChunk a b
257
258
| a == b = id
258
259
| otherwise = throw $ NotSameChunk a b prettyCallStack
259
260
#else
260
261
assertSameChunk _ _ = id
262
+ #endif
261
263
where
262
264
_ = keepRedundantConstraint (Proxy @ HasCallStack )
263
- #endif
265
+ {- FOURMOLU_ENABLE -}
264
266
267
+ {- FOURMOLU_DISABLE -}
265
268
assertWithinBounds :: HasCallStack => Word64 -> ChunkSize -> a -> a
266
269
#if ENABLE_ASSERTIONS
267
270
assertWithinBounds ix sz
268
271
| ix <= maxRelativeIndex sz = id
269
272
| otherwise = throw $ NotWithinBounds ix sz prettyCallStack
270
273
#else
271
274
assertWithinBounds _ _ = id
275
+ #endif
272
276
where
273
277
_ = keepRedundantConstraint (Proxy @ HasCallStack )
274
- #endif
278
+ {- FOURMOLU_ENABLE -}
275
279
280
+ {- FOURMOLU_DISABLE -}
276
281
assertChunkCanContainEBB :: HasCallStack => ChunkNo -> ChunkSize -> a -> a
277
282
#if ENABLE_ASSERTIONS
278
283
assertChunkCanContainEBB chunk size
279
284
| chunkCanContainEBB size = id
280
285
| otherwise = throw $ ChunkCannotContainEBBs chunk prettyCallStack
281
286
#else
282
287
assertChunkCanContainEBB _ _ = id
288
+ #endif
283
289
where
284
290
_ = keepRedundantConstraint (Proxy @ HasCallStack )
285
- #endif
291
+ {- FOURMOLU_ENABLE -}
You can’t perform that action at this time.
0 commit comments