Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Nov 25, 2021
1 parent 548a0d6 commit 910255a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,9 @@ data TraceEvent blk =
deriving (Eq, Generic, Show)

data TraceChunkValidation validateTo =
ValidatingChunk ChunkNo
| ValidatedChunk ChunkNo validateTo
deriving (Generic, Eq, Show)

instance Functor TraceChunkValidation where
fmap _ (ValidatingChunk c) = ValidatingChunk c
fmap f (ValidatedChunk c c') = ValidatedChunk c (f c')
StartedValidatingChunk ChunkNo validateTo
| ValidatedChunk ChunkNo validateTo
deriving (Generic, Eq, Show, Functor)

-- | The argument with type 'Word32' is the number of past chunk currently in
-- the cache.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ validateChunk ::
-- truncate the chunk file. When validating the chunk file after it, we
-- would notice it doesn't fit anymore, and then throw.
validateChunk ValidateEnv{..} shouldBeFinalised chunk mbPrevHash validationTracer = do
lift $ traceWith validationTracer $ ValidatingChunk chunk
lift $ traceWith validationTracer $ StartedValidatingChunk chunk ()
chunkFileExists <- lift $ doesFileExist chunkFile
unless chunkFileExists $ do
trace $ MissingChunkFile chunk
Expand Down

0 comments on commit 910255a

Please sign in to comment.