From 6d4224ce2de5b01f3baa740f461621de8c5e020d Mon Sep 17 00:00:00 2001 From: Pino' Surace Date: Thu, 14 Nov 2024 17:17:39 +0100 Subject: [PATCH] Fix lint --- app/app.go | 2 +- cmd/wasmd/testnet.go | 4 +++- tests/e2e/ibc_fees_test.go | 1 + tests/ibctesting/chain.go | 2 +- tests/ibctesting/endpoint.go | 2 +- x/wasm/keeper/keeper.go | 4 +++- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/app.go b/app/app.go index 664917ee71..bb580dc324 100644 --- a/app/app.go +++ b/app/app.go @@ -322,7 +322,7 @@ func NewWasmApp( // baseAppOptions = append(baseAppOptions, prepareOpt) // create and set dummy vote extension handler - //voteExtOp := func(bApp *baseapp.BaseApp) { + // voteExtOp := func(bApp *baseapp.BaseApp) { // voteExtHandler := NewVoteExtensionHandler() // voteExtHandler.SetHandlers(bApp) //} diff --git a/cmd/wasmd/testnet.go b/cmd/wasmd/testnet.go index 6bfbf4d162..439605afd1 100644 --- a/cmd/wasmd/testnet.go +++ b/cmd/wasmd/testnet.go @@ -376,7 +376,9 @@ func initTestnetFiles( return err } - srvconfig.SetConfigTemplate(srvconfig.DefaultConfigTemplate) + if err := srvconfig.SetConfigTemplate(srvconfig.DefaultConfigTemplate); err != nil { + return err + } srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config", "app.toml"), appConfig) } diff --git a/tests/e2e/ibc_fees_test.go b/tests/e2e/ibc_fees_test.go index fd820e1b16..df4cdbb588 100644 --- a/tests/e2e/ibc_fees_test.go +++ b/tests/e2e/ibc_fees_test.go @@ -7,6 +7,7 @@ import ( "testing" "time" + wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" ibcfee "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types" ibctransfertypes "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" //nolint:staticcheck diff --git a/tests/ibctesting/chain.go b/tests/ibctesting/chain.go index 472a4ec366..9d67c56121 100644 --- a/tests/ibctesting/chain.go +++ b/tests/ibctesting/chain.go @@ -527,7 +527,7 @@ func CommitHeader(proposedHeader cmttypes.Header, valSet *cmttypes.ValidatorSet, // Thus we iterate over the ordered validator set and construct a signer array // from the signer map in the same order. signerArr := make([]cmttypes.PrivValidator, len(valSet.Validators)) - for i, v := range valSet.Validators { //nolint:staticcheck // need to check for nil validator set + for i, v := range valSet.Validators { signerArr[i] = signers[v.Address.String()] } diff --git a/tests/ibctesting/endpoint.go b/tests/ibctesting/endpoint.go index be3f56009f..c36528ae96 100644 --- a/tests/ibctesting/endpoint.go +++ b/tests/ibctesting/endpoint.go @@ -618,7 +618,7 @@ func (endpoint *Endpoint) ChanUpgradeInit() error { endpoint.Chain.SenderAccount.GetAddress().String(), endpoint.ChannelID, "upgrade-init", - fmt.Sprintf("gov proposal for initialising channel upgrade: %s", endpoint.ChannelID), + fmt.Sprintf("gov proposal for initializing channel upgrade: %s", endpoint.ChannelID), govtypesv1.ProposalType_PROPOSAL_TYPE_EXPEDITED, ) require.NoError(endpoint.Chain.TB, err) diff --git a/x/wasm/keeper/keeper.go b/x/wasm/keeper/keeper.go index 88762a7189..25bcbf8dff 100644 --- a/x/wasm/keeper/keeper.go +++ b/x/wasm/keeper/keeper.go @@ -270,7 +270,9 @@ func (k Keeper) instantiate( ctx, discount := k.checkDiscountEligibility(sdkCtx, codeInfo.CodeHash, k.IsPinnedCode(ctx, codeID)) setupCost := k.gasRegister.SetupContractCost(discount, len(initMsg)) - k.GasService.GasMeter(ctx).Consume(setupCost, "Loading CosmWasm module: instantiate") + if err := k.GasService.GasMeter(ctx).Consume(setupCost, "Loading CosmWasm module: instantiate"); err != nil { + return nil, nil, err + } if !authPolicy.CanInstantiateContract(codeInfo.InstantiateConfig, creator) { return nil, nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "can not instantiate")