@@ -23,7 +23,8 @@ import Cardano.Rpc.Server.Config (makeRpcConfig)
2323import Ouroboros.Consensus.Node (NodeDatabasePaths (.. ))
2424import Ouroboros.Consensus.Node.Genesis (disableGenesisConfig )
2525import Ouroboros.Consensus.Storage.LedgerDB.Args
26- import Ouroboros.Consensus.Storage.LedgerDB.Snapshots (defaultSnapshotPolicyArgs )
26+ import Ouroboros.Consensus.Storage.LedgerDB.Snapshots (defaultSnapshotPolicyArgs ,
27+ mithrilSnapshotPolicyArgs )
2728import Ouroboros.Network.Block (SlotNo (.. ))
2829import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (.. ))
2930import Ouroboros.Network.TxSubmission.Inbound.V2.Types
@@ -316,17 +317,31 @@ prop_legacySnapshotFormat_POM =
316317 legacyConfig :: PartialNodeConfiguration <- evalEither $ eitherDecode legacyJson
317318 newConfig :: PartialNodeConfiguration <- evalEither $ eitherDecode newJson
318319 pncLedgerDbConfig legacyConfig === pncLedgerDbConfig newConfig
319- where
320- dummyRequiredValues :: LBS. ByteString
321- dummyRequiredValues = mconcat
322- [ " \" ByronGenesisFile\" : \" x\" "
323- , " , \" ShelleyGenesisFile\" : \" x\" "
324- , " , \" AlonzoGenesisFile\" : \" x\" "
325- , " , \" ConwayGenesisFile\" : \" x\" "
326- , " , \" LastKnownBlockVersion-Major\" : 0"
327- , " , \" LastKnownBlockVersion-Minor\" : 0"
328- , " , \" LastKnownBlockVersion-Alt\" : 0"
329- ]
320+
321+ -- | Test that the named \"Mithril\" snapshot policy selects
322+ -- 'mithrilSnapshotPolicyArgs' as a whole.
323+ prop_mithrilSnapshotPolicy_POM :: Property
324+ prop_mithrilSnapshotPolicy_POM =
325+ withTests 1 . Hedgehog. property $ do
326+ let json = " { " <> dummyRequiredValues <> " , "
327+ <> " \" LedgerDB\" : {"
328+ <> " \" Backend\" : \" V2InMemory\" ,"
329+ <> " \" Snapshots\" : \" Mithril\" "
330+ <> " } }"
331+ config :: PartialNodeConfiguration <- evalEither $ eitherDecode json
332+ getLast (pncLedgerDbConfig config) ===
333+ Just (LedgerDbConfiguration mithrilSnapshotPolicyArgs DefaultQueryBatchSize V2InMemory noDeprecatedOptions)
334+
335+ dummyRequiredValues :: LBS. ByteString
336+ dummyRequiredValues = mconcat
337+ [ " \" ByronGenesisFile\" : \" x\" "
338+ , " , \" ShelleyGenesisFile\" : \" x\" "
339+ , " , \" AlonzoGenesisFile\" : \" x\" "
340+ , " , \" ConwayGenesisFile\" : \" x\" "
341+ , " , \" LastKnownBlockVersion-Major\" : 0"
342+ , " , \" LastKnownBlockVersion-Minor\" : 0"
343+ , " , \" LastKnownBlockVersion-Alt\" : 0"
344+ ]
330345
331346-- -----------------------------------------------------------------------------
332347
0 commit comments