Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions src/Nethermind/Ethereum.Blockchain.Pyspec.Test/OsakaEofTests.cs

This file was deleted.

28 changes: 0 additions & 28 deletions src/Nethermind/Ethereum.Test.Base/EofTest.cs

This file was deleted.

74 changes: 0 additions & 74 deletions src/Nethermind/Ethereum.Test.Base/EofTestBase.cs

This file was deleted.

17 changes: 0 additions & 17 deletions src/Nethermind/Ethereum.Test.Base/EofTestJson.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/Nethermind/Ethereum.Test.Base/FileTestsSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public IEnumerable<EthereumTest> LoadTests(TestType testType)

return testType switch
{
TestType.Eof => JsonToEthereumTest.ConvertToEofTests(json),
TestType.State => JsonToEthereumTest.ConvertStateTest(json),
_ => JsonToEthereumTest.ConvertToBlockchainTests(json)
};
Expand Down
3 changes: 0 additions & 3 deletions src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using Nethermind.Core.Test.Modules;
using Nethermind.Crypto;
using Nethermind.Evm;
using Nethermind.Evm.EvmObjectFormat;
using Nethermind.Evm.State;
using Nethermind.Evm.Tracing;
using Nethermind.Evm.TransactionProcessing;
Expand Down Expand Up @@ -66,8 +65,6 @@ protected EthereumTestResult RunTest(GeneralStateTest test, ITxTracer txTracer)
Assert.That(test.LoadFailure, Is.Null, "test data loading failure");
Assert.That(test.Transaction, Is.Not.Null, "there is no transaction in the test");

EofValidator.Logger = _logger;

test.Fork = ChainUtils.ResolveSpec(test.Fork, test.ChainId);

ISpecProvider specProvider =
Expand Down
12 changes: 0 additions & 12 deletions src/Nethermind/Ethereum.Test.Base/IEofTestRunner.cs

This file was deleted.

61 changes: 0 additions & 61 deletions src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using Nethermind.Core.Extensions;
using Nethermind.Core.Specs;
using Nethermind.Crypto;
using Nethermind.Evm.EvmObjectFormat;
using Nethermind.Int256;
using Nethermind.Merge.Plugin.Data;
using Nethermind.Serialization.Json;
Expand Down Expand Up @@ -337,66 +336,6 @@ public static BlockchainTest Convert(string name, string category, BlockchainTes

private static readonly EthereumJsonSerializer _serializer = new();

public static IEnumerable<EofTest> ConvertToEofTests(string json)
{
Dictionary<string, EofTestJson> testsInFile = _serializer.Deserialize<Dictionary<string, EofTestJson>>(json);
List<EofTest> tests = [];
foreach (KeyValuePair<string, EofTestJson> namedTest in testsInFile)
{
(string name, string category) = GetNameAndCategory(namedTest.Key);
GetTestMetaData(namedTest, out string? description, out string? url, out string? spec);

foreach (KeyValuePair<string, VectorTestJson> pair in namedTest.Value.Vectors)
{
VectorTestJson vectorJson = pair.Value;
VectorTest vector = new()
{
Code = Bytes.FromHexString(vectorJson.Code),
ContainerKind = ParseContainerKind(vectorJson.ContainerKind)
};

foreach (KeyValuePair<string, TestResultJson> result in vectorJson.Results)
{
EofTest test = new()
{
Name = $"{name}",
Category = $"{category} [{result.Key}]",
Url = url,
Description = description,
Spec = spec,
Vector = vector,
Result = result.ToTestResult()
};
tests.Add(test);
}
}
}

return tests;

static ValidationStrategy ParseContainerKind(string containerKind)
=> "INITCODE".Equals(containerKind) ? ValidationStrategy.ValidateInitCodeMode : ValidationStrategy.ValidateRuntimeMode;

static void GetTestMetaData(KeyValuePair<string, EofTestJson> namedTest, out string? description, out string? url, out string? spec)
{
description = null;
url = null;
spec = null;
GeneralStateTestInfoJson info = namedTest.Value?.Info;
if (info is not null)
{
description = info.Description;
url = info.Url;
spec = info.Spec;
}
}
}

private static Result ToTestResult(this KeyValuePair<string, TestResultJson> result)
=> result.Value.Result ?
new Result { Fork = result.Key, Success = true } :
new Result { Fork = result.Key, Success = false, Error = result.Value.Exception };

public static IEnumerable<GeneralStateTest> ConvertStateTest(string json)
{
Dictionary<string, GeneralStateTestJson> testsInFile =
Expand Down
48 changes: 0 additions & 48 deletions src/Nethermind/Ethereum.Test.Base/LoadEofTestsFileStrategy.cs

This file was deleted.

9 changes: 0 additions & 9 deletions src/Nethermind/Ethereum.Test.Base/LoadEofTestsStrategy.cs

This file was deleted.

3 changes: 1 addition & 2 deletions src/Nethermind/Ethereum.Test.Base/TestType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ namespace Ethereum.Test.Base;
public enum TestType
{
Blockchain,
State,
Eof
State
}
1 change: 0 additions & 1 deletion src/Nethermind/EthereumTests.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
<Project Path="Ethereum.Transaction.Test/Ethereum.Transaction.Test.csproj" />
<Project Path="Ethereum.Trie.Test/Ethereum.Trie.Test.csproj" />
<Project Path="Nethermind.Blockchain.Test.Runner/Nethermind.Blockchain.Test.Runner.csproj" />
<Project Path="Nethermind.EofParse.Runner/Nethermind.EofParse.Runner.csproj" />
<Project Path="Nethermind.State.Test.Runner.Test/Nethermind.State.Test.Runner.Test.csproj" />
<Project Path="Nethermind.Test.Runner/Nethermind.Test.Runner.csproj" />
</Solution>
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static AlwaysCancelTxTracer Instance

public void MarkAsFailed(Address recipient, in GasConsumed gasSpent, byte[] output, string? error, Hash256? stateRoot = null) => throw new OperationCanceledException(ErrorMessage);

public void StartOperation(int pc, Instruction opcode, long gas, in ExecutionEnvironment env, int codeSection = 0, int functionDepth = 0) => throw new OperationCanceledException(ErrorMessage);
public void StartOperation(int pc, Instruction opcode, long gas, in ExecutionEnvironment env) => throw new OperationCanceledException(ErrorMessage);

public void ReportOperationError(EvmExceptionType error) => throw new OperationCanceledException(ErrorMessage);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ protected virtual TxReceipt BuildReceipt(Address recipient, in GasConsumed gasCo
return txReceipt;
}

public void StartOperation(int pc, Instruction opcode, long gas, in ExecutionEnvironment env, int codeSection = 0, int functionDepth = 0) =>
_currentTxTracer.StartOperation(pc, opcode, gas, env, codeSection, functionDepth);
public void StartOperation(int pc, Instruction opcode, long gas, in ExecutionEnvironment env) =>
_currentTxTracer.StartOperation(pc, opcode, gas, env);

public void ReportOperationError(EvmExceptionType error) =>
_currentTxTracer.ReportOperationError(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using Nethermind.Evm;
using Nethermind.Evm.Tracing;
using Nethermind.Evm.TransactionProcessing;
using Nethermind.Evm.CodeAnalysis;

namespace Nethermind.Blockchain.Tracing.GethStyle.Custom.JavaScript;

Expand Down Expand Up @@ -107,16 +106,14 @@ public override void ReportAction(long gas, UInt256 value, Address from, Address
: new Log.Contract(from, to, value, isAnyCreate ? null : input);
}

public override void StartOperation(int pc, Instruction opcode, long gas, in ExecutionEnvironment env, int codeSection = 0, int functionDepth = 0)
public override void StartOperation(int pc, Instruction opcode, long gas, in ExecutionEnvironment env)
{
_log.pc = pc + (env.CodeInfo is EofCodeInfo eof ? eof.PcOffset() : 0);
_log.pc = pc;
_log.op = new Log.Opcode(opcode);
_log.gas = gas;
_log.depth = env.GetGethTraceDepth();
_log.error = null;
_log.gasCost = null;
// skip codeSection
// skip functionDepth
}

public override void ReportOperationRemainingGas(long gas)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public readonly struct Opcode
public Instruction Value { get; }
public Opcode(Instruction value) => Value = value;
public int toNumber() => (int)Value;
public string? toString() => Value.GetName();
public string? toString() => Enum.GetName(Value);
public bool isPush() => Value is >= Instruction.PUSH0 and <= Instruction.PUSH32;
}

Expand Down
Loading
Loading