-
Notifications
You must be signed in to change notification settings - Fork 12
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
refactor(dashboard): added unit tests for dashboard helpers #1309
refactor(dashboard): added unit tests for dashboard helpers #1309
Conversation
59a3c87
to
3e13c77
Compare
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 is moving in a very nice direction, nice work! Still have a few comments, pls have a look.
cf5f0d8
to
3e13c77
Compare
Deploying beaconchain with
|
Latest commit: |
a3d29e2
|
Status: | ✅ Deploy successful! |
Preview URL: | https://23a89c26.beaconchain.pages.dev |
Branch Preview URL: | https://beds-1006-unit-tests-for-das.beaconchain.pages.dev |
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.
lgtm!
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.
Generally think we need to add a lot more comments, but think that this is moving things in the right direction!
func (d *DataAccessService) getEpochStart(ctx context.Context, period enums.TimePeriod) (uint64, error) { | ||
clickhouseTable, _, err := d.getTablesForPeriod(period) | ||
if err != nil { | ||
return 0, err | ||
} | ||
|
||
ds := buildEpochStartQuery(clickhouseTable) | ||
epochStart, err := getContext[uint64](ctx, d.clickhouseReader, ds) | ||
if err != nil { | ||
return 0, err | ||
} | ||
|
||
return epochStart, nil | ||
} |
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.
Don't we have this defined somewhere already as a general purpose query?
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.
We don't have general function for getting epoch start.
We need to make one during refactoring and include more fields: e.g. epoch_start
, epoch_end
, etc
a3d29e2
to
628371b
Compare
628371b
to
9558234
Compare
Before we cover functions like
GetValidatorDashboardSummary
orGetValidatorDashboardGroupSummary
with unit tests we need to cleanup and refactor a codebase.Helper functions to be moved to
vdb_helpers.go
to avoid mess invdb_dashboard.go
Every function is split into build query, execute query, process results
Generic
executeQuery
function is added