示例#1
0
 public Settings(IConfigurationSection section)
 {
     this.Magic             = uint.Parse(section.GetSection("Magic").Value);
     this.AddressVersion    = byte.Parse(section.GetSection("AddressVersion").Value);
     this.StandbyValidators = section.GetSection("StandbyValidators").GetChildren().Select(p => p.Value).ToArray();
     this.SeedList          = section.GetSection("SeedList").GetChildren().Select(p => p.Value).ToArray();
     this.SystemFee         = section.GetSection("SystemFee").GetChildren().ToDictionary(p => (TransactionType)Enum.Parse(typeof(TransactionType), p.Key, true), p => Fixed8.Parse(p.Value));
     this.SecondsPerBlock   = GetValueOrDefault(section.GetSection("SecondsPerBlock"), 15u, p => uint.Parse(p));
 }
示例#2
0
 private ProtocolSettings(IConfigurationSection section)
 {
     Magic                = uint.Parse(section.GetSection("Magic").Value);
     AddressVersion       = byte.Parse(section.GetSection("AddressVersion").Value);
     StandbyValidators    = section.GetSection("StandbyValidators").GetChildren().Select(p => p.Value).ToArray();
     SeedList             = section.GetSection("SeedList").GetChildren().Select(p => p.Value).ToArray();
     SystemFee            = section.GetSection("SystemFee").GetChildren().ToDictionary(p => (TransactionType)Enum.Parse(typeof(TransactionType), p.Key, true), p => Fixed8.Parse(p.Value));
     SecondsPerBlock      = GetValueOrDefault(section.GetSection("SecondsPerBlock"), 15u, p => uint.Parse(p));
     LowPriorityThreshold = GetValueOrDefault(section.GetSection("LowPriorityThreshold"), Fixed8.FromDecimal(0.001m), p => Fixed8.Parse(p));
 }