Comparator
A library to compare structs. BCS uses little-endian encoding for all integer types, so results might be unexpected.
Result
inner - It will hold one of the following values: {SMALLER}, {EQUAL} or {GREATER}.
Interface
eq
It checks if the result
of {compare} is EQUAL
.
@param result: This struct contains one of the following values: {SMALLER}, {EQUAL} or {GREATER}.
@return bool. True if it is
EQUAL
lt
It checks if the result
of {compare} is SMALLER
.
@param result: This struct contains one of the following values: {SMALLER}, {EQUAL} or {GREATER}.
@return bool. True if it is
SMALLER
gt
It checks if the result
of {compare} is GREATER
.
@param result: This struct contains one of the following values: {SMALLER}, {EQUAL} or {GREATER}.
@return bool. True if it is
GREATER
lte
It checks if the result
of {compare} is SMALLER
or EQUAL
.
@param result: This struct contains one of the following values: {SMALLER}, {EQUAL} or {GREATER}.
@return bool. True if it is
SMALLER
orEQUAL
.
gte
It checks if the result
of {compare} is SMALLER
or EQUAL
.
@param result: This struct contains one of the following values: {SMALLER}, {EQUAL} or {GREATER}.
@return bool. True if it is
SMALLER
orEQUAL
.
compare
Compares two structs of type T
. Performs a comparison of two types after BCS serialization.
@param left: A struct of type
T
.@param right: A struct of type
T
.@return Result. A struct that contains the following values: {SMALLER}, {EQUAL} or {GREATER}.
compare_u8_vector
Compares two bytes.
@param left: A set of bytes.
@param right: A set of bytes.
@return Result. A struct that contains the following values: {SMALLER}, {EQUAL} or {GREATER}.
Last updated