File tree Expand file tree Collapse file tree 3 files changed +4
-10
lines changed
ouroboros-consensus-lsm/Ouroboros/Consensus/Storage/LedgerDB/V2
ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 1414{-# LANGUAGE TypeApplications #-}
1515{-# LANGUAGE TypeFamilies #-}
1616{-# LANGUAGE UndecidableInstances #-}
17+ {-# LANGUAGE ViewPatterns #-}
1718{-# OPTIONS_GHC -Wno-orphans #-}
1819
1920-- | Implementation of the 'LedgerTablesHandle' interface with LSM trees.
@@ -72,7 +73,6 @@ import Ouroboros.Consensus.Ledger.Tables.Utils
7273import Ouroboros.Consensus.Storage.LedgerDB.API
7374import Ouroboros.Consensus.Storage.LedgerDB.Args
7475import Ouroboros.Consensus.Storage.LedgerDB.Snapshots
75- import Ouroboros.Consensus.Storage.LedgerDB.V2
7676import Ouroboros.Consensus.Storage.LedgerDB.V2.Backend
7777import Ouroboros.Consensus.Storage.LedgerDB.V2.LedgerSeq
7878import Ouroboros.Consensus.Util (chunks )
Original file line number Diff line number Diff line change 1111{-# LANGUAGE TypeOperators #-}
1212{-# LANGUAGE UndecidableInstances #-}
1313
14- module Ouroboros.Consensus.Storage.LedgerDB.V2 (mkInitDb , snapshotToStatePath ) where
14+ module Ouroboros.Consensus.Storage.LedgerDB.V2 (mkInitDb ) where
1515
1616import Control.Arrow ((>>>) )
1717import qualified Control.Monad as Monad (join , void )
@@ -240,11 +240,6 @@ implIntTruncateSnapshots snapManager (SomeHasFS fs) = do
240240 \ pre -> withFile fs (snapshotToStatePath pre) (AppendMode AllowExisting ) $
241241 \ h -> hTruncate fs h 0
242242
243- -- | The path within the LedgerDB's filesystem to the file that contains the
244- -- snapshot's serialized ledger state
245- snapshotToStatePath :: DiskSnapshot -> FsPath
246- snapshotToStatePath = mkFsPath . (\ x -> [x, " state" ]) . snapshotToDirName
247-
248243implGetVolatileTip ::
249244 (MonadSTM m , GetTip l ) =>
250245 LedgerDBEnv m l blk ->
Original file line number Diff line number Diff line change @@ -148,11 +148,10 @@ newInMemoryLedgerTablesHandle tracer someFS@(SomeHasFS hasFS) l = do
148148 )
149149 )
150150 , takeHandleSnapshot = \ hint snapshotName -> do
151- createDirectoryIfMissing hasFS True $ mkFsPath [snapshotName, " tables" ]
152151 h <- readTVarIO tv
153152 guardClosed h $
154153 \ values ->
155- withFile hasFS (mkFsPath [snapshotName, " tables" , " tvar " ]) (WriteMode MustBeNew ) $ \ hf ->
154+ withFile hasFS (mkFsPath [snapshotName, " tables" ]) (WriteMode MustBeNew ) $ \ hf ->
156155 fmap (Just . snd ) $
157156 hPutAllCRC hasFS hf $
158157 CBOR. toLazyByteString $
@@ -265,7 +264,7 @@ loadSnapshot tracer _rr ccfg fs ds = do
265264 (valuesMKDecoder extLedgerSt)
266265 ( fsPathFromList $
267266 fsPathToList (snapshotToDirPath ds)
268- <> [fromString " tables" , fromString " tvar " ]
267+ <> [fromString " tables" ]
269268 )
270269 let computedCRC = crcOfConcat checksumAsRead crcTables
271270 Monad. when (computedCRC /= snapshotChecksum snapshotMeta) $
You can’t perform that action at this time.
0 commit comments