Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

NeoVM Runtime Versioning #475

Closed
wants to merge 4 commits into from
Closed
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
9 changes: 8 additions & 1 deletion src/Neo.VM/ExecutionEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public class ExecutionEngine : IDisposable
private VMState state = VMState.BREAK;
private bool isJumping = false;

/// <summary>
/// Indicates which version of the runtime this <see cref="ExecutionEngine"/> is using.
/// </summary>
public RuntimeVersion RuntimeVersion { get; }

/// <summary>
/// Restrictions on the VM.
/// </summary>
Expand Down Expand Up @@ -93,8 +98,10 @@ public ExecutionEngine() : this(new ReferenceCounter(), ExecutionEngineLimits.De
/// </summary>
/// <param name="referenceCounter">The reference counter to be used.</param>
/// <param name="limits">Restrictions on the VM.</param>
protected ExecutionEngine(ReferenceCounter referenceCounter, ExecutionEngineLimits limits)
/// <param name="version">Indicates which version of the runtime this <see cref="ExecutionEngine"/> should use.</param>
protected ExecutionEngine(ReferenceCounter referenceCounter, ExecutionEngineLimits limits, RuntimeVersion version = RuntimeVersion.Latest)
{
this.RuntimeVersion = version;
this.Limits = limits;
this.ReferenceCounter = referenceCounter;
this.ResultStack = new EvaluationStack(referenceCounter);
Expand Down
16 changes: 16 additions & 0 deletions src/Neo.VM/RuntimeVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (C) 2016-2022 The Neo Project.
//
// The neo-vm is free software distributed under the MIT software license,
// see the accompanying file LICENSE in the main directory of the
// project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

namespace Neo.VM;

public enum RuntimeVersion : byte
{
Latest
}