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

Update VM to last changes #1048

Merged
merged 2 commits into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 8 additions & 8 deletions neo/SmartContract/ApplicationEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public ApplicationEngine(TriggerType trigger, IVerifiable container, Snapshot sn
this.Trigger = trigger;
this.ScriptContainer = container;
this.Snapshot = snapshot;
ContextLoaded += ApplicationEngine_ContextLoaded;
ContextUnloaded += ApplicationEngine_ContextUnloaded;
}

internal T AddDisposable<T>(T disposable) where T : IDisposable
Expand All @@ -52,14 +50,16 @@ private bool AddGas(long gas)
return testMode || GasConsumed <= gas_amount;
}

private void ApplicationEngine_ContextLoaded(object sender, ExecutionContext e)
{
hashes.Push(((byte[])e.Script).ToScriptHash());
protected override void ContextUnloaded(ExecutionContext context)
{
hashes.Pop();
base.ContextUnloaded(context);
}

private void ApplicationEngine_ContextUnloaded(object sender, ExecutionContext e)
{
hashes.Pop();
protected override void LoadContext(ExecutionContext context)
{
hashes.Push(((byte[])context.Script).ToScriptHash());
base.LoadContext(context);
}

public override void Dispose()
Expand Down
2 changes: 1 addition & 1 deletion neo/neo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
<PackageReference Include="Neo.VM" Version="3.0.0-CI00030" />
<PackageReference Include="Neo.VM" Version="3.0.0-CI00033" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.5.0" />
</ItemGroup>

Expand Down