@@ -14,7 +14,6 @@ import System.Wlog (LoggerName, logInfo)
14
14
import qualified Pos.Client.CLI as CLI
15
15
import Pos.Context (NodeContext (.. ))
16
16
import Pos.Core (ConfigurationError , epochSlots )
17
- import Pos.Core.Mockable (Production (.. ), runProduction )
18
17
import Pos.Crypto (ProtocolMagic )
19
18
import Pos.DB.DB (initNodeDBs )
20
19
import Pos.Infra.Diffusion.Types (Diffusion , hoistDiffusion )
@@ -43,12 +42,12 @@ loggerName = "auxx"
43
42
44
43
-- 'NodeParams' obtained using 'CLI.getNodeParams' are not perfect for
45
44
-- Auxx, so we need to adapt them slightly.
46
- correctNodeParams :: AuxxOptions -> NodeParams -> Production (NodeParams , Bool )
45
+ correctNodeParams :: AuxxOptions -> NodeParams -> IO (NodeParams , Bool )
47
46
correctNodeParams AuxxOptions {.. } np = do
48
47
(dbPath, isTempDbUsed) <- case npDbPathM np of
49
48
Nothing -> do
50
- tempDir <- liftIO $ Temp. getCanonicalTemporaryDirectory
51
- dbPath <- liftIO $ Temp. createTempDirectory tempDir " nodedb"
49
+ tempDir <- Temp. getCanonicalTemporaryDirectory
50
+ dbPath <- Temp. createTempDirectory tempDir " nodedb"
52
51
logInfo $ sformat (" Temporary db created: " % shown) dbPath
53
52
return (dbPath, True )
54
53
Just dbPath -> do
@@ -81,7 +80,7 @@ runNodeWithSinglePlugin ::
81
80
runNodeWithSinglePlugin pm nr plugin =
82
81
runNode pm nr [plugin]
83
82
84
- action :: HasCompileInfo => AuxxOptions -> Either WithCommandAction Text -> Production ()
83
+ action :: HasCompileInfo => AuxxOptions -> Either WithCommandAction Text -> IO ()
85
84
action opts@ AuxxOptions {.. } command = do
86
85
let pa = either printAction (const putText) command
87
86
case aoStartMode of
@@ -95,10 +94,10 @@ action opts@AuxxOptions {..} command = do
95
94
_ -> withConfigurations Nothing conf (runWithConfig pa)
96
95
97
96
where
98
- runWithoutNode :: PrintAction Production -> Production ()
97
+ runWithoutNode :: PrintAction IO -> IO ()
99
98
runWithoutNode printAction = printAction " Mode: light" >> rawExec Nothing Nothing opts Nothing command
100
99
101
- runWithConfig :: HasConfigurations => PrintAction Production -> NtpConfiguration -> ProtocolMagic -> Production ()
100
+ runWithConfig :: HasConfigurations => PrintAction IO -> NtpConfiguration -> ProtocolMagic -> IO ()
102
101
runWithConfig printAction ntpConfig pm = do
103
102
printAction " Mode: with-config"
104
103
CLI. printInfoOnStart aoCommonNodeArgs ntpConfig
@@ -117,7 +116,7 @@ action opts@AuxxOptions {..} command = do
117
116
(npUserSecret nodeParams ^. usVss)
118
117
sscParams = CLI. gtSscParams cArgs vssSK (npBehaviorConfig nodeParams)
119
118
120
- bracketNodeResources nodeParams sscParams (txpGlobalSettings pm) (initNodeDBs pm epochSlots) $ \ nr -> Production $
119
+ bracketNodeResources nodeParams sscParams (txpGlobalSettings pm) (initNodeDBs pm epochSlots) $ \ nr ->
121
120
let NodeContext {.. } = nrContext nr
122
121
modifier = if aoStartMode == WithNode
123
122
then runNodeWithSinglePlugin pm nr
@@ -146,7 +145,7 @@ main = withCompileInfo $ do
146
145
loggingParams = disableConsoleLog $
147
146
CLI. loggingParams loggerName (aoCommonNodeArgs opts)
148
147
loggerBracket loggingParams . logException " auxx" $ do
149
- let runAction a = runProduction $ action opts a
148
+ let runAction a = action opts a
150
149
case aoAction opts of
151
150
Repl -> withAuxxRepl $ \ c -> runAction (Left c)
152
151
Cmd cmd -> runAction (Right cmd)
0 commit comments