Skip to content

Commit 2e09c7e

Browse files
committed
Fix: resolve conflics due to isolate ApplicationEngine
2 parents 9d9bdc5 + cb56508 commit 2e09c7e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4041
-369
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ jobs:
109109
${{ github.workspace }}/TestResults/Neo.Json.UnitTests/coverage.info
110110
${{ github.workspace }}/TestResults/Neo.Cryptography.MPTTrie.Tests/coverage.info
111111
${{ github.workspace }}/TestResults/Neo.Network.RPC.Tests/coverage.info
112+
${{ github.workspace }}/TestResults/Neo.Plugins.DBFTPlugin.Tests/coverage.info
112113
${{ github.workspace }}/TestResults/Neo.Plugins.OracleService.Tests/coverage.info
113114
${{ github.workspace }}/TestResults/Neo.Plugins.RpcServer.Tests/coverage.info
114115
${{ github.workspace }}/TestResults/Neo.Plugins.Storage.Tests/coverage.info

Neo.Cryptography.MPTTrie.Benchmarks/Benchmarks.Cache.cs renamed to benchmarks/Neo.Cryptography.MPTTrie.Benchmarks/Benchmarks.Cache.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
// modifications are permitted.
1111

1212
using BenchmarkDotNet.Attributes;
13-
using System;
14-
using System.Security.Policy;
1513

