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 input type to allow function selector decoding #101

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

antonydenyer
Copy link
Contributor

@antonydenyer antonydenyer commented Jan 5, 2024

Add a new type input to allow new methods to be added for input type data.

Added FunctionSelector function to return the first 4 bytes of the input if present.

Future work could include things like FunctionArgs etc.

@antonydenyer antonydenyer marked this pull request as ready for review January 5, 2024 10:31
@antonydenyer antonydenyer requested a review from nthpool January 5, 2024 10:31
@Kriys94
Copy link

Kriys94 commented Jan 8, 2024

Could you give a description about the purpose of this PR?

Copy link
Contributor

@nthpool nthpool left a comment

Choose a reason for hiding this comment

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

since it looks like this library is used by several different infura repos my preference would be to go with a less intrusive change.

we could add FunctionSelector to one of the existing data types or keep it in TLM.

eth/input.go Outdated Show resolved Hide resolved
eth/transaction.go Show resolved Hide resolved
Could be any size

Co-authored-by: Nicolas Hewitt <[email protected]>
@antonydenyer
Copy link
Contributor Author

since it looks like this library is used by several different infura repos my preference would be to go with a less intrusive change.

we could add FunctionSelector to one of the existing data types or keep it in TLM.

When someone updates the package the changes should be minimal ™️ - either change the type or cast to Data.

Copy link
Contributor

@ryanschneider ryanschneider left a comment

Choose a reason for hiding this comment

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

While my initial thoughts align w/ @nthpool that we could make this a method on say Data instead of introducing a new type, I'm not fully opposed to introducing the new type if necessary.

@antonydenyer
Copy link
Contributor Author

In TLM, we were extending the type anyway. It felt odd having some in there and some in here. Going to merge.

@antonydenyer antonydenyer merged commit 8a2a672 into master Jan 17, 2024
1 check passed
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.

4 participants