Skip to content

ChainID method in HttpBackend and WsBackend interfaces - #359

Open
pablodeymo wants to merge 3 commits into
devfrom
chainID_in_interface
Open

ChainID method in HttpBackend and WsBackend interfaces#359
pablodeymo wants to merge 3 commits into
devfrom
chainID_in_interface

Conversation

@pablodeymo

Copy link
Copy Markdown
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

samlaf commented Sep 28, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

samlaf commented Sep 30, 2024

Copy link
Copy Markdown
Contributor

@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.

3 participants