We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This code section
quicksilver/x/interchainstaking/keeper/abci.go
Lines 50 to 73 in a24dc70
could be improved by following https://cyber.orijtech.com/scsec/cosmos-go-coding-guide#reduce-code-nesting-with-early-returns-and-inversions
connection, found := k.IBCKeeper.ConnectionKeeper.GetConnection(ctx, zone.ConnectionId) if !found { return false } consState, found := k.IBCKeeper.ClientKeeper.GetLatestClientConsensusState(ctx, connection.GetClientID()) if !found { return false } tmConsState, ok := consState.(*tmtypes.ConsensusState) if !ok { return false } changedValSet := len(zone.IbcNextValidatorsHash) == 0 || !bytes.Equal(zone.IbcNextValidatorsHash, tmConsState.NextValidatorsHash.Bytes()) if !changedValSet { return false } k.Logger(ctx).Info("IBC ValSet has changed; requerying valset") // trigger valset update. period := int64(k.GetParam(ctx, types.KeyValidatorSetInterval)) query := stakingTypes.QueryValidatorsRequest{} err := k.EmitValSetQuery(ctx, zone.ConnectionId, zone.ChainId, query, sdkmath.NewInt(period)) if err != nil { k.Logger(ctx).Error("unable to trigger valset update query", "error", err.Error()) // failing to emit the valset update is not terminal but constitutes // an error, as if this starts happening frequent it is something // we should investigate. } zone.IbcNextValidatorsHash = tmConsState.NextValidatorsHash.Bytes() k.SetZone(ctx, zone)
/cc @elias-orijtech @joe-bowman
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Summary of Bug
This code section
quicksilver/x/interchainstaking/keeper/abci.go
Lines 50 to 73 in a24dc70
could be improved by following https://cyber.orijtech.com/scsec/cosmos-go-coding-guide#reduce-code-nesting-with-early-returns-and-inversions
Expected Behaviour
/cc @elias-orijtech @joe-bowman
For Admin Use
The text was updated successfully, but these errors were encountered: