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

refactored elcontracts and avsregistry builders to use wire dependency injection #297

Closed
wants to merge 3 commits into from

Conversation

samlaf
Copy link
Collaborator

@samlaf samlaf commented Jul 14, 2024

See https://github.com/google/wire/tree/main
Overall thinking this could greatly simplify some of our code.
So far I've only refactored basic code to use this, so it feels useless.
But it will start paying off once we use it to update the chainio/clients/builder.go. That way we'll be able to add a bunch of different constructors, all automatically generated, for different use cases:

  • with privatekey signer vs remote signer
  • with or without metrics
  • with mocks
  • etc

What Changed?

Reviewer Checklist

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

@samlaf samlaf requested a review from shrimalmadhur July 14, 2024 07:04
@@ -13,8 +13,9 @@ help:
bindings: ## generates contract bindings
cd contracts && rm -rf bindings/* && ./generate-bindings.sh

mocks: ## generates mocks
generate: ## generates mocks and wire files
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need to couple these 2 generation? any particular reason or just to combine generation together?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there a way to separate go generated stuff? Right now if we run go generate it just looks for all the go:generate comments in the repo and executed all of them. Maybe there’s a way to tag the generate commands with subtask names and get go generate to filter on those?

@samlaf
Copy link
Collaborator Author

samlaf commented Sep 24, 2024

Closing as no longer needed. Feels like not enough leverage for the kind of work/refactor needed to push this across the codebase right now.

@samlaf samlaf closed this Sep 24, 2024
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.

2 participants