exthereum / abi

The Ethereum ABI Interface
MIT License
20 stars 22 forks source link

Address type as string, not :uint 160 #15

Closed progsmile closed 6 years ago

progsmile commented 6 years ago

Hi there! Thanks for library! We've faced issue that :address type is converted to uint 160 and it throws message: Data overflow encoding uint, data0x56e19818ba7e4c0335a4cbf82ee6530c89a30735cannot fit in 160 bits It happens here: lib/quorum/abi/type_encoder.ex:239: Quorum.ABI.TypeEncoder.encode_uint/2 Actually we are using quorum, so it may be connected somehow with this bug.. So, we need not to convert address to uint

Now it's solved with converting address to int, but result data generates incorrectly

{address_hex, _} = Integer.parse(address, 16)
address_hex
progsmile commented 6 years ago

Solved with this implementation defp encode_type(:address, [data | rest]), do: {data, rest}