Module-level declarations

Types

Link copied to clipboard

Return value of priority_check_v1 query. It is used to represent how to prioritize a transaction: if multiple transactions are in queue, the one with the highest priority value will be executed first.

Functions

Link copied to clipboard

An "empty" priority state, which does not point to an account, but has a priority value. no_account_priority_state(0.0) is equivalent to no_op_priority_state()

Link copied to clipboard

An "empty" priority state, which represents the lowest priority, with no account information. The default value returned as priority when priority_check is left with no extension, or the extension does not return.

Link copied to clipboard
@extendable function priority_check(tx_body: gtx_transaction_body, tx_size: integer, tx_enter_timestamp: integer, current_timestamp: integer): priority_state_v1?

Extendable function that allows to define custom prioritization strategies. If unimplemented, it will return no_op_priority_state(), which means everything will have a priority of zero.

If this function throws, it will be interpreted as a value of no_op_priority_state() as well

Throws if any extension of this function throws.

Queries

Link copied to clipboard
@mount("gtx_api.priority_check_v1") query priority_check_v1(tx_body: gtx_transaction_body, tx_size: integer, tx_enter_timestamp: integer, current_timestamp: integer): priority_state_v1

This query is used by Postchain. It will be called for every transaction, and the result will be used to determine the transaction priority.

This is not an actual implementation, it simply calls priority_check to allow the implementation of this query to be defined by the end user.

Throws if the implementation defined in priority_check throws.