2021-05-3 - Breaking API and behaviour changes
over 3 years ago by Richard Holland
Hooks testnet build 0a1cb3f175414a5a7bb1b6b4c4646c04
API Changes
emit
now takes awrite_ptr
andwrite_len
parameter pair at the start of the paramaters. This must be at least 32 bytes and will be populated with the canonical hash of the emitted transaction.hook
andcbak
now take auint32_t
as the sole parameter. Incbak
this is1
when the emitted txn has failed to be accepted beforesfLastLedgerSeq
when0
the emitted txn was accepted.
Behaviour Changes
- Emitted transactions that are successfully passed to
emit
but subsequently fail to be incorporated into a ledger beforesfLastLedgerSequence
expires are now cleaned up by attEMIT_FAILURE
pseudotransaction. ttEMIT_FAILURE
also triggerscbak(1)
on the emitting hook. Note the previously reserved parameter to callback is now used to signal that an emitted transaction failed.0
= success1
= failure.- Maximum number of emitted transactions in a chain of emitted transactions (i.e. where one emitted txn emits another txn) is now 10.
sfLastLedgerSeq
for emitted transactions must be 5 more than the current ledger.