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

chore: address some linter complaints #7734

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/apps/29-fee/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func KeyCounterpartyPayee(address, channelID string) []byte {
}

// ParseKeyCounterpartyPayee returns the registered relayer address and channelID used to store the counterparty payee address
func ParseKeyCounterpartyPayee(key string) (address string, channelID string, error error) {
func ParseKeyCounterpartyPayee(key string) (address string, channelID string, err error) {
keySplit := strings.Split(key, "/")
if len(keySplit) != 3 {
return "", "", errorsmod.Wrapf(
Expand Down
17 changes: 8 additions & 9 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ import (
ibcclienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"
ibcconnectiontypes "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types"
porttypes "github.com/cosmos/ibc-go/v9/modules/core/05-port/types"
"github.com/cosmos/ibc-go/v9/modules/core/exported"
ibcexported "github.com/cosmos/ibc-go/v9/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v9/modules/core/keeper"
solomachine "github.com/cosmos/ibc-go/v9/modules/light-clients/06-solomachine"
Expand Down Expand Up @@ -321,7 +320,7 @@ func NewSimApp(
// voteExtOp := func(bApp *baseapp.BaseApp) {
// voteExtHandler := NewVoteExtensionHandler()
// voteExtHandler.SetHandlers(bApp)
//}
// }
// baseAppOptions = append(baseAppOptions, voteExtOp, baseapp.SetOptimisticExecution(),
// baseapp.SetIncludeNestedMsgsGas([]sdk.Msg{&govv1.MsgSubmitProposal{}}))

Expand Down Expand Up @@ -539,7 +538,7 @@ func NewSimApp(
// IBC Fee Module keeper
app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(
appCodec,
runtime.NewEnvironment(runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), logger.With(log.ModuleKey, fmt.Sprintf("x/%s-%s", exported.ModuleName, ibcfeetypes.ModuleName))),
runtime.NewEnvironment(runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), logger.With(log.ModuleKey, fmt.Sprintf("x/%s-%s", ibcexported.ModuleName, ibcfeetypes.ModuleName))),
app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware
app.IBCKeeper.ChannelKeeper,
app.AuthKeeper, app.BankKeeper,
Expand Down Expand Up @@ -575,7 +574,7 @@ func NewSimApp(
// since fee middleware will wrap the IBCKeeper for underlying application.
app.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
runtime.NewEnvironment(runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]), logger.With(log.ModuleKey, fmt.Sprintf("x/%s-%s", exported.ModuleName, ibctransfertypes.ModuleName))),
runtime.NewEnvironment(runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]), logger.With(log.ModuleKey, fmt.Sprintf("x/%s-%s", ibcexported.ModuleName, ibctransfertypes.ModuleName))),
app.GetSubspace(ibctransfertypes.ModuleName),
app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware
app.IBCKeeper.ChannelKeeper,
Expand Down Expand Up @@ -959,8 +958,8 @@ func (app *SimApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) {
return app.ModuleManager.EndBlock(ctx)
}

func (a *SimApp) Configurator() module.Configurator { //nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1.
return a.configurator
func (app *SimApp) Configurator() module.Configurator { //nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1.
return app.configurator
}

// InitChainer application update at chain initialization
Expand Down Expand Up @@ -1017,8 +1016,8 @@ func (app *SimApp) AutoCliOpts() autocli.AppOptions {
}

// DefaultGenesis returns a default genesis from the registered AppModule's.
func (a *SimApp) DefaultGenesis() map[string]json.RawMessage {
return a.ModuleManager.DefaultGenesis()
func (app *SimApp) DefaultGenesis() map[string]json.RawMessage {
return app.ModuleManager.DefaultGenesis()
}

// GetKey returns the KVStoreKey for the provided store key.
Expand Down Expand Up @@ -1095,7 +1094,7 @@ func (app *SimApp) RegisterNodeService(clientCtx client.Context, cfg config.Conf

// ValidatorKeyProvider returns a function that generates a validator key
// Supported key types are those supported by Comet: ed25519, secp256k1, bls12-381
func (app *SimApp) ValidatorKeyProvider() runtime.KeyGenF {
func (*SimApp) ValidatorKeyProvider() runtime.KeyGenF {
return func() (cmtcrypto.PrivKey, error) {
return cmted25519.GenPrivKey(), nil
}
Expand Down
12 changes: 6 additions & 6 deletions testing/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func NewTestChainWithValSet(tb testing.TB, coord *Coordinator, chainID string, v
app := SetupWithGenesisValSet(tb, valSet, genAccs, chainID, sdk.DefaultPowerReduction, genBals...)

// create current header and call begin block
header := cmtproto.Header{
cmtHeader := cmtproto.Header{
ChainID: chainID,
Height: 1,
Time: coord.CurrentTime.UTC(),
Expand All @@ -152,7 +152,7 @@ func NewTestChainWithValSet(tb testing.TB, coord *Coordinator, chainID string, v
Coordinator: coord,
ChainID: chainID,
App: app,
ProposedHeader: header,
ProposedHeader: cmtHeader,
TxConfig: txConfig,
Codec: app.AppCodec(),
Vals: valSet,
Expand Down Expand Up @@ -579,7 +579,7 @@ func (chain *TestChain) DeleteKey(key []byte) {

// IBCClientHeader will construct a 07-tendermint Header to update the light client
// on the counterparty chain. The trustedHeight must be passed in as a non-zero height.
func (chain *TestChain) IBCClientHeader(header *ibctm.Header, trustedHeight clienttypes.Height) (*ibctm.Header, error) {
func (chain *TestChain) IBCClientHeader(ibcHeader *ibctm.Header, trustedHeight clienttypes.Height) (*ibctm.Header, error) {
if trustedHeight.IsZero() {
return nil, errorsmod.Wrap(ibctm.ErrInvalidHeaderHeight, "trustedHeight must be a non-zero height")
}
Expand All @@ -594,9 +594,9 @@ func (chain *TestChain) IBCClientHeader(header *ibctm.Header, trustedHeight clie
return nil, err
}

header.TrustedHeight = trustedHeight
ibcHeader.TrustedHeight = trustedHeight
trustedVals.TotalVotingPower = cmtTrustedVals.TotalVotingPower()
header.TrustedValidators = trustedVals
ibcHeader.TrustedValidators = trustedVals

return header, nil
return ibcHeader, nil
}
Loading