Generates a transaction based event similar to generateSubTxnEvent(long, long), but only considers data and error code of the main transaction.