Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new result for a failed state transition due to a VM exception.
        /// </summary>
        public static StateTransitionResult Fail(RuntimeObserver.Gas gasConsumed, VmExecutionError vmError)
        {
            // If VM execution ran out of gas we return a different kind of state transition error.
            StateTransitionErrorKind errorKind = vmError.ErrorKind == VmExecutionErrorKind.OutOfGas
                        ? StateTransitionErrorKind.OutOfGas
                        : StateTransitionErrorKind.VmError;

            return(new StateTransitionResult(new StateTransitionError(gasConsumed, errorKind, vmError.Message)));
        }
Ejemplo n.º 2
0
 private VmExecutionResult(VmExecutionError error)
 {
     this.IsSuccess = false;
     this.Error     = error;
 }