Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix return value is the function signature #174

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lib/abi/type_decoder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,16 @@ defmodule ABI.TypeDecoder do

def decode(encoded_data, %FunctionSelector{returns: types, method_id: method_id}, :output)
when is_binary(method_id) do
case ABI.Util.split_method_id(encoded_data) do
{:ok, ^method_id, rest} -> decode_raw(rest, types)
_ -> decode_raw(encoded_data, types)
if rem(byte_size(encoded_data), 32) == 0 do
decode_raw(encoded_data, types)
else
case ABI.Util.split_method_id(encoded_data) do
{:ok, ^method_id, rest} ->
decode_raw(rest, types)
Comment on lines +158 to +159
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually have never seen the output of a call to include the method id. Is this even needed?

Copy link
Contributor Author

@steffenix steffenix Sep 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the split method id can be removed yes, I thought you added It for a reason but if not it can be removed.


_ ->
decode_raw(encoded_data, types)
end
end
end

Expand Down
Loading