Skip to content

Commit d8fc589

Browse files
committed
Flag is false by def; return array
1 parent 2f48f02 commit d8fc589

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthRpcModule.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2023 Demerzel Solutions Limited
1+
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
22
// SPDX-License-Identifier: LGPL-3.0-only
33

44
using System;
@@ -802,15 +802,15 @@ private ResultWrapper<TResult> GetStateFailureResult<TResult>(BlockHeader header
802802
};
803803
}
804804

805-
public ResultWrapper<JsonNode> eth_config(bool? showAllForks = null)
805+
public ResultWrapper<JsonNode> eth_config(bool showAllForks = false)
806806
{
807807
ForkActivationsSummary forks = forkInfo.GetForkActivationsSummary(_blockFinder.Head?.Header);
808808
IReadOnlyList<ForkConfig>? allForkConfigs = null;
809809

810-
if (showAllForks is true)
810+
if (showAllForks)
811811
{
812-
IReadOnlyList<Fork> forkSchedule = forkInfo.GetAllForks();
813-
List<ForkConfig> forkConfigs = new(forkSchedule.Count);
812+
Fork[] forkSchedule = forkInfo.GetAllForks();
813+
List<ForkConfig> forkConfigs = new(forkSchedule.Length);
814814

815815
foreach (Fork scheduledFork in forkSchedule)
816816
{

src/Nethermind/Nethermind.JsonRpc/Modules/Eth/IEthRpcModule.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// SPDX-FileCopyrightText: 2023 Demerzel Solutions Limited
1+
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
22
// SPDX-License-Identifier: LGPL-3.0-only
33

4-
using System;
54
using System.Collections.Generic;
65
using System.Text.Json.Nodes;
76
using System.Threading.Tasks;
@@ -290,6 +289,6 @@ ResultWrapper<TransactionForRpc> eth_getTransactionByBlockNumberAndIndex(
290289
ResultWrapper<AccountInfoForRpc?> eth_getAccountInfo([JsonRpcParameter(ExampleValue = "[\"0xaa00000000000000000000000000000000000000\", \"latest\"]")] Address accountAddress, BlockParameter? blockParameter = null);
291290

292291
[JsonRpcMethod(IsImplemented = true, Description = "Provides configuration data for the current and next fork or the full fork schedule", IsSharable = true)]
293-
ResultWrapper<JsonNode> eth_config([JsonRpcParameter(Description = "Returns every known fork when true", ExampleValue = "[true]")] bool? showAllForks = null);
292+
ResultWrapper<JsonNode> eth_config([JsonRpcParameter(Description = "Returns every known fork when true", ExampleValue = "[true]")] bool showAllForks = false);
294293
}
295294
}

src/Nethermind/Nethermind.Network/ForkInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
1+
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
22
// SPDX-License-Identifier: LGPL-3.0-only
33

44
using Force.Crc32;
@@ -177,7 +177,7 @@ public ForkActivationsSummary GetForkActivationsSummary(BlockHeader? head)
177177
};
178178
}
179179

180-
public IReadOnlyList<Fork> GetAllForks()
180+
public Fork[] GetAllForks()
181181
{
182182
EnsureInitialized();
183183
return Forks;

src/Nethermind/Nethermind.Network/IForkInfo.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
22
// SPDX-License-Identifier: LGPL-3.0-only
33

4-
using System.Collections.Generic;
54
using Nethermind.Core;
65
using Nethermind.Core.Specs;
76

@@ -21,7 +20,7 @@ public interface IForkInfo
2120

2221
ForkActivationsSummary GetForkActivationsSummary(BlockHeader? head);
2322

24-
IReadOnlyList<Fork> GetAllForks();
23+
Fork[] GetAllForks();
2524
}
2625

2726
public readonly record struct Fork(ForkActivation Activation, ForkId Id);

0 commit comments

Comments
 (0)