Skip to content

Commit

Permalink
Compare uint128 values using int instead of hex due to left zero padd…
Browse files Browse the repository at this point in the history
…ing differences.
  • Loading branch information
miohtama committed Nov 27, 2017
1 parent 75878c2 commit c199c08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ico/tests/contracts/test_kyc_payload_deserializing.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ def test_roundtrip_kyc_data(kyc_deserializer, whitelisted_address):
dataframe = pack_kyc_dataframe(whitelisted_address, customer_id, int(0.1 * 10000), int(9999 * 10000))
tuple_value = kyc_deserializer.call().getKYCPayload(dataframe)

#
# Check that the output looks like what we did expect
#

assert tuple_value[0].lower() == whitelisted_address.lower()
assert hex(tuple_value[1]) == "0x" + customer_id.hex
# Do a raw integer comparison, because web3.py and UUID disagree about left padding zeroes
assert tuple_value[1] == customer_id.int
assert tuple_value[2] == 1000
assert tuple_value[3] == 99990000

0 comments on commit c199c08

Please sign in to comment.