-
Notifications
You must be signed in to change notification settings - Fork 90
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
app/eth2wrap: add lazy init #1760
Conversation
Codecov ReportBase: 54.76% // Head: 54.26% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1760 +/- ##
==========================================
- Coverage 54.76% 54.26% -0.51%
==========================================
Files 163 165 +2
Lines 20917 21660 +743
==========================================
+ Hits 11456 11753 +297
- Misses 7929 8357 +428
- Partials 1532 1550 +18
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
require.NoError(t, err) | ||
} | ||
|
||
func TestLazy(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also have a testcase in this test where we have 3 addresses with following testcases:
- All disabled.
- One enabled and two disabled
- Two enabled and one disabled
This can replace above TestOneDown
test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure this add a lot of value additional value, but you are welcome to add it if you want
func (l *lazy) Name() string { | ||
cl, err := l.getClient() | ||
if err != nil { | ||
return "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not return an error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implements the Client
interface which doesn't return an error, so we can't return an error
Wraps eth2clients in a "lazy loader", this allows charon to start even if one or more beacon nodes are down (as long as one is up and available).
category: feature
ticket: #1312