Execution Metadata

What to expect when your Hook runs.

Metadata

When Hooks execute they leave behind information about the status of that execution. This appears in the Originating Transaction metadata as an sfHookExecutions block. This block contains the following fields:

FieldDescription
sfHookResultHooks can end in three ways: accept, rollback and error.
This is not the same as sfHookReturnCode!
sfHookHashThe SHA512H of the Hook at the time it was executed.
sfHookAccountThe account the Hook ran on.
sfHookReturnCodeThe integer returned as the third parameter of accept or rollback.
sfHookReturnStringThe string returned in the first two parameters of accept or rollback, if any.
sfHookInstructionCountThe total number of webassembly instructions that were executed when the Hook ran.
sfHookEmitCountThe total number of Emitted Transactions produced by the Hook.
sfHookExecutionIndexThe order in which the Hook was executed (as distinct from other Hook Executions on the same Originating Transaction.)
sfHookStateChangeCountThe number of Hook State changes the Hook made during execution.

What’s Next