[input-output-hk/cardano-sl] CDEC-494: Prepare for consolidation of blund files into epoch files (#3440)

erikd commented on this pull request.

> +— blund file.
+consolidateBlund
+ :: MonadRealDB ctx m
+ => HeaderHash
+ -> m (Maybe (ByteString, ByteString))
+consolidateBlund hh = do
+ bsp <- flip getAllPaths hh . view blockDataDir <$> getNodeDBs
+ block <- getRawData $ bspBlock bsp + undo <- getRawData $ bspUndo bsp + case (,) <$> block <*> undo of
+ Just blund -> do
+ putRawData (bspBlund bsp) $ serialize’ blund
+ liftIO . removeFile $ bspBlock bsp
+ liftIO . removeFile $ bspUndo bsp
+ return $ Just blund
+ Nothing -> return Nothing

Also code moved from another file, but i will fix it.