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

ChainID method in HttpBackend and WsBackend interfaces #359

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

pablodeymo
Copy link
Contributor

For the point of view of the user of the SDK, it's better to have the ChainID method in HttpBackend and WsBackend interfaces.

The idea behind instrumentedClient is to wrap a Eth Client, so the user can use both clients the same way.
However, there are some methods missing from the common interfaces.

It would be good to review if there are other methods missing on that interfaces, for future PRs.

What Changed?

Reviewer Checklist

  • Code is well-documented
  • Code adheres to Go naming conventions
  • Code deprecates any old functionality before removing it

@samlaf
Copy link
Collaborator

samlaf commented Sep 28, 2024

Hey @pablodeymo , if chainid is not used anywhere, why add it? I prefer keeping interfaces to only what is needed, not bloating them just in case.

@pablodeymo
Copy link
Contributor Author

Hey @pablodeymo , if chainid is not used anywhere, why add it? I prefer keeping interfaces to only what is needed, not bloating them just in case.

This method is used in the Incredible Squaring example (here). Since its removal, it's difficult to have optionally-enabled metrics since restricting the type to the xxBackend interface would also restrict the functionality unnecessarily.

@samlaf
Copy link
Collaborator

samlaf commented Sep 30, 2024

@pablodeymo I see. I guess it’s fine to add, but this makes me think we haven’t found the right abstractions yes :/
Perhaps inc-sq should define the interface it needs in this case. Since we return structs in the constructors everything should work.

@pablodeymo pablodeymo requested a review from afkbyte October 2, 2024 15:39
@pablodeymo pablodeymo added the v0.2 new dev version label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.2 new dev version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants