loadTransactionComputePhase function

TransactionComputePhase loadTransactionComputePhase(
  1. Slice slice
)

Implementation

TransactionComputePhase loadTransactionComputePhase(Slice slice) {
  // Skipped
  if (slice.loadBool() == false) {
    var reason = loadComputeSkipReason(slice);

    return TcpSkipped(reason: reason);
  }

  var success = slice.loadBool();
  var messageStateUsed = slice.loadBool();
  var accountActivated = slice.loadBool();
  var gasFees = slice.loadCoins();

  final vmState = slice.loadRef().beginParse();
  var gasUsed = vmState.loadVarUintBig(3);
  var gasLimit = vmState.loadVarUintBig(3);
  var gasCredit = vmState.loadBool() == true ? vmState.loadVarUintBig(2) : null;

  var mode = vmState.loadUint(8);
  var exitCode = vmState.loadUint(32);
  var exitArg = vmState.loadBool() == true ? vmState.loadInt(32) : null;

  var vmSteps = vmState.loadUint(32);
  var vmInitStateHash = vmState.loadUintBig(256);
  var vmFinalStateHash = vmState.loadUintBig(256);

  return TcpVm(
    success: success,
    messageStateUsed: messageStateUsed,
    accountActivated: accountActivated,
    gasFees: gasFees,
    gasUsed: gasUsed,
    gasLimit: gasLimit,
    gasCredit: gasCredit,
    mode: mode,
    exitCode: exitCode,
    exitArg: exitArg,
    vmSteps: vmSteps,
    vmInitStateHash: vmInitStateHash,
    vmFinalStateHash: vmFinalStateHash,
  );
}