replayTx method

Future<List<Map>> replayTx(
  1. String txId
)

Use the emulate function to replay the tx softly (for debug) Usually when you replay the tx to see what's wrong.

Implementation

Future<List<Map>> replayTx(String txId) async {
  Map tx = await getTransaction(txId);
  var caller = tx["origin"];
  var targetBlock = tx["meta"]["blockID"];
  var emulateBody = calcEmulateTxBody(caller, tx);
  if (tx["delegator"] != null) {
    emulateBody["gasPayer"] = tx["delegator"];
  }

  return emulate(emulateBody, block: targetBlock);
}