suggestGasForTx function

int suggestGasForTx(
  1. int vmGas,
  2. Map txBody
)

Calculate the suggested gas for a transaction

Implementation

int suggestGasForTx(int vmGas, Map txBody) {
  Transaction tx = Transaction.fromJsonString(json.encode(txBody));
  var intrincisGas = tx.getIntrinsicGas();
  var supposedSafeGas = calcGas(vmGas, intrincisGas);
  return supposedSafeGas;
}