|
8 | 8 | // Redistribution and use in source and binary forms with or without |
9 | 9 | // modifications are permitted. |
10 | 10 |
|
11 | | -using Microsoft.Extensions.Configuration; |
12 | | -using Neo.Cryptography.ECC; |
13 | | -using Neo.Network.P2P.Payloads; |
14 | | -using Neo.SmartContract.Native; |
15 | 11 | using System; |
16 | 12 | using System.Collections.Generic; |
17 | 13 | using System.Collections.Immutable; |
18 | 14 | using System.Linq; |
| 15 | +using Microsoft.Extensions.Configuration; |
| 16 | +using Neo.Cryptography.ECC; |
| 17 | +using Neo.Network.P2P.Payloads; |
19 | 18 |
|
20 | 19 | namespace Neo |
21 | 20 | { |
@@ -85,10 +84,8 @@ public record ProtocolSettings |
85 | 84 | public uint MaxTraceableBlocks { get; init; } |
86 | 85 |
|
87 | 86 | /// <summary> |
88 | | - /// Contains the update history of all native contracts. |
| 87 | + /// Sets the block height from which a hardfork is activated. |
89 | 88 | /// </summary> |
90 | | - public IReadOnlyDictionary<string, uint[]> NativeUpdateHistory { get; init; } |
91 | | - |
92 | 89 | public ImmutableDictionary<Hardfork, uint> Hardforks { get; init; } |
93 | 90 |
|
94 | 91 | /// <summary> |
@@ -149,18 +146,6 @@ public record ProtocolSettings |
149 | 146 | MemoryPoolMaxTransactions = 50_000, |
150 | 147 | MaxTraceableBlocks = 2_102_400, |
151 | 148 | InitialGasDistribution = 52_000_000_00000000, |
152 | | - NativeUpdateHistory = new Dictionary<string, uint[]> |
153 | | - { |
154 | | - [nameof(ContractManagement)] = new[] { 0u }, |
155 | | - [nameof(StdLib)] = new[] { 0u }, |
156 | | - [nameof(CryptoLib)] = new[] { 0u }, |
157 | | - [nameof(LedgerContract)] = new[] { 0u }, |
158 | | - [nameof(NeoToken)] = new[] { 0u }, |
159 | | - [nameof(GasToken)] = new[] { 0u }, |
160 | | - [nameof(PolicyContract)] = new[] { 0u }, |
161 | | - [nameof(RoleManagement)] = new[] { 0u }, |
162 | | - [nameof(OracleContract)] = new[] { 0u } |
163 | | - }, |
164 | 149 | Hardforks = ImmutableDictionary<Hardfork, uint>.Empty |
165 | 150 | }; |
166 | 151 |
|
@@ -202,9 +187,6 @@ public static ProtocolSettings Load(IConfigurationSection section) |
202 | 187 | MemoryPoolMaxTransactions = section.GetValue("MemoryPoolMaxTransactions", Default.MemoryPoolMaxTransactions), |
203 | 188 | MaxTraceableBlocks = section.GetValue("MaxTraceableBlocks", Default.MaxTraceableBlocks), |
204 | 189 | InitialGasDistribution = section.GetValue("InitialGasDistribution", Default.InitialGasDistribution), |
205 | | - NativeUpdateHistory = section.GetSection("NativeUpdateHistory").Exists() |
206 | | - ? section.GetSection("NativeUpdateHistory").GetChildren().ToDictionary(p => p.Key, p => p.GetChildren().Select(q => uint.Parse(q.Value)).ToArray()) |
207 | | - : Default.NativeUpdateHistory, |
208 | 190 | Hardforks = section.GetSection("Hardforks").Exists() |
209 | 191 | ? section.GetSection("Hardforks").GetChildren().ToImmutableDictionary(p => Enum.Parse<Hardfork>(p.Key), p => uint.Parse(p.Value)) |
210 | 192 | : Default.Hardforks |
|
0 commit comments