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

feat - validator redirects #5

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

olegshmuelov
Copy link

No description provided.

@olegshmuelov olegshmuelov marked this pull request as ready for review January 15, 2025 16:42
@olegshmuelov olegshmuelov self-assigned this Jan 15, 2025
Comment on lines +100 to 117
// Check for duplicate keys in OwnerRedirects.
ownerSeen := make(map[string]struct{}) // Separate map for OwnerRedirects
for from := range mechanics.OwnerRedirects {
if _, exists := ownerSeen[from.String()]; exists {
return fmt.Errorf("duplicate owner redirect key: %s", from.String())
}
ownerSeen[from.String()] = struct{}{}
}

// Check for duplicate keys in ValidatorRedirects.
validatorSeen := make(map[string]struct{}) // Separate map for ValidatorRedirects
for from := range mechanics.ValidatorRedirects {
if _, exists := validatorSeen[from.String()]; exists {
return fmt.Errorf("duplicate validator redirect key: %s", from.String())
}
validatorSeen[from.String()] = struct{}{}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

these checks will always pass as they're checking duplicate keys in a map (impossible)

i think the duplicate check can be in the load from CSV (where duplicates are possible)

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