public void add(final TransactionSimulatorResult result, final MutableWorldState worldState) {
    Objects.requireNonNull(result, "TransactionSimulatorResult cannot be null");
    Objects.requireNonNull(worldState, "WorldState cannot be null");

    long gasUsedByTransaction = result.result().getEstimateGasUsedByTransaction();
    cumulativeGasUsed += gasUsedByTransaction;

    TransactionReceipt transactionReceipt =
        transactionReceiptFactory.create(
            result.transaction().getType(), result.result(), worldState, cumulativeGasUsed);

    List<Log> logs = transactionReceipt.getLogsList();
    transactionSimulatorResults.add(
        new TransactionSimulatorResultWithMetadata(
            result, transactionReceipt, cumulativeGasUsed, logs));
  }
Adds a new transaction simulation result, updating the cumulative gas used.

@param result the transaction simulation result
@param worldState the world state after the transaction
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/BlockCallSimulationResult.java