File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module BotPlutusInterface.Config (
88 docPABConfig ,
99 loadPABConfig ,
1010 savePABConfig ,
11+ savePABConfigPartial ,
1112) where
1213
1314import BotPlutusInterface.Types (CLILocation (.. ), LogLevel (.. ), PABConfig (.. ))
@@ -230,7 +231,16 @@ loadPABConfig fn = do
230231 Left err -> Left $ " protocolParamsFile: " <> toString pcProtocolParamsFile <> " : " <> err
231232 Right pcProtocolParams -> Right conf {pcProtocolParams}
232233
234+ {- | Save 'PABConfig' into two files:
235+
236+ - Save 'PABConfig' into a file without `pcProtocolParams`, which specified as the argument
237+ - Save 'pcProtocolParams' into file, which specified in `pcProtocolParamsFile` field of 'PABConfig'
238+ -}
233239savePABConfig :: FilePath -> PABConfig -> IO ()
234240savePABConfig fn conf@ PABConfig {pcProtocolParams, pcProtocolParamsFile} = do
235241 writeProtocolParametersJSON (toString pcProtocolParamsFile) pcProtocolParams
236- writeFile fn $ serialize conf <> " \n "
242+ savePABConfigPartial fn conf
243+
244+ -- | Partly save 'PABConfig' to file, without `pcProtocolParams`
245+ savePABConfigPartial :: FilePath -> PABConfig -> IO ()
246+ savePABConfigPartial fn conf = writeFile fn $ serialize conf <> " \n "
You can’t perform that action at this time.
0 commit comments