-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
lite2: modify TrustedValidatorSet func to return height #4473
Comments
@cmwaters what do you think? |
Anyway, this functionality is only useful if we want to know the latest validator set height (else we already have the height saved as input). Can't we just call |
We can, but then the user will be forced to do latestHeight, err := c.LastTrustedHeight()
if err != nil {
return nil, err
}
if latestHeight == -1 {
return nil, errors.New("no headers exist")
}
if height > latestHeight {
return nil, errors.Errorf("unverified header requested (latest: %d)", latestHeight)
}
if height == 0 {
height = latestHeight
} by herself. Don't you think it's bad? |
If we're going to allow 0 height as an argument, returning height as a second param seems reasonable.
The text was updated successfully, but these errors were encountered: