- Write the canonical hash of the originating transaction to the output buffer.
- If flags = 1 and the transaction is an EMIT_FAILURE transaction then write the canonical hash of the originating transaction that caused the emission.
int64_t otxn_id ( uint32_t write_ptr, uint32_t write_len, uint32_t flags );
uint8_t txn_id; int64_t bytes_written = otxn_id(txn_id, 32, 0);
|write_ptr||uint32_t||Pointer to a buffer of to store the hash.|
|write_len||uint32_t||Length of the output buffer. Should be at least 32 bytes.|
Write the canonical hash of the originating transaction.
Write the canonical hash of the emitting transaction.
|int64_t||The number of bytes written|
If negative, an error:
- pointers/lengths specified outside of hook memory.
- output buffer was not large enough to hold the serialized object