public InvocationResult(byte[] executedScript, EVMState resultingState, ulong gasCost, object[] executionResult) { ExecutedScript = executedScript; ResultingState = resultingState; GasCost = gasCost; ExecutionResult = executionResult; }
private void ONVMStateChanged(VMBase closedVM, EVMState curState) { if (!curState.Equals(EVMState.Deactive)) { return; } StartCloseVM(null); }
/// <summary> /// Do not call this manually, instead call ActivateUI() /// </summary> public void Activate() { _canvas.enabled = true; _deactivationController.StopDeactivationListening(); VMState = EVMState.Active; OnActivateCustomActions(); }
private void OnVMStateChanged(EVMState state) { if (state.Equals(EVMState.Active)) { OnIntroTriggered?.Invoke(); } else { OnOutroTriggered?.Invoke(); } }
public override bool IncreaseGas(ulong gas) { _gasConsumed = checked (_gasConsumed + gas); if (_gasConsumed > _gasAmount) { _state = EVMState.FaultByGas; return(false); } return(true); }
private void OnVMStateChanged(EVMState state) { switch (state) { case EVMState.Active: RegisterEvents(); break; case EVMState.Deactive: UnregisterEvents(); break; } }
public ApplicationEngine(ExecutionEngineArgs args) : base(args) { _isDisposed = false; _gasConsumed = _gasAmount = 0; _state = EVMState.None; _scriptTable = new List <byte[]>(); _contractScriptTable = new ContractScriptTable(args.ScriptTable); _engine = new ExecutionEngine( new ScriptContainerWrapper(args.MessageProvider), _crypto, _contractScriptTable, new InteropServiceAdapter(this, args.InteropService)); _resultStack = new StackWrapper(_engine.ResultStack); _invocationStack = new StackExecutionContextWrapper(_engine.InvocationStack); }
public override void StepInto() { try { // Log if (Logger.Verbosity.HasFlag(ELogVerbosity.StepInto)) { Logger.RaiseOnStepInto(CurrentContext); } // Pre checks var nextOpCode = _engine.CurrentContext.InstructionPointer >= _engine.CurrentContext.Script.Length ? OpCode.RET : _engine.CurrentContext.NextInstruction; if (!PreStepInto(nextOpCode)) { _state = EVMState.Fault; return; } // Execute _engine.StepInto(); _state = (EVMState)(_engine.State & ~VMState.BREAK); // Post check if (_state != EVMState.None) { return; } if (!PostStepInto(nextOpCode)) { _state = EVMState.Fault; return; } } catch { // Error _state = EVMState.Fault; } }
public override void Clean(uint iteration = 0) { _gasConsumed = _gasAmount = 0; _state = EVMState.None; }
/// <summary> /// Do not call this manually, instead call DeactivateUI() /// </summary> public void Deactivate() { _deactivationController.ListenOutroAnimsTriggeredByVM(OnVMStateChanged, OnOutroAnimsFinished); VMState = EVMState.Deactive; }