Skip to content

Commit

Permalink
chore: address some linter complaints (#7734)
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan authored Dec 18, 2024
1 parent 6cd1b8f commit 83fdb7f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
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
}

0 comments on commit 83fdb7f

Please sign in to comment.