diff --git a/lib/eth/abi/encoder.rb b/lib/eth/abi/encoder.rb index f2ee06d8..ca3792d7 100644 --- a/lib/eth/abi/encoder.rb +++ b/lib/eth/abi/encoder.rb @@ -285,13 +285,9 @@ def address(arg) # The ABI encoder needs to be able to determine between a hex `"123"` # and a binary `"123"` string. def handle_hex_string(arg, type) - if Util.prefixed? arg or - (arg.size === type.sub_type.to_i * 2 and Util.hex? arg) - + if (arg.size === type.sub_type.to_i * 2 and Util.hex? arg) # There is no way telling whether a string is hex or binary with certainty - # in Ruby. Therefore, we assume a `0x` prefix to indicate a hex string. - # Additionally, if the string size is exactly the double of the expected - # binary size, we can assume a hex value. + # in Ruby. Util.hex_to_bin arg else