Skip to content

Commit

Permalink
Undo changes to ErgoSettingsReader
Browse files Browse the repository at this point in the history
  • Loading branch information
jellymlg committed Feb 28, 2024
1 parent 7c5c98b commit 3974f64
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
import net.ceedubs.ficus.Ficus._
import net.ceedubs.ficus.readers.ArbitraryTypeReader._
import org.ergoplatform.nodeView.state.StateType.Digest
import org.ergoplatform.wallet.utils.FileUtils
import org.ergoplatform.ErgoApp
import scorex.util.ScorexLogging
import org.ergoplatform.settings.ErgoSettings.{configPath, scorexConfigPath}
Expand All @@ -22,19 +21,14 @@ import scala.util.Try
object ErgoSettingsReader extends ScorexLogging
with PowSchemeReaders
with NodeConfigurationReaders
with SettingsReaders
with FileUtils {
with SettingsReaders {

def read(args: Args = Args.empty): ErgoSettings = {
fromConfig(readConfig(args), args.networkTypeOpt)
}

def fromConfig(config: Config, desiredNetworkTypeOpt: Option[NetworkType] = None): ErgoSettings = {
val directory =
if(System.getProperty("env") == "test")
createTempDir.getAbsolutePath
else
config.as[String](s"$configPath.directory")
val directory = config.as[String](s"$configPath.directory")
val networkTypeName = config.as[String](s"$configPath.networkType")
val networkType = NetworkType.fromString(networkTypeName)
.getOrElse(throw new Error(s"Unknown `networkType = $networkTypeName`"))
Expand Down

0 comments on commit 3974f64

Please sign in to comment.