1614
namespace Neo.Cryptography.MPTTrie.Benchmarks
1715
{

Neo.Cryptography.MPTTrie.Benchmarks/Neo.Cryptography.MPTTrie.Benchmarks.csproj renamed to benchmarks/Neo.Cryptography.MPTTrie.Benchmarks/Neo.Cryptography.MPTTrie.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<ProjectReference Include="..\src\Neo\Neo.csproj" />
15+
<ProjectReference Include="..\..\src\Neo\Neo.csproj" />
1616
</ItemGroup>
1717

1818
</Project>
File renamed without changes.

neo.sln

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignClient", "src\Plugins\S
9393
EndProject
9494
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neo.Plugins.SignClient.Tests", "tests\Neo.Plugins.SignClient.Tests\Neo.Plugins.SignClient.Tests.csproj", "{E2CFEAA1-45F2-4075-94ED-866862C6863F}"
9595
EndProject
96-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neo.Cryptography.MPTTrie.Benchmarks", "Neo.Cryptography.MPTTrie.Benchmarks\Neo.Cryptography.MPTTrie.Benchmarks.csproj", "{A53FE0B5-22BA-4C52-8FD4-80877DB62992}"
96+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neo.Cryptography.MPTTrie.Benchmarks", "benchmarks\Neo.Cryptography.MPTTrie.Benchmarks\Neo.Cryptography.MPTTrie.Benchmarks.csproj", "{69B0D53B-D97A-4315-B205-CCEBB7289EA9}"
9797
EndProject
9898
Global
9999
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -261,10 +261,10 @@ Global
261261
{E2CFEAA1-45F2-4075-94ED-866862C6863F}.Debug|Any CPU.Build.0 = Debug|Any CPU
262262
{E2CFEAA1-45F2-4075-94ED-866862C6863F}.Release|Any CPU.ActiveCfg = Release|Any CPU
263263
{E2CFEAA1-45F2-4075-94ED-866862C6863F}.Release|Any CPU.Build.0 = Release|Any CPU
264-
{A53FE0B5-22BA-4C52-8FD4-80877DB62992}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
265-
{A53FE0B5-22BA-4C52-8FD4-80877DB62992}.Debug|Any CPU.Build.0 = Debug|Any CPU
266-
{A53FE0B5-22BA-4C52-8FD4-80877DB62992}.Release|Any CPU.ActiveCfg = Release|Any CPU
267-
{A53FE0B5-22BA-4C52-8FD4-80877DB62992}.Release|Any CPU.Build.0 = Release|Any CPU
264+
{69B0D53B-D97A-4315-B205-CCEBB7289EA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
265+
{69B0D53B-D97A-4315-B205-CCEBB7289EA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
266+
{69B0D53B-D97A-4315-B205-CCEBB7289EA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
267+
{69B0D53B-D97A-4315-B205-CCEBB7289EA9}.Release|Any CPU.Build.0 = Release|Any CPU
268268
EndGlobalSection
269269
GlobalSection(SolutionProperties) = preSolution
270270
HideSolutionNode = FALSE
@@ -311,7 +311,7 @@ Global
311311
{19B1CF1A-17F4-4E04-AB9C-55CE74952E11} = {EDE05FA8-8E73-4924-BC63-DD117127EEE1}
312312
{CAD55942-48A3-4526-979D-7519FADF19FE} = {C2DC830A-327A-42A7-807D-295216D30DBB}
313313
{E2CFEAA1-45F2-4075-94ED-866862C6863F} = {7F257712-D033-47FF-B439-9D4320D06599}
314-
{A53FE0B5-22BA-4C52-8FD4-80877DB62992} = {C25EB0B0-0CAC-4CC1-8F36-F9229EFB99EC}
314+
{69B0D53B-D97A-4315-B205-CCEBB7289EA9} = {C25EB0B0-0CAC-4CC1-8F36-F9229EFB99EC}
315315
EndGlobalSection
316316
GlobalSection(ExtensibilityGlobals) = postSolution
317317
SolutionGuid = {BCBA19D9-F868-4C6D-8061-A2B91E06E3EC}

src/Neo.VM/JumpTable/JumpTable.Numeric.cs

Lines changed: 69 additions & 4 deletions
Large diffs are not rendered by default.

src/Neo/IEventHandlers/ILogHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ public interface ILogHandler
2121
/// </summary>
2222
/// <param name="sender">The source of the event.</param>
2323
/// <param name="logEventArgs">The arguments <see cref="LogEventArgs"/> of the log.</param>
24-
void ApplicationEngine_Log_Handler(object sender, LogEventArgs logEventArgs);
24+
void ApplicationEngine_Log_Handler(ApplicationEngine sender, LogEventArgs logEventArgs);
2525
}
2626
}

src/Neo/Neo.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<InternalsVisibleTo Include="Neo.SmartContract.TestEngine" />
3232
<InternalsVisibleTo Include="Neo.Plugins.RpcServer.Tests" />
3333
<InternalsVisibleTo Include="Neo.Plugins.OracleService.Tests" />
34+
<InternalsVisibleTo Include="Neo.Plugins.DBFTPlugin.Tests" />
3435
</ItemGroup>
3536

3637
</Project>

src/Neo/SmartContract/ApplicationEngine.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,24 @@ public partial class ApplicationEngine : ExecutionEngine
4444
/// </summary>
4545
public const long TestModeGas = 20_00000000;
4646

47+
public delegate void OnInstanceHandlerEvent(ApplicationEngine engine);
48+
public delegate void OnLogEvent(ApplicationEngine engine, LogEventArgs args);
49+
public delegate void OnNotifyEvent(ApplicationEngine engine, NotifyEventArgs args);
50+
4751
/// <summary>
4852
/// Triggered when a contract calls System.Runtime.Notify.
4953
/// </summary>
50-
public static event EventHandler<NotifyEventArgs> Notify;
54+
public event OnNotifyEvent Notify;
5155

5256
/// <summary>
5357
/// Triggered when a contract calls System.Runtime.Log.
5458
/// </summary>
55-
public static event EventHandler<LogEventArgs> Log;
59+
public event OnLogEvent Log;
60+
61+
/// <summary>
62+
/// On Application Engine
63+
/// </summary>
64+
public static OnInstanceHandlerEvent InstanceHandler;
5665

5766
private static Dictionary<uint, InteropDescriptor> services;
5867
// Total amount of GAS spent to execute.
@@ -435,8 +444,11 @@ public static ApplicationEngine Create(TriggerType trigger, IVerifiable containe
435444
// Adjust jump table according persistingBlock
436445

437446
var jumpTable = settings == null || settings.IsHardforkEnabled(Hardfork.HF_Echidna, index) ? DefaultJumpTable : NotEchidnaJumpTable;
438-
return Provider?.Create(trigger, container, snapshot, persistingBlock, settings, gas, diagnostic, jumpTable)
447+
var engine = Provider?.Create(trigger, container, snapshot, persistingBlock, settings, gas, diagnostic, jumpTable)
439448
?? new ApplicationEngine(trigger, container, snapshot, persistingBlock, settings, gas, diagnostic, jumpTable);
449+
450+
InstanceHandler?.Invoke(engine);
451+
return engine;
440452
}
441453

442454
/// <summary>

src/Plugins/ApplicationLogs/ApplicationLogs.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<TargetFramework>net9.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>enable</Nullable>
56
</PropertyGroup>
67

78
<ItemGroup>

0 commit comments

Comments
 (0)