accept
Concepts
Section titled “Concepts”Behaviour
Section titled “Behaviour”End the execution of the hook with status: success.
- Record a return string and return code in transaction metadata.
- Commit all state changes.
- Submit all
emit()
transactions. - Allow originating transaction to continue.
Definition
Section titled “Definition”int64_t accept ( uint32_t read_ptr, uint32_t read_len, uint64_t error_code);
function accept(msg: string, code: number): number
Example
Section titled “Example”accept("Success", 7, 100);
accept('Success', 100)
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
read_ptr | uint32_t | Pointer to a return string to be stored in execution metadata. |
read_len | uint32_t | The length of the return string. At most 32. May be null. |
error_code | uint64_t | A return code specific to this hook to be stored in execution metadata. |
Name | Type | Description |
---|---|---|
msg | string | String to be stored in execution metadata. |
code | number | A return code specific to this hook to be stored in execution metadata. |
Return Code
Section titled “Return Code”Type | Description |
---|---|
int64_t | Accept ends the hook, therefore no value is returned to the caller. By convention all Hook APIs return int64_t , but in this case nothing is returned. |
Type | Description |
---|---|
number | Accept ends the hook, therefore no value is returned to the caller. By convention all Hook APIs return a number , but in this case nothing is returned. |