55
66module PlutusConfig.Ledger () where
77
8- import Config (Section (Section ), Value (Sections , Text ))
9- import Config.Schema (
10- HasSpec (anySpec ),
11- ValueSpec ,
12- integerSpec ,
13- reqSection' ,
14- sectionsSpec ,
15- stringSpec ,
16- )
8+ import Config (Value (Text ))
9+ import Config.Schema (HasSpec (anySpec ), ValueSpec , stringSpec )
1710import Data.String (fromString )
1811import Data.Text (Text )
1912import Ledger (POSIXTime (.. ), PubKeyHash , StakePubKeyHash (.. ))
20- import Ledger.TimeSlot (SlotConfig (SlotConfig ), scSlotLength , scSlotZeroTime )
2113import PlutusConfig.Base ()
2214import PlutusConfig.Types (ToValue (toValue ), withNamePrefixSpec )
2315import Prelude
@@ -39,28 +31,3 @@ instance HasSpec StakePubKeyHash where
3931
4032instance ToValue POSIXTime where
4133 toValue = toValue . getPOSIXTime
42-
43- instance ToValue SlotConfig where
44- toValue (SlotConfig scSlotLength scSlotZeroTime) =
45- Sections
46- ()
47- [ Section () " length" $ toValue scSlotLength
48- , Section () " zeroTime" $ toValue scSlotZeroTime
49- ]
50-
51- instance HasSpec SlotConfig where
52- anySpec = slotConfigSpec
53-
54- slotConfigSpec :: ValueSpec SlotConfig
55- slotConfigSpec = sectionsSpec " SlotConfig configuration" $ do
56- scSlotLength <-
57- reqSection'
58- " length"
59- integerSpec
60- " Length (number of milliseconds) of one slot"
61- scSlotZeroTime <-
62- reqSection'
63- " zeroTime"
64- (POSIXTime <$> integerSpec)
65- " Beginning of slot 0 (in milliseconds)"
66- pure SlotConfig {.. }
0 commit comments