@@ -18,6 +18,7 @@ module Ouroboros.Consensus.Storage.ChainDB.Impl.Query
18
18
, getIsValid
19
19
, getMaxSlotNo
20
20
, getPastLedger
21
+ , getPerasWeightSnapshot
21
22
, getReadOnlyForkerAtPoint
22
23
, getStatistics
23
24
, getTipBlock
@@ -52,6 +53,8 @@ import Ouroboros.Consensus.Storage.ChainDB.Impl.Types
52
53
import Ouroboros.Consensus.Storage.ImmutableDB (ImmutableDB )
53
54
import qualified Ouroboros.Consensus.Storage.ImmutableDB as ImmutableDB
54
55
import qualified Ouroboros.Consensus.Storage.LedgerDB as LedgerDB
56
+ import qualified Ouroboros.Consensus.Storage.PerasCertDB as PerasCertDB
57
+ import Ouroboros.Consensus.Storage.PerasCertDB.API (PerasWeightSnapshot )
55
58
import Ouroboros.Consensus.Storage.VolatileDB (VolatileDB )
56
59
import qualified Ouroboros.Consensus.Storage.VolatileDB as VolatileDB
57
60
import Ouroboros.Consensus.Util (eitherToMaybe )
@@ -262,6 +265,9 @@ getReadOnlyForkerAtPoint CDB{..} = LedgerDB.getReadOnlyForker cdbLedgerDB
262
265
getStatistics :: IOLike m => ChainDbEnv m blk -> m (Maybe LedgerDB. Statistics )
263
266
getStatistics CDB {.. } = LedgerDB. getTipStatistics cdbLedgerDB
264
267
268
+ getPerasWeightSnapshot :: ChainDbEnv m blk -> STM m (PerasWeightSnapshot blk )
269
+ getPerasWeightSnapshot CDB {.. } = PerasCertDB. getWeightSnapshot cdbPerasCertDB
270
+
265
271
{- ------------------------------------------------------------------------------
266
272
Unifying interface over the immutable DB and volatile DB, but independent
267
273
of the ledger DB. These functions therefore do not require the entire
0 commit comments