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

use the extra rules on gofumpt for tighter linting #238

Merged
merged 1 commit into from
Jun 6, 2023
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
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wasmbinding/message_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wasmbinding/test/custom_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion x/contractmanager/keeper/failure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion x/contractmanager/keeper/failure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion x/contractmanager/keeper/grpc_query_failure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/cron/keeper/grpc_query_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion x/feeburner/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion x/feerefunder/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/feerefunder/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions x/ibc-hooks/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion x/ibc-hooks/ibc_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/ibc-hooks/wasm_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions x/interchainqueries/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion x/interchainqueries/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions x/interchainqueries/keeper/process_block_results.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion x/interchainqueries/types/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion x/interchaintxs/keeper/ibc_handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions x/interchaintxs/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion x/tokenfactory/keeper/admins.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions x/tokenfactory/keeper/createdenom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand All @@ -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, " +
Expand Down
2 changes: 1 addition & 1 deletion x/tokenfactory/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion x/tokenfactory/types/denoms.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/tokenfactory/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion x/transfer/ibc_handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/transfer/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading