loadComputeSkipReason function

ComputeSkipReason loadComputeSkipReason(
  1. Slice slice
)

Throws 'Unknown ComputeSkipReason...' if it's not one of: CsrNoState, CsrBadState, CsrNoGas

Implementation

ComputeSkipReason loadComputeSkipReason(Slice slice) {
  var reason = slice.loadUint(2);
  switch (reason) {
    case ComputeSkipReason.noState:
      return CsrNoState();

    case ComputeSkipReason.badState:
      return CsrBadState();

    case ComputeSkipReason.noGas:
      return CsrNoGas();

    case _:
      throw 'Unknown ComputeSkipReason $reason';
  }
}