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

BEDS 1140/vali group #1300

Open
wants to merge 3 commits into
base: staging
Choose a base branch
from
Open

BEDS 1140/vali group #1300

wants to merge 3 commits into from

Conversation

LuccaBitfly
Copy link
Contributor

@LuccaBitfly LuccaBitfly commented Jan 28, 2025

  • if a validator was part of a dashboard and that dashboard had reached its limit, the validators group couldn't be changed when providing an index list
  • fixed by this PR

@LuccaBitfly LuccaBitfly force-pushed the BEDS-1140/vali-group branch 2 times, most recently from e580dfb to ff13a57 Compare January 29, 2025 08:52
- if a validator was part of a dashboard and that dashboard had reached its limit, the validators group couldn't be changed when providing an index list
- fixed by this commit

See: BEDS-1140
@@ -241,10 +241,10 @@ func ConstantTimeDelay(start time.Time, intendedMinWait time.Duration) {
}
}

func SliceToMap[T comparable](s []T) map[T]bool {
m := make(map[T]bool)
func SliceToMap[T comparable](s []T) map[T]struct{} {
Copy link
Contributor

Choose a reason for hiding this comment

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

@LuccaBitfly Please, write a unit test for this function

Copy link
Contributor

@sasha-bitfly sasha-bitfly Jan 29, 2025

Choose a reason for hiding this comment

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

@remoterami @LuccaBitfly
utils is the best file for us to start covering with the unit tests
especially I've seen places in a code where / 0 is possible

@@ -827,6 +827,21 @@ func (d *DataAccessService) AddValidatorDashboardValidators(ctx context.Context,
return result, nil
}

func (d *DataAccessService) GetValidatorDashboardValidatorsOfList(ctx context.Context, dashboardId t.VDBIdPrimary, validators []t.VDBValidator) ([]t.VDBValidator, error) {
var result []uint64
q := `SELECT DISTINCT uvdv.validator_index
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we wrap sql query in goqu?

@sasha-bitfly
Copy link
Contributor

sasha-bitfly commented Jan 29, 2025

Added minor comments, otherwise LGFM 👍

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