Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Testengine executable #365

Closed
wants to merge 132 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
7025642
Boa-117 Create Testengine executable to test Neo3-boa
meevee98 Sep 16, 2020
c0b369e
create a testengine executable
meevee98 Sep 16, 2020
bd17afc
move clear to TestDataCache
meevee98 Sep 21, 2020
4c23f48
Merge branch 'master' into test-engine-executable
meevee98 Oct 5, 2020
80335e3
moved TestEngine and TestUtils to TestEngine project + added TestEngi…
meevee98 Oct 5, 2020
ef71433
remove unused import
meevee98 Oct 5, 2020
f0e7d60
change namespace
meevee98 Oct 19, 2020
ba806a1
code review + unit tests
meevee98 Oct 16, 2020
b792b97
increase coverage
meevee98 Oct 19, 2020
8c44910
show output
meevee98 Oct 19, 2020
71b59ff
add json test support to the TestEngine
meevee98 Oct 26, 2020
d172427
fix unit tests
meevee98 Oct 26, 2020
9bda72e
Merge pull request #6 from simplitech/test-engine-json-input
melanke Oct 26, 2020
3376c2f
Merge branch 'master' into test-engine-executable
meevee98 Oct 27, 2020
ebbc6b4
include storage values in the test engine arguments
meevee98 Oct 26, 2020
04d9c97
Merge pull request #7 from simplitech/include-fake-storage-entries
melanke Oct 27, 2020
b361346
include other smart contracts in the TestEngine arguments
meevee98 Oct 29, 2020
4229595
Merge pull request #8 from simplitech/include-other-contracts
lock9 Oct 29, 2020
deb289c
Merge branch 'master' into test-engine-executable
meevee98 Nov 16, 2020
850bd5e
fix assembly conflicts
meevee98 Nov 16, 2020
6c979b9
Increase block height in the TestEngine
meevee98 Nov 4, 2020
ebe33b2
Merge pull request #9 from simplitech/Boa-241
melanke Nov 17, 2020
2c1f799
Merge remote-tracking branch 'origin/master' into test-engine-executable
meevee98 Nov 23, 2020
18e4ee9
fix unit test
meevee98 Nov 23, 2020
2a5a9f7
Boa-263 Include CheckWitness in the TestEngine
meevee98 Nov 24, 2020
44d7ff2
Merge pull request #10 from simplitech/Boa-263
melanke Nov 25, 2020
adc77d2
fix increase height
meevee98 Nov 25, 2020
b83def3
Merge remote-tracking branch 'origin/master' into Boa-264
meevee98 Dec 1, 2020
e9875e8
Boa-264 Include blocks and transactions in the TestEngine
meevee98 Dec 8, 2020
459df19
Boa-264 Include blocks and transactions in the TestEngine
meevee98 Dec 10, 2020
28d5337
fix unit test path
meevee98 Dec 10, 2020
231a6f5
Merge pull request #11 from simplitech/Boa-264
melanke Dec 10, 2020
7f77a54
Merge branch 'master' into test-engine-executable
meevee98 Dec 10, 2020
19294ca
fix map arguments
meevee98 Dec 11, 2020
0950ff9
Merge remote-tracking branch 'origin/master' into test-engine-executable
meevee98 Dec 11, 2020
0e85e06
include genesis block's transactions in the TestSnapshot
meevee98 Dec 14, 2020
4dfd20a
code review
meevee98 Dec 15, 2020
952a751
Merge branch 'master' into test-engine-executable
meevee98 Dec 16, 2020
f47fbc8
change path in the test workflow
meevee98 Dec 17, 2020
5618442
change storage json serialization/deserialization
meevee98 Dec 17, 2020
8f129e2
Merge branch 'master' into test-engine-executable
meevee98 Jan 7, 2021
88e916b
fix unit-test
meevee98 Jan 7, 2021
d24350b
usa Directory.Build.props to set the same Neo version for the compile…
meevee98 Jan 7, 2021
0c84cc8
Merge branch 'master' into test-engine-executable
meevee98 Jan 19, 2021
de7dee1
fix add contract
meevee98 Jan 19, 2021
3af18e4
Merge branch 'master' into test-engine-executable
meevee98 Jan 19, 2021
1ea9d51
Merge remote-tracking branch 'origin/master' into test-engine-executable
meevee98 Jan 20, 2021
a79b25e
use contract id instead of hard coded id
meevee98 Jan 20, 2021
a418ae4
Merge branch 'master' into test-engine-executable
meevee98 Feb 2, 2021
0ea2a09
fixed testengine unit tests
meevee98 Feb 2, 2021
ab784d2
Merge branch 'master' into test-engine-executable
meevee98 Feb 4, 2021
c8346d2
can execute included smart contracts and native by scripthash as well
meevee98 Feb 5, 2021
563f3ab
Merge remote-tracking branch 'origin/master' into test-engine-executable
meevee98 Feb 5, 2021
0ceaf14
fix import
meevee98 Feb 5, 2021
dd13f22
fix storage access between contracts
meevee98 Mar 1, 2021
c261158
Merge branch 'rc1' into test-engine-executable
meevee98 Mar 19, 2021
0ac6724
fix native contract call
meevee98 Mar 22, 2021
8936b86
change TestEngine to test contracts update
meevee98 Mar 30, 2021
92bb0c4
read json file input
meevee98 Mar 31, 2021
42236fa
Merge branch 'master' into test-engine-executable
meevee98 Apr 14, 2021
979a6f9
include tx attributes in the input
meevee98 Apr 14, 2021
b4aac8e
remove comments
meevee98 Apr 14, 2021
71a3cb2
fix import
meevee98 Apr 14, 2021
c08ac2d
Merge branch 'master' into test-engine-executable
meevee98 Apr 14, 2021
0b7545c
Merge branch 'master' into test-engine-executable
meevee98 Apr 28, 2021
99fd474
fix test engine unit tests
meevee98 Apr 28, 2021
7870398
Sync to Neo 3.0.0-CI01272
meevee98 Apr 29, 2021
53ef46a
Merge branch 'master' into test-engine-executable
meevee98 Apr 29, 2021
04353eb
update namespaces + dotnet-format
meevee98 Apr 29, 2021
6f0f118
Merge branch 'master' into test-engine-executable
meevee98 May 3, 2021
bea4b4b
Merge branch 'master' into test-engine-executable
meevee98 May 4, 2021
1fb01e8
code review
meevee98 May 4, 2021
96938b2
Merge branch 'master' into test-engine-executable
meevee98 May 5, 2021
c96bc45
Merge branch 'master' into test-engine-executable
meevee98 May 10, 2021
5311586
return engine for concatenating
meevee98 May 10, 2021
a3d5b42
Merge branch 'master' into test-engine-executable
meevee98 May 12, 2021
ec2f1d8
rename fields and use vm helper method
meevee98 May 13, 2021
90a33f7
use wallet to calculate network fee
meevee98 May 20, 2021
c9840c2
Merge branch 'master' into test-engine-executable
meevee98 May 20, 2021
6b509d5
Merge branch 'master' into test-engine-executable
meevee98 May 25, 2021
9af8e40
Merge 'master' into test-engine-executable
meevee98 May 26, 2021
82a51ea
fix tx consistency in input and output
meevee98 May 26, 2021
f340a12
include persisting block in the output
meevee98 May 26, 2021
211437a
Clean enter
shargon May 27, 2021
fd27e4e
Use only privateKey in TestAccount
shargon May 27, 2021
94ee45b
format
shargon May 27, 2021
f591212
rename fields and cleanup code
meevee98 May 28, 2021
1aec9f7
missed field in main
meevee98 May 28, 2021
01d545e
Merge branch 'master' into test-engine-executable
meevee98 Jun 1, 2021
6654621
Merge branch 'master' into test-engine-executable
meevee98 Jun 16, 2021
1de1ed2
call updated contract
meevee98 Jun 16, 2021
fc7580a
Merge branch 'master' into test-engine-executable
meevee98 Jun 22, 2021
8b662ee
Merge branch 'master' into test-engine-executable
shargon Jun 24, 2021
96bdd7e
Merge branch 'master' into test-engine-executable
meevee98 Jul 13, 2021
0033226
include nonce in block helper methods
meevee98 Jul 13, 2021
dccde19
Merge branch 'master' into test-engine-executable
shargon Jul 19, 2021
2c29e6e
Merge branch 'master' into test-engine-executable
meevee98 Jul 20, 2021
9287447
Merge branch 'master' into test-engine-executable
meevee98 Aug 3, 2021
db367d2
Merge branch 'master' into test-engine-executable
meevee98 Sep 13, 2021
7dded43
Improve error messages on the TestEngine when the types are incorrect
meevee98 Sep 15, 2021
02be35f
format
meevee98 Sep 15, 2021
c2dbad4
interface to signer witness scope
meevee98 Sep 15, 2021
4fddf69
fix unit test
meevee98 Sep 16, 2021
2699b79
Merge branch 'master' into test-engine-executable
meevee98 Oct 13, 2021
79f2164
Merge branch 'master' into test-engine-executable
meevee98 Oct 20, 2021
e8c6ed2
feat, add handling for InteropInterface wrapped iterators
merl111 Oct 20, 2021
1c42c2d
Merge pull request #21 from OnBlockIO/test-engine-executable
meevee98 Oct 22, 2021
8036c5a
Merge remote-tracking branch 'origin/master' into test-engine-executable
meevee98 Nov 8, 2021
0c1303e
Merge branch 'master' into test-engine-executable
meevee98 Nov 16, 2021
e68accf
dotnet format
meevee98 Nov 16, 2021
7f99692
Merge branch 'master' into test-engine-executable
meevee98 Nov 25, 2021
e64dedd
dotnet format
meevee98 Nov 25, 2021
2ebe4f9
change nullable types
meevee98 Nov 25, 2021
475f173
Make the TestEngine a global dotnet tool (similar to neoxp)
Nov 22, 2021
46849a8
run test engine unit tests
meevee98 Nov 25, 2021
6f31e16
Merge pull request #23 from simplitech/dotnet-tool
meevee98 Nov 25, 2021
83c4f6b
wrong path
meevee98 Nov 25, 2021
7fbe253
Merge branch 'master' into test-engine-executable
meevee98 Dec 7, 2021
f20b2c8
Merge branch 'master' into test-engine-executable
meevee98 Jan 19, 2022
f797616
Merge branch 'master' into test-engine-executable
meevee98 Jun 2, 2022
4bfdd89
enhance transaction operations
meevee98 Jul 6, 2022
7445246
Support to set the calling script hash
meevee98 Aug 4, 2022
9b43aab
Merge branch 'master' into test-engine-executable
meevee98 Aug 4, 2022
11efdde
Merge branch 'master' into test-engine-executable
meevee98 Aug 22, 2022
cd39ea9
Manifest access raising null pointer exception
meevee98 Sep 30, 2022
92b9e1d
Block hashes on input
meevee98 Sep 30, 2022
2e330a1
Script hash mocking
meevee98 Nov 7, 2022
c2ef0ae
fix signers witness scope
meevee98 Dec 9, 2022
6768e34
fix signer nullable variables causing unexpected errors
meevee98 Dec 9, 2022
f0296df
fix invalid reference counter on arguments
meevee98 Dec 12, 2022
9421daf
keep executing script hash consistent with deploy
meevee98 Dec 13, 2022
138176b
incorrect sender being used to deploy other contracts
meevee98 Dec 13, 2022
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
7 changes: 7 additions & 0 deletions neo-devpack-dotnet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Template.NEP5.CSharp", "tem
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Template.NEP5.UnitTests", "tests\Template.NEP5.UnitTests\Template.NEP5.UnitTests.csproj", "{780141EE-D6E9-4591-8470-8F91B12027CA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestEngine", "src\TestEngine\TestEngine.csproj", "{39347E90-FC12-4018-8F22-828F0F1B2F7D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -71,6 +73,10 @@ Global
{780141EE-D6E9-4591-8470-8F91B12027CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{780141EE-D6E9-4591-8470-8F91B12027CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{780141EE-D6E9-4591-8470-8F91B12027CA}.Release|Any CPU.Build.0 = Release|Any CPU
{39347E90-FC12-4018-8F22-828F0F1B2F7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39347E90-FC12-4018-8F22-828F0F1B2F7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39347E90-FC12-4018-8F22-828F0F1B2F7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39347E90-FC12-4018-8F22-828F0F1B2F7D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -85,6 +91,7 @@ Global
{93BEC5CC-BAFF-4389-89E7-84AAFF5D495D} = {D5266066-0AFD-44D5-A83E-2F73668A63C8}
{ADD05222-DC45-4FDC-A41A-30A97BACC95F} = {7042EF23-826B-45A1-A905-59AD678C31B7}
{780141EE-D6E9-4591-8470-8F91B12027CA} = {D5266066-0AFD-44D5-A83E-2F73668A63C8}
{39347E90-FC12-4018-8F22-828F0F1B2F7D} = {79389FC0-C621-4CEA-AD2B-6074C32E7BCA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6DA935E1-C674-4364-B087-F1B511B79215}
Expand Down
98 changes: 98 additions & 0 deletions src/TestEngine/Engine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using Neo;
using Neo.Compiler.MSIL.UnitTests.Utils;
using Neo.Cryptography.ECC;
using Neo.IO.Json;
using Neo.Network.P2P.Payloads;
using Neo.SmartContract;
using Neo.SmartContract.Manifest;
using Neo.VM;
using Neo.VM.Types;

namespace TestingEngine
{
public class Engine
{
private static Engine instance = null;
public static Engine Instance
{
get
{
if (instance == null)
{
instance = new Engine();
}
return instance;
}
}

private TestEngine engine = null;
private byte[] PubKey => HexString2Bytes("03ea01cb94bdaf0cd1c01b159d474f9604f4af35a3e2196f6bdfdb33b2aa4961fa");

private Engine()
{
engine = SetupNativeContracts();
}

public void SetTestEngine(string path)
{
engine.AddEntryScript(path);
var manifest = ContractManifest.FromJson(JObject.Parse(engine.ScriptEntry.finalManifest));

engine.Snapshot.Contracts.Add(manifest.Hash, new Neo.Ledger.ContractState()
{
Script = engine.ScriptEntry.finalNEF,
Manifest = manifest,
});
}

public JObject Run(string method, StackItem[] args)
{
engine.GetMethod(method).RunEx(args);
return engine.ToJson();
}

private TestEngine SetupNativeContracts()
{
var block = new Block()
{
Index = 0,
ConsensusData = new ConsensusData(),
Transactions = new Transaction[0],
Witness = new Witness()
{
InvocationScript = new byte[0],
VerificationScript = Contract.CreateSignatureRedeemScript(ECPoint.FromBytes(PubKey, ECCurve.Secp256k1))
},
NextConsensus = UInt160.Zero,
MerkleRoot = UInt256.Zero,
PrevHash = UInt256.Zero
};

TestEngine engine = new TestEngine(TriggerType.Application, block);
((TestSnapshot)engine.Snapshot).SetPersistingBlock(block);

using (var script = new ScriptBuilder())
{
script.EmitSysCall(TestEngine.Native_Deploy);
engine.LoadScript(script.ToArray());
engine.Execute();
}
engine.ClearNotifications();
((TestSnapshot)engine.Snapshot).ClearStorage();

return engine;
}

private static byte[] HexString2Bytes(string str)
{
if (str.IndexOf("0x") == 0)
str = str.Substring(2);
byte[] outd = new byte[str.Length / 2];
for (var i = 0; i < str.Length / 2; i++)
{
outd[i] = byte.Parse(str.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber);
}
return outd;
}
}
}
69 changes: 69 additions & 0 deletions src/TestEngine/Helper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using Neo;
using Neo.Compiler.MSIL.UnitTests.Utils;
using Neo.IO.Caching;
using Neo.IO.Json;
using Neo.Ledger;
using Neo.SmartContract;
using Neo.SmartContract.Native;
using Neo.VM;
using Neo.VM.Types;
using System;
using System.Linq;

namespace TestingEngine
{
public static class Helper
{
public static JObject ToJson(this TestEngine testEngine)
{
var json = new JObject();

json["vm_state"] = testEngine.State.ToString();
json["gas_consumed"] = (new BigDecimal(testEngine.GasConsumed, NativeContract.GAS.Decimals)).ToString();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We agreed to use gasconsumed format in json properties

json["result_stack"] = testEngine.ResultStack.ToJson();
json["storage"] = testEngine.Snapshot.Storages.ToJson();
json["notifications"] = new JArray(testEngine.Notifications.Select(n => n.ToJson()));
json["error"] = testEngine.State.HasFlag(VMState.FAULT) ? GetExceptionMessage(testEngine.FaultException) : null;

return json;
}

public static JObject ToJson(this EvaluationStack stack)
{
return new JArray(stack.Select(p => p.ToJson()));
}

public static JObject ToJson(this NotifyEventArgs notification)
{
var json = new JObject();
json["eventName"] = notification.EventName;
json["scriptHash"] = notification.ScriptHash.ToString();
json["value"] = notification.State.ToJson();
return json;
}

public static JObject ToJson(this DataCache<StorageKey, StorageItem> storage)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to initialize the storage, for fake balances for example.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm currently working on this

{
var storageMap = new Map();
foreach (var storagePair in storage.Seek())
{
var key = new ByteString(storagePair.Key.Key);
var value = new ByteString(storagePair.Value.Value);
storageMap[key] = value;
}
return storageMap.ToJson()["value"];
}

private static string GetExceptionMessage(Exception exception)
{
if (exception == null) return "Engine faulted.";

if (exception.InnerException != null)
{
return GetExceptionMessage(exception.InnerException);
}

return exception.Message;
}
}
}
134 changes: 134 additions & 0 deletions src/TestEngine/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
using Neo.IO.Json;
using Neo.SmartContract;
using Neo.VM;
using Neo.VM.Types;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace TestingEngine
{
class Program
{
static int Main(string[] args)
{
JObject result;
if (args.Length >= 2)
{
result = RunWithMethodName(args[0], args[1], string.Join(" ", args.Skip(2)));
}
else
{
result = BuildJsonException("One or more arguments are missing");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show an example?

}

Console.WriteLine(result);
if (!result.ContainsProperty("vm_state"))
{
return -1;
}
return 0;
}

/// <summary>
/// Runs a nef script given a method name and its arguments
/// </summary>
/// <param name="path">Absolute path of the script</param>
/// <param name="method">The name of the targeted method</param>
/// <param name="parameters">Json string representing the arguments of the method</param>
/// <returns>Returns a json with the engine state after executing the script</returns>
public static JObject RunWithMethodName(string path, string methodName, string jsonParams)
{
try
{
JArray parameters = new JArray();
if (jsonParams.Length > 0)
{
var json = JObject.Parse(jsonParams);
if (json is JArray array)
{
parameters = array;
}
else
{
parameters.Insert(0, json);
}
}

return Run(path, methodName, parameters);
}
catch (Exception e)
{
return BuildJsonException(e.Message);
}
}

/// <summary>
/// Runs the given method from a nef script
/// </summary>
/// <param name="path">Absolute path of the script</param>
/// <param name="method">The name of the targeted method</param>
/// <param name="parameters">Arguments of the method</param>
/// <returns>Returns a json with the engine state after executing the script</returns>
public static JObject Run(string path, string method, JArray parameters)
{
if (!File.Exists(path))
{
return BuildJsonException("File doesn't exists");
}
if (Path.GetExtension(path).ToLowerInvariant() != ".nef")
{
return BuildJsonException("Invalid file. A .nef file required.");
}

try
{
Engine.Instance.SetTestEngine(path);
var stackParams = GetStackItemParameters(parameters);
return Engine.Instance.Run(method, stackParams);
}
catch (Exception e)
{
return BuildJsonException(e.Message);
}
}

/// <summary>
/// Converts the data in a json array to an array of StackItem
/// </summary>
/// <param name="parameters">json array to be converted</param>
/// <returns>Returns the built StackItem array</returns>
private static StackItem[] GetStackItemParameters(JArray parameters)
{
var items = new List<StackItem>();
foreach (JObject param in parameters)
{
var success = false;
if (param.ContainsProperty("value") && param.ContainsProperty("type"))
{
try
{
items.Add(ContractParameter.FromJson(param).ToStackItem());
success = true;
}
catch { }
}

if (!success)
{
// if something went wrong while reading the json, inserts null in this argument position
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show log or break the execution, it could produce test mistakes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping

items.Add(StackItem.Null);
}
}
return items.ToArray();
}

private static JObject BuildJsonException(string message)
{
var json = new JObject();
json["error"] = message;
return json;
}
}
}
25 changes: 25 additions & 0 deletions src/TestEngine/TestEngine.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Copyright>2015-2020 The Neo Project</Copyright>
<AssemblyTitle>Neo.TestEngine</AssemblyTitle>
<Version>3.0.0-preview3</Version>
<Authors>The Neo Project</Authors>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<PackageTags>NEO;Blockchain;Smart Contract</PackageTags>
<PackageProjectUrl>https://github.com/neo-project/neo-devpack-dotnet</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/neo-project/neo-devpack-dotnet.git</RepositoryUrl>
<RootNamespace>Neo.TestEngine</RootNamespace>
<Company>The Neo Project</Company>
<Product>TestingEngine</Product>
<Description>TestingEngine</Description>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Neo.Compiler.MSIL\Neo.Compiler.MSIL.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using Neo.Compiler.MSIL.UnitTests.Utils;
using Neo.IO.Json;
using Neo.SmartContract;

namespace Neo.Compiler.MSIL.Utils
namespace Neo.Compiler.MSIL.UnitTests.Utils
{
class BuildNEF : BuildScript
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[assembly: InternalsVisibleTo("Neo.SmartContract.Framework.UnitTests")]
namespace Neo.Compiler.MSIL.UnitTests.Utils
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change namespace?

{
internal static class NeonTestTool
public static class NeonTestTool
{
/// <summary>
/// Is not the official script hash, just a unique hash related to the script used for unit test purpose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,13 @@ protected override void UpdateInternal(TKey key, TValue value)
{
dic[key] = value;
}

/// <summary>
/// Clear the storage for unit test
/// </summary>
public void Clear()
{
dic.Clear();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Neo.Compiler.MSIL.Utils;
using Neo.IO.Json;
using Neo.Network.P2P.Payloads;
using Neo.Persistence;
Expand Down
Loading