diff --git a/.golangci.yml b/.golangci.yml index adf13239c..d564df572 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -33,6 +33,10 @@ issues: max-same-issues: 10000 linters-settings: + gofumpt: + # Choose whether to use the extra rules. + # Default: false + extra-rules: true nolintlint: allow-unused: false allow-leading-space: true diff --git a/wasmbinding/message_plugin.go b/wasmbinding/message_plugin.go index 066a9e56f..d3d49c778 100644 --- a/wasmbinding/message_plugin.go +++ b/wasmbinding/message_plugin.go @@ -588,7 +588,7 @@ func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk } // GetFullDenom is a function, not method, so the message_plugin can use it -func GetFullDenom(contract string, subDenom string) (string, error) { +func GetFullDenom(contract, subDenom string) (string, error) { // Address validation if _, err := parseAddress(contract); err != nil { return "", err diff --git a/wasmbinding/test/custom_query_test.go b/wasmbinding/test/custom_query_test.go index 4313cdf31..e30002674 100644 --- a/wasmbinding/test/custom_query_test.go +++ b/wasmbinding/test/custom_query_test.go @@ -286,7 +286,7 @@ type ChainResponse struct { Data []byte `json:"data"` } -func (suite *CustomQuerierTestSuite) queryCustom(ctx sdk.Context, contract sdk.AccAddress, request interface{}, response interface{}) error { +func (suite *CustomQuerierTestSuite) queryCustom(ctx sdk.Context, contract sdk.AccAddress, request, response interface{}) error { msgBz, err := json.Marshal(request) suite.Require().NoError(err) diff --git a/x/contractmanager/keeper/failure.go b/x/contractmanager/keeper/failure.go index ab8083ef3..bf00afa66 100644 --- a/x/contractmanager/keeper/failure.go +++ b/x/contractmanager/keeper/failure.go @@ -8,7 +8,7 @@ import ( ) // AddContractFailure adds a specific failure to the store using address as the key -func (k Keeper) AddContractFailure(ctx sdk.Context, channelID string, address string, ackID uint64, ackType string) { +func (k Keeper) AddContractFailure(ctx sdk.Context, channelID, address string, ackID uint64, ackType string) { failure := types.Failure{ ChannelId: channelID, Address: address, diff --git a/x/contractmanager/keeper/failure_test.go b/x/contractmanager/keeper/failure_test.go index e7ad43843..7ef9c33d2 100644 --- a/x/contractmanager/keeper/failure_test.go +++ b/x/contractmanager/keeper/failure_test.go @@ -18,7 +18,7 @@ import ( // Prevent strconv unused error var _ = strconv.IntSize -func createNFailure(keeper *keeper.Keeper, ctx sdk.Context, addresses int, failures int) [][]types.Failure { +func createNFailure(keeper *keeper.Keeper, ctx sdk.Context, addresses, failures int) [][]types.Failure { pubBz := make([]byte, ed25519.PubKeySize) pub := &ed25519.PubKey{Key: pubBz} diff --git a/x/contractmanager/keeper/grpc_query_failure.go b/x/contractmanager/keeper/grpc_query_failure.go index 9ae454e50..87df124fb 100644 --- a/x/contractmanager/keeper/grpc_query_failure.go +++ b/x/contractmanager/keeper/grpc_query_failure.go @@ -43,7 +43,7 @@ func (k Keeper) AddressFailures(c context.Context, req *types.QueryFailuresReque failureStore = prefix.NewStore(store, types.ContractFailuresKey) } - pageRes, err := query.Paginate(failureStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(failureStore, req.Pagination, func(key, value []byte) error { var failure types.Failure if err := k.cdc.Unmarshal(value, &failure); err != nil { return err diff --git a/x/cron/keeper/grpc_query_schedule.go b/x/cron/keeper/grpc_query_schedule.go index 46bf14fe5..9ad8e6ef9 100644 --- a/x/cron/keeper/grpc_query_schedule.go +++ b/x/cron/keeper/grpc_query_schedule.go @@ -21,7 +21,7 @@ func (k Keeper) Schedules(c context.Context, req *types.QuerySchedulesRequest) ( scheduleStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.ScheduleKey) - pageRes, err := query.Paginate(scheduleStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(scheduleStore, req.Pagination, func(key, value []byte) error { var schedule types.Schedule k.cdc.MustUnmarshal(value, &schedule) diff --git a/x/feeburner/types/expected_keepers.go b/x/feeburner/types/expected_keepers.go index 5ea4387a0..90f07a68b 100644 --- a/x/feeburner/types/expected_keepers.go +++ b/x/feeburner/types/expected_keepers.go @@ -14,7 +14,7 @@ type AccountKeeper interface { type BankKeeper interface { GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + SendCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error // Methods imported from bank should be defined here } diff --git a/x/feerefunder/keeper/keeper.go b/x/feerefunder/keeper/keeper.go index 6be1b191e..56b4236a2 100644 --- a/x/feerefunder/keeper/keeper.go +++ b/x/feerefunder/keeper/keeper.go @@ -253,7 +253,7 @@ func (k Keeper) distributeFee(ctx sdk.Context, receiver sdk.AccAddress, fee sdk. // allowedCoins returns true if one or more coins from `fees` are not present in coins from `params` // assumes that `params` is sorted -func allowedCoins(fees sdk.Coins, params sdk.Coins) bool { +func allowedCoins(fees, params sdk.Coins) bool { for _, fee := range fees { if params.AmountOf(fee.Denom).IsZero() { return true diff --git a/x/feerefunder/types/expected_keepers.go b/x/feerefunder/types/expected_keepers.go index 7ed2f900a..913b1fe42 100644 --- a/x/feerefunder/types/expected_keepers.go +++ b/x/feerefunder/types/expected_keepers.go @@ -14,7 +14,7 @@ type AccountKeeper interface { // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + SendCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error diff --git a/x/ibc-hooks/hooks.go b/x/ibc-hooks/hooks.go index 8b6d4d0a9..1e2b4e865 100644 --- a/x/ibc-hooks/hooks.go +++ b/x/ibc-hooks/hooks.go @@ -13,13 +13,13 @@ import ( type Hooks interface{} type OnChanOpenInitOverrideHooks interface { - OnChanOpenInitOverride(im IBCMiddleware, ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string) (string, error) + OnChanOpenInitOverride(im IBCMiddleware, ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string) (string, error) } type OnChanOpenInitBeforeHooks interface { - OnChanOpenInitBeforeHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string) + OnChanOpenInitBeforeHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string) } type OnChanOpenInitAfterHooks interface { - OnChanOpenInitAfterHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string, finalVersion string, err error) + OnChanOpenInitAfterHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version, finalVersion string, err error) } // OnChanOpenTry Hooks @@ -30,18 +30,18 @@ type OnChanOpenTryBeforeHooks interface { OnChanOpenTryBeforeHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, counterpartyVersion string) } type OnChanOpenTryAfterHooks interface { - OnChanOpenTryAfterHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, counterpartyVersion string, version string, err error) + OnChanOpenTryAfterHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, counterpartyVersion, version string, err error) } // OnChanOpenAck Hooks type OnChanOpenAckOverrideHooks interface { - OnChanOpenAckOverride(im IBCMiddleware, ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string) error + OnChanOpenAckOverride(im IBCMiddleware, ctx sdk.Context, portID, channelID, counterpartyChannelID, counterpartyVersion string) error } type OnChanOpenAckBeforeHooks interface { - OnChanOpenAckBeforeHook(ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string) + OnChanOpenAckBeforeHook(ctx sdk.Context, portID, channelID, counterpartyChannelID, counterpartyVersion string) } type OnChanOpenAckAfterHooks interface { - OnChanOpenAckAfterHook(ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string, err error) + OnChanOpenAckAfterHook(ctx sdk.Context, portID, channelID, counterpartyChannelID, counterpartyVersion string, err error) } // OnChanOpenConfirm Hooks @@ -140,5 +140,5 @@ type GetAppVersionBeforeHooks interface { GetAppVersionBeforeHook(ctx sdk.Context, portID, channelID string) } type GetAppVersionAfterHooks interface { - GetAppVersionAfterHook(ctx sdk.Context, portID, channelID string, result string, success bool) + GetAppVersionAfterHook(ctx sdk.Context, portID, channelID, result string, success bool) } diff --git a/x/ibc-hooks/ibc_middleware_test.go b/x/ibc-hooks/ibc_middleware_test.go index 85393024c..c96c7162d 100644 --- a/x/ibc-hooks/ibc_middleware_test.go +++ b/x/ibc-hooks/ibc_middleware_test.go @@ -290,7 +290,7 @@ const ( BtoA ) -func (suite *HooksTestSuite) GetEndpoints(direction Direction) (sender *ibctesting.Endpoint, receiver *ibctesting.Endpoint) { +func (suite *HooksTestSuite) GetEndpoints(direction Direction) (sender, receiver *ibctesting.Endpoint) { switch direction { case AtoB: sender = suite.TransferPath.EndpointA diff --git a/x/ibc-hooks/wasm_hook.go b/x/ibc-hooks/wasm_hook.go index a3a115bc9..15b922f98 100644 --- a/x/ibc-hooks/wasm_hook.go +++ b/x/ibc-hooks/wasm_hook.go @@ -161,7 +161,7 @@ func jsonStringHasKey(memo, key string) (found bool, jsonObject map[string]inter return true, jsonObject } -func validateAndParseMemo(memo string, receiver string) (isWasmRouted bool, contractAddr sdk.AccAddress, msgBytes []byte, err error) { +func validateAndParseMemo(memo, receiver string) (isWasmRouted bool, contractAddr sdk.AccAddress, msgBytes []byte, err error) { isWasmRouted, metadata := jsonStringHasKey(memo, "wasm") if !isWasmRouted { return isWasmRouted, sdk.AccAddress{}, nil, nil diff --git a/x/interchainqueries/keeper/keeper.go b/x/interchainqueries/keeper/keeper.go index 782590d07..5bb9b5e6a 100644 --- a/x/interchainqueries/keeper/keeper.go +++ b/x/interchainqueries/keeper/keeper.go @@ -233,7 +233,7 @@ func (k Keeper) GetQueryResultByID(ctx sdk.Context, id uint64) (*types.QueryResu return &query, nil } -func (k Keeper) UpdateLastLocalHeight(ctx sdk.Context, queryID uint64, newLocalHeight uint64) error { +func (k Keeper) UpdateLastLocalHeight(ctx sdk.Context, queryID, newLocalHeight uint64) error { query, err := k.getRegisteredQueryByID(ctx, queryID) if err != nil { return sdkerrors.Wrap(err, "failed to get registered query") @@ -401,7 +401,7 @@ func (k Keeper) GetTxQueriesToRemove(ctx sdk.Context, limit uint64) []uint64 { // calculateTxQueryRemoval creates a TxQueryToRemove populated with the data relative to the query // with the given queryID. The result TxQueryToRemove contains up to the limit tx hashes. If the // limit is 0, it retrieves all the hashes for the given query. -func (k Keeper) calculateTxQueryRemoval(ctx sdk.Context, queryID uint64, limit uint64) *TxQueryToRemove { +func (k Keeper) calculateTxQueryRemoval(ctx sdk.Context, queryID, limit uint64) *TxQueryToRemove { prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.GetSubmittedTransactionIDForQueryKeyPrefix(queryID)) iterator := prefixStore.Iterator(nil, nil) defer iterator.Close() diff --git a/x/interchainqueries/keeper/keeper_test.go b/x/interchainqueries/keeper/keeper_test.go index c23ec40d0..8f2df4bd3 100644 --- a/x/interchainqueries/keeper/keeper_test.go +++ b/x/interchainqueries/keeper/keeper_test.go @@ -1728,7 +1728,7 @@ func (suite *KeeperTestSuite) TestRemoveFreshlyCreatedICQ() { suite.ErrorContains(err, "only owner can remove a query within its service period") } -func (suite *KeeperTestSuite) TopUpWallet(ctx sdk.Context, sender sdk.AccAddress, contractAddress sdk.AccAddress) { +func (suite *KeeperTestSuite) TopUpWallet(ctx sdk.Context, sender, contractAddress sdk.AccAddress) { coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdk.NewInt(int64(1_000_000)))) bankKeeper := suite.GetNeutronZoneApp(suite.ChainA).BankKeeper err := bankKeeper.SendCoins(ctx, sender, contractAddress, coinsAmnt) diff --git a/x/interchainqueries/keeper/process_block_results.go b/x/interchainqueries/keeper/process_block_results.go index 9f65cc104..c35420522 100644 --- a/x/interchainqueries/keeper/process_block_results.go +++ b/x/interchainqueries/keeper/process_block_results.go @@ -31,7 +31,7 @@ func deterministicResponseDeliverTx(response *abci.ResponseDeliverTx) *abci.Resp } // checkHeadersOrder do some basic checks to verify that nextHeader is really next for the header -func checkHeadersOrder(header *tendermintLightClientTypes.Header, nextHeader *tendermintLightClientTypes.Header) error { +func checkHeadersOrder(header, nextHeader *tendermintLightClientTypes.Header) error { if nextHeader.Header.Height != header.Header.Height+1 { return sdkerrors.Wrapf(types.ErrInvalidHeader, "nextHeader.Height (%d) is not actually next for a header with height %d", nextHeader.Header.Height, header.Header.Height) } @@ -60,7 +60,7 @@ type Verifier struct{} // VerifyHeaders verify that headers are valid tendermint headers, checks them on validity by trying call ibcClient.UpdateClient(header) // to update light client's consensus state and checks that they are sequential (tl;dr header.Height + 1 == nextHeader.Height) -func (v Verifier) VerifyHeaders(ctx sdk.Context, clientKeeper clientkeeper.Keeper, clientID string, header exported.Header, nextHeader exported.Header) error { +func (v Verifier) VerifyHeaders(ctx sdk.Context, clientKeeper clientkeeper.Keeper, clientID string, header, nextHeader exported.Header) error { // this IBC handler updates the consensus state and the state root from a provided header. // But more importantly in the current situation, it checks that header is valid. // Honestly we need only to verify headers, but since the check functions are private, and we don't want to duplicate the code, diff --git a/x/interchainqueries/types/verify.go b/x/interchainqueries/types/verify.go index e9b22a9a3..286f33248 100644 --- a/x/interchainqueries/types/verify.go +++ b/x/interchainqueries/types/verify.go @@ -9,7 +9,7 @@ import ( ) type HeaderVerifier interface { - VerifyHeaders(ctx sdk.Context, cleintkeeper clientkeeper.Keeper, clientID string, header exported.Header, nextHeader exported.Header) error + VerifyHeaders(ctx sdk.Context, cleintkeeper clientkeeper.Keeper, clientID string, header, nextHeader exported.Header) error UnpackHeader(any *codectypes.Any) (exported.Header, error) } diff --git a/x/interchaintxs/keeper/ibc_handlers_test.go b/x/interchaintxs/keeper/ibc_handlers_test.go index 8781189c1..c068977eb 100644 --- a/x/interchaintxs/keeper/ibc_handlers_test.go +++ b/x/interchaintxs/keeper/ibc_handlers_test.go @@ -106,7 +106,7 @@ func TestHandleAcknowledgement(t *testing.T) { cachedCtx.GasMeter().ConsumeGas(1, "Sudo response consumption") }).Return(nil, nil) feeKeeper.EXPECT().DistributeAcknowledgementFee(lowGasCtx, relayerAddress, feetypes.NewPacketID(p.SourcePort, p.SourceChannel, p.Sequence)) - cmKeeper.EXPECT().AddContractFailure(lowGasCtx, "channel-0", contractAddress.String(), p.GetSequence(), "ack").Do(func(ctx sdk.Context, channelId string, address string, ackID uint64, ackType string) { + cmKeeper.EXPECT().AddContractFailure(lowGasCtx, "channel-0", contractAddress.String(), p.GetSequence(), "ack").Do(func(ctx sdk.Context, channelId, address string, ackID uint64, ackType string) { ctx.GasMeter().ConsumeGas(keeper.GasReserve, "out of gas") }) require.Panics(t, func() { icak.HandleAcknowledgement(lowGasCtx, p, resAckData, relayerAddress) }) //nolint:errcheck // this is a panic test diff --git a/x/interchaintxs/types/expected_keepers.go b/x/interchaintxs/types/expected_keepers.go index 7bcd82021..93d1ea031 100644 --- a/x/interchaintxs/types/expected_keepers.go +++ b/x/interchaintxs/types/expected_keepers.go @@ -26,7 +26,7 @@ type BankKeeper interface { type ContractManagerKeeper interface { HasContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) bool - AddContractFailure(ctx sdk.Context, channelID string, address string, ackID uint64, ackType string) + AddContractFailure(ctx sdk.Context, channelID, address string, ackID uint64, ackType string) SudoResponse(ctx sdk.Context, senderAddress sdk.AccAddress, request channeltypes.Packet, msg []byte) ([]byte, error) SudoError(ctx sdk.Context, senderAddress sdk.AccAddress, request channeltypes.Packet, details string) ([]byte, error) SudoTimeout(ctx sdk.Context, senderAddress sdk.AccAddress, request channeltypes.Packet) ([]byte, error) @@ -36,7 +36,7 @@ type ContractManagerKeeper interface { type ICAControllerKeeper interface { GetActiveChannelID(ctx sdk.Context, connectionID, portID string) (string, bool) GetInterchainAccountAddress(ctx sdk.Context, connectionID, portID string) (string, bool) - RegisterInterchainAccount(ctx sdk.Context, connectionID, owner string, version string) error + RegisterInterchainAccount(ctx sdk.Context, connectionID, owner, version string) error SendTx(ctx sdk.Context, chanCap *capabilitytypes.Capability, connectionID, portID string, icaPacketData icatypes.InterchainAccountPacketData, timeoutTimestamp uint64) (uint64, error) } diff --git a/x/tokenfactory/keeper/admins.go b/x/tokenfactory/keeper/admins.go index 744662656..243ece8c3 100644 --- a/x/tokenfactory/keeper/admins.go +++ b/x/tokenfactory/keeper/admins.go @@ -37,7 +37,7 @@ func (k Keeper) setAuthorityMetadata(ctx sdk.Context, denom string, metadata typ return nil } -func (k Keeper) setAdmin(ctx sdk.Context, denom string, admin string) error { +func (k Keeper) setAdmin(ctx sdk.Context, denom, admin string) error { metadata, err := k.GetAuthorityMetadata(ctx, denom) if err != nil { return err diff --git a/x/tokenfactory/keeper/createdenom.go b/x/tokenfactory/keeper/createdenom.go index 9d5192a63..c2484fe92 100644 --- a/x/tokenfactory/keeper/createdenom.go +++ b/x/tokenfactory/keeper/createdenom.go @@ -11,7 +11,7 @@ import ( ) // ConvertToBaseToken converts a fee amount in a whitelisted fee token to the base fee token amount -func (k Keeper) CreateDenom(ctx sdk.Context, creatorAddr string, subdenom string) (newTokenDenom string, err error) { +func (k Keeper) CreateDenom(ctx sdk.Context, creatorAddr, subdenom string) (newTokenDenom string, err error) { err = k.chargeFeeForDenomCreation(ctx, creatorAddr) if err != nil { return "", sdkerrors.Wrapf(types.ErrUnableToCharge, "denom fee collection error: %v", err) @@ -32,7 +32,7 @@ func (k Keeper) CreateDenom(ctx sdk.Context, creatorAddr string, subdenom string // Runs CreateDenom logic after the charge and all denom validation has been handled. // Made into a second function for genesis initialization. -func (k Keeper) createDenomAfterValidation(ctx sdk.Context, creatorAddr string, denom string) (err error) { +func (k Keeper) createDenomAfterValidation(ctx sdk.Context, creatorAddr, denom string) (err error) { denomMetaData := banktypes.Metadata{ DenomUnits: []*banktypes.DenomUnit{{ Denom: denom, @@ -55,7 +55,7 @@ func (k Keeper) createDenomAfterValidation(ctx sdk.Context, creatorAddr string, return nil } -func (k Keeper) validateCreateDenom(ctx sdk.Context, creatorAddr string, subdenom string) (newTokenDenom string, err error) { +func (k Keeper) validateCreateDenom(ctx sdk.Context, creatorAddr, subdenom string) (newTokenDenom string, err error) { // Temporary check until IBC bug is sorted out if k.bankKeeper.HasSupply(ctx, subdenom) { return "", fmt.Errorf("temporary error until IBC bug is sorted out, " + diff --git a/x/tokenfactory/keeper/keeper_test.go b/x/tokenfactory/keeper/keeper_test.go index d09828399..037009cb4 100644 --- a/x/tokenfactory/keeper/keeper_test.go +++ b/x/tokenfactory/keeper/keeper_test.go @@ -70,7 +70,7 @@ func (suite *KeeperTestSuite) CreateDefaultDenom(ctx sdktypes.Context) { suite.defaultDenom = res.GetNewTokenDenom() } -func (suite *KeeperTestSuite) TopUpWallet(ctx sdktypes.Context, sender sdktypes.AccAddress, contractAddress sdktypes.AccAddress) { +func (suite *KeeperTestSuite) TopUpWallet(ctx sdktypes.Context, sender, contractAddress sdktypes.AccAddress) { coinsAmnt := sdktypes.NewCoins(sdktypes.NewCoin(params.DefaultDenom, sdktypes.NewInt(TopUpCoinsAmount))) bankKeeper := suite.GetNeutronZoneApp(suite.ChainA).BankKeeper err := bankKeeper.SendCoins(ctx, sender, contractAddress, coinsAmnt) diff --git a/x/tokenfactory/types/denoms.go b/x/tokenfactory/types/denoms.go index f848a4cb6..6e5acdff2 100644 --- a/x/tokenfactory/types/denoms.go +++ b/x/tokenfactory/types/denoms.go @@ -40,7 +40,7 @@ func GetTokenDenom(creator, subdenom string) (string, error) { // DeconstructDenom takes a token denom string and verifies that it is a valid // denom of the tokenfactory module, and is of the form `factory/{creator}/{subdenom}` // If valid, it returns the creator address and subdenom -func DeconstructDenom(denom string) (creator string, subdenom string, err error) { +func DeconstructDenom(denom string) (creator, subdenom string, err error) { err = sdk.ValidateDenom(denom) if err != nil { return "", "", err diff --git a/x/tokenfactory/types/expected_keepers.go b/x/tokenfactory/types/expected_keepers.go index ffa4b5439..b2c359711 100644 --- a/x/tokenfactory/types/expected_keepers.go +++ b/x/tokenfactory/types/expected_keepers.go @@ -20,7 +20,7 @@ type BankKeeper interface { MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + SendCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins } diff --git a/x/transfer/ibc_handlers_test.go b/x/transfer/ibc_handlers_test.go index 274450540..be2c5ceb7 100644 --- a/x/transfer/ibc_handlers_test.go +++ b/x/transfer/ibc_handlers_test.go @@ -191,7 +191,7 @@ func TestHandleAcknowledgement(t *testing.T) { cachedCtx.GasMeter().ConsumeGas(1, "Sudo response consumption") }).Return(nil, nil) // feeKeeper.EXPECT().DistributeAcknowledgementFee(lowGasCtx, relayerAddress, feetypes.NewPacketID(p.SourcePort, p.SourceChannel, p.Sequence)) - cmKeeper.EXPECT().AddContractFailure(lowGasCtx, "channel-0", contractAddress.String(), p.GetSequence(), "ack").Do(func(ctx sdk.Context, channelId string, address string, ackID uint64, ackType string) { + cmKeeper.EXPECT().AddContractFailure(lowGasCtx, "channel-0", contractAddress.String(), p.GetSequence(), "ack").Do(func(ctx sdk.Context, channelId, address string, ackID uint64, ackType string) { ctx.GasMeter().ConsumeGas(keeper.GasReserve, "out of gas") }) require.Panics(t, func() { txModule.HandleAcknowledgement(lowGasCtx, p, resAckData, relayerAddress) }) //nolint:errcheck // this is a test diff --git a/x/transfer/keeper/keeper_test.go b/x/transfer/keeper/keeper_test.go index af274adee..19b837a87 100644 --- a/x/transfer/keeper/keeper_test.go +++ b/x/transfer/keeper/keeper_test.go @@ -134,7 +134,7 @@ func (suite KeeperTestSuite) TestTransfer() { //nolint:govet // it's a test so i suite.NoError(err) } -func (suite *KeeperTestSuite) TopUpWallet(ctx sdktypes.Context, sender sdktypes.AccAddress, contractAddress sdktypes.AccAddress) { +func (suite *KeeperTestSuite) TopUpWallet(ctx sdktypes.Context, sender, contractAddress sdktypes.AccAddress) { coinsAmnt := sdktypes.NewCoins(sdktypes.NewCoin(params.DefaultDenom, sdktypes.NewInt(int64(1_000_000)))) bankKeeper := suite.GetNeutronZoneApp(suite.ChainA).BankKeeper err := bankKeeper.SendCoins(ctx, sender, contractAddress, coinsAmnt) diff --git a/x/transfer/types/expected_keepers.go b/x/transfer/types/expected_keepers.go index 1234a78d2..670c2bf6b 100644 --- a/x/transfer/types/expected_keepers.go +++ b/x/transfer/types/expected_keepers.go @@ -11,7 +11,7 @@ import ( // ContractManagerKeeper defines the expected interface needed to add ack information about sudo failure. type ContractManagerKeeper interface { HasContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) bool - AddContractFailure(ctx sdk.Context, channelID string, address string, ackID uint64, ackType string) + AddContractFailure(ctx sdk.Context, channelID, address string, ackID uint64, ackType string) SudoResponse(ctx sdk.Context, senderAddress sdk.AccAddress, request channeltypes.Packet, msg []byte) ([]byte, error) SudoError(ctx sdk.Context, senderAddress sdk.AccAddress, request channeltypes.Packet, details string) ([]byte, error) SudoTimeout(ctx sdk.Context, senderAddress sdk.AccAddress, request channeltypes.Packet) ([]byte, error)