Skip to content

Commit

Permalink
rename to ContractSearch, tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchhill committed Jan 9, 2025
1 parent 3cc1953 commit c75ca6c
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

namespace Nethermind.ContractSearch.Plugin;

public class ContractSearchConfig : IContractSearchConfig
{
public bool Enabled { get; set; }
public string? File { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@

// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only
using System;
using System.Threading.Tasks;

using Nethermind.Api;
using Nethermind.Api.Extensions;
using Nethermind.Core;
using Nethermind.JsonRpc.Client;
using Nethermind.JsonRpc;
using Nethermind.Network;
using Nethermind.Consensus;
using Nethermind.KeyStore.Config;
using System.Configuration;
using Nethermind.Logging;
using System.IO.Abstractions;

namespace Nethermind.Search.Plugin;
public class SearchPlugin : INethermindPlugin
namespace Nethermind.ContractSearch.Plugin;

public class ContractSearchPlugin : INethermindPlugin
{
public string Name => "Search";
public string Description => "";
public string Name => "ContractSearch";
public string Description => "Search smart contracts for magic numbers";
public string Author => "Nethermind";
private INethermindApi _api = null!;
private ISearchConfig _config = null!;
private IContractSearchConfig _config = null!;
private ILogManager _logManager = null!;
private ILogger _logger;
private bool Enabled => _config?.Enabled == true;
Expand All @@ -31,8 +22,8 @@ public Task Init(INethermindApi nethermindApi)
{
_api = nethermindApi;
_logManager = _api.LogManager;
_config = _api.Config<ISearchConfig>();
_logger = _logManager.GetClassLogger<SearchPlugin>();
_config = _api.Config<IContractSearchConfig>();
_logger = _logManager.GetClassLogger<ContractSearchPlugin>();
return Task.CompletedTask;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using Nethermind.Config;

namespace Nethermind.ContractSearch.Plugin;

public interface IContractSearchConfig : IConfig
{
[ConfigItem(
Description = "Activates or Deactivates Search Plugin",
DefaultValue = "false")]
bool Enabled { get; set; }

[ConfigItem(
Description = "Sets the file to which the search results are dumped",
DefaultValue = "null")]
string? File { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -10,5 +9,4 @@
<ProjectReference Include="..\Nethermind.Api\Nethermind.Api.csproj" />
<ProjectReference Include="..\Nethermind.Config\Nethermind.Config.csproj" />
</ItemGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Runner/Nethermind.Runner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<ProjectReference Include="..\Nethermind.Specs\Nethermind.Specs.csproj" />
<ProjectReference Include="..\Nethermind.Synchronization\Nethermind.Synchronization.csproj" />
<ProjectReference Include="..\Nethermind.UPnP.Plugin\Nethermind.UPnP.Plugin.csproj" />
<ProjectReference Include="..\Nethermind.Search.Plugin\Nethermind.Search.Plugin.csproj" />
<ProjectReference Include="..\Nethermind.ContractSearch.Plugin\Nethermind.ContractSearch.Plugin.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 0 additions & 18 deletions src/Nethermind/Nethermind.Search.Plugin/ISearchConfig.cs

This file was deleted.

11 changes: 0 additions & 11 deletions src/Nethermind/Nethermind.Search.Plugin/SearchConfig.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.sln
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nethermind.Serialization.Ss
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nethermind.Serialization.SszGenerator.Test", "Nethermind.Serialization.SszGenerator.Test\Nethermind.Serialization.SszGenerator.Test.csproj", "{E11DA65F-7F52-40DA-BBF4-E6E90932EB68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nethermind.Search.Plugin", "Nethermind.Search.Plugin\Nethermind.Search.Plugin.csproj", "{E4451E87-5A91-4108-94B2-24CA837CD8DE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nethermind.ContractSearch.Plugin", "Nethermind.ContractSearch.Plugin\Nethermind.ContractSearch.Plugin.csproj", "{E4451E87-5A91-4108-94B2-24CA837CD8DE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion src/bench_precompiles
Submodule bench_precompiles updated 1 files
+0 −7 LICENSE.txt

0 comments on commit c75ca6c

Please sign in to comment.