예제 #1
0
def get_order_flags(salt, isBuy, limitFee):
    salt_string = utils.strip_hex_prefix(hex(salt))[-63:]
    salt_int = 0
    salt_int += 1 if isBuy else 0
    salt_int += 4 if (limitFee < 0) else 0
    salt_string += str(salt_int)
    return '0x' + salt_string.rjust(64, '0')
예제 #2
0
 def test_util_strip_hex_prefix(self):
     assert (
         utils.strip_hex_prefix(ADDRESS_1_NO_PREFIX) == ADDRESS_1_NO_PREFIX
     )  # noqa: E501
     assert utils.strip_hex_prefix(ADDRESS_1) == ADDRESS_1_NO_PREFIX