/// <summary>
        /// Creates a new result for a failed state transition due to a VM exception.
        /// </summary>
        public static StateTransitionResult Fail(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)));
        }
Пример #2
0
 private VmExecutionResult(VmExecutionError error)
 {
     this.IsSuccess = false;
     this.Error     = error;
 }