Skip to content

Commit a16e4b6

Browse files
author
Aleksandr Penskoi
committed
Remove some deadcode.
1 parent 1395f40 commit a16e4b6

File tree

3 files changed

+5
-54
lines changed

3 files changed

+5
-54
lines changed

src/BotPlutusInterface/Config.hs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import BotPlutusInterface.Effects (
1616
)
1717
import BotPlutusInterface.Types (CLILocation (..), LogLevel (..), PABConfig (..))
1818

19-
import Cardano.Api (ExecutionUnits (..), NetworkId (Mainnet, Testnet), unNetworkMagic)
19+
import Cardano.Api (NetworkId (Mainnet, Testnet), unNetworkMagic)
2020
import Config (Section (Section), Value (Atom, Sections, Text))
2121
import Config.Schema (
2222
HasSpec (anySpec),
@@ -74,20 +74,6 @@ logLevelSpec =
7474
<!> Info <$ atomSpec "info"
7575
<!> Debug <$ atomSpec "debug"
7676

77-
instance ToValue (Integer, Integer) where
78-
toValue = toValue . forceBudgetToExecutionUnits
79-
80-
instance HasSpec (Maybe (Integer, Integer)) where
81-
anySpec = maybeSpec (executionUnitsToForceBudget <$> anySpec)
82-
83-
forceBudgetToExecutionUnits :: (Integer, Integer) -> ExecutionUnits
84-
forceBudgetToExecutionUnits (steps, memory) =
85-
ExecutionUnits (fromInteger steps) (fromInteger memory)
86-
87-
executionUnitsToForceBudget :: ExecutionUnits -> (Integer, Integer)
88-
executionUnitsToForceBudget (ExecutionUnits steps memory) =
89-
(toInteger steps, toInteger memory)
90-
9177
{- ORMOLU_DISABLE -}
9278
instance ToValue PABConfig where
9379
toValue

src/PlutusConfig/Ledger.hs

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,11 @@
55

66
module 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)
1710
import Data.String (fromString)
1811
import Data.Text (Text)
1912
import Ledger (POSIXTime (..), PubKeyHash, StakePubKeyHash (..))
20-
import Ledger.TimeSlot (SlotConfig (SlotConfig), scSlotLength, scSlotZeroTime)
2113
import PlutusConfig.Base ()
2214
import PlutusConfig.Types (ToValue (toValue), withNamePrefixSpec)
2315
import Prelude
@@ -39,28 +31,3 @@ instance HasSpec StakePubKeyHash where
3931

4032
instance 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 {..}

test/Spec/BotPlutusInterface/Config.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ pabConfigExample =
100100
, protocolParamCollateralPercent = Just 1017
101101
, protocolParamMaxCollateralInputs = Just 1018
102102
}
103-
, -- , pcSlotConfig = SlotConfig {scSlotLength = 1019, scSlotZeroTime = POSIXTime 1020}
104-
pcTipPollingInterval = 1021
103+
, pcTipPollingInterval = 1021
105104
, pcScriptFileDir = "./result-scripts2"
106105
, pcSigningKeyFileDir = "./signing-keys2"
107106
, pcTxFileDir = "./txs2"
@@ -111,8 +110,7 @@ pabConfigExample =
111110
, pcLogLevel = Debug
112111
, pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546"
113112
, pcOwnStakePubKeyHash = Just $ StakePubKeyHash "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97547"
114-
, -- , pcForceBudget = Just (1000, 1000)
115-
pcPort = 1021
113+
, pcPort = 1021
116114
, pcEnableTxEndpoint = True
117115
, pcCollectStats = False
118116
}

0 commit comments

Comments
 (0)