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

Add nameless decode to BaseContract #2355

Merged
merged 2 commits into from Apr 27, 2023
Merged

Conversation

halo3mic
Copy link
Contributor

Motivation

BaseContract provides various methods for decoding input data: decode, decode_raw, decode_with_selector and decode_with_selector_raw.
These methods take a method name as an argument, which could be omitted as it is already provided through input-data.

Solution

Add new methods that decode input-data without requiring method-name as a parameter - decode_input_raw and decode_input.

Existing decode methods (decode, decode_raw, decode_with_selector and decode_with_selector_raw) lose functionality with the introduction of nameless decode methods. They could be removed unless I missed a viable utility or should be left in for backward compatibility.

PR Checklist

  • Added nameless decode methods to BaseContract
  • Add test
  • Remove existing decode methods?

@prestwich
Copy link
Collaborator

needs formatting with cargo +nightly fmt

Copy link
Collaborator

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

concept ACK. See comment re rustfmt

Copy link
Collaborator

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

examples failure is unrelated

@prestwich prestwich merged commit 93236fb into gakonst:master Apr 27, 2023
13 of 14 checks passed
@halo3mic halo3mic deleted the nameless_decode branch May 29, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants