Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
asdacap committed Sep 30, 2024
1 parent 9e4da92 commit 39ede21
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/Nethermind/Nethermind.Init/Steps/InitializeNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ protected override void Load(ContainerBuilder builder)
{
IEthereumEcdsa ecdsa = ctx.Resolve<IEthereumEcdsa>();
ILogManager logManager = ctx.Resolve<ILogManager>();
INetworkConfig networkConfig = ctx.Resolve<INetworkConfig>();
ChainSpec chainSpec = ctx.Resolve<ChainSpec>();
// I do not use the key here -> API is broken - no sense to use the node signer here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Nethermind.JsonRpc;
using Nethermind.JsonRpc.Modules;
using Nethermind.Merge.Plugin.BlockProduction;
using Nethermind.Network.Config;
using Nethermind.Specs.ChainSpecStyle;
using NUnit.Framework;
using NSubstitute;
Expand Down Expand Up @@ -74,8 +75,7 @@ private ContainerBuilder CreateContainerBuilder()
{
ContainerBuilder builder = new ContainerBuilder();
((IApiWithNetwork)_context).ConfigureContainerBuilderFromApiWithNetwork(builder);
builder.RegisterModule(new NetworkModule());
builder.RegisterModule(new SynchronizerModule(syncConfig));
builder.RegisterModule(new NetworkModule(new NetworkConfig(), new SyncConfig()));
return builder;
}

Expand Down
15 changes: 13 additions & 2 deletions src/Nethermind/Nethermind.Runner.Test/Ethereum/ContextWithMocks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@
using Nethermind.Trie;
using NSubstitute;
using Nethermind.Blockchain.Blocks;
using Nethermind.Blockchain.Synchronization;
using Nethermind.Consensus.Scheduler;
using Nethermind.Core;
using Nethermind.Core.Test.Builders;
using Nethermind.Init.Steps;
using Nethermind.Network.Config;
using Nethermind.Network.P2P.Analyzers;

namespace Nethermind.Runner.Test.Ethereum
Expand Down Expand Up @@ -161,13 +163,22 @@ public static NethermindApi ContextWithMocks()
return api;
}

public static NethermindApi ContextWithMocksWithTestContainer()
public static NethermindApi ContextWithMocksWithTestContainer(INetworkConfig networkConfig = null, ISyncConfig syncConfig = null)
{
NethermindApi api = ContextWithoutContainer();

if (networkConfig == null)
{
networkConfig = new NetworkConfig();
}
if (syncConfig == null)
{
syncConfig = new SyncConfig();
}

var builder = new ContainerBuilder();
((IApiWithNetwork)api).ConfigureContainerBuilderFromApiWithNetwork(builder);
builder.RegisterModule(new NetworkModule());
builder.RegisterModule(new NetworkModule(networkConfig, syncConfig));
api.ApiWithNetworkServiceContainer = builder.Build();

return api;
Expand Down

0 comments on commit 39ede21

Please sign in to comment.