Skip to content

Commit

Permalink
removed duplicate function
Browse files Browse the repository at this point in the history
  • Loading branch information
tbssajal committed Jan 13, 2023
1 parent ba1e217 commit c728bad
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/Lachain.Core/Config/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,32 +548,6 @@ private void _UpdateConfigToV18()
_SaveCurrentConfig();
}

// version 18 of config should contain Hardfork_15
private void _UpdateConfigToV18()
{
var network = GetConfig<NetworkConfig>("network") ??
throw new ApplicationException("No network section in config");

var hardforks = GetConfig<HardforkConfig>("hardfork") ??
throw new ApplicationException("No hardfork section in config");
hardforks.Hardfork_15 ??= network.NetworkName switch
{
"mainnet" => 6311300,
"testnet" => 6027300,
"devnet" => 1750300,
_ => 0
};
_config["hardfork"] = JObject.FromObject(hardforks);

var version = GetConfig<VersionConfig>("version") ??
throw new ApplicationException("No version section in config");

version.Version = 18;
_config["version"] = JObject.FromObject(version);

_SaveCurrentConfig();
}

private void _SaveCurrentConfig()
{
File.WriteAllText(ConfigPath, JsonConvert.SerializeObject(_config, Formatting.Indented));
Expand Down

0 comments on commit c728bad

Please sign in to comment.