Module comparator.move
This module exposes functions that can be used to compare the BCS serialization of various datatypes.
Function: compare
This function can be used to compare (lexicographically) the BCS serialization of two objects of the same type. The returned Result
object can be read using the is_equal
, is_smaller_than
, and is_greater_than
functions.
Inputs
Type
T
Validation: None required.
Impact: Type of the objects to compare.
left: &T
Validation: None required.
Impact: First object to compare.
right: &T
Validation: None required.
Impact: Second object to compare.
Function: compare_u8_vector
This function can be used to compare two byte vectors directly. The returned Result
object can be read using the is_equal
, is_smaller_than
, and is_greater_than
functions.
Inputs
left: vector<u8>
Validation: None required.
Impact: First vector to compare.
right: vector<u8>
Validation: None required.
Impact: Second vector to compare.