Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed May 31, 2024
1 parent 0c0959a commit cdb35df
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 30 deletions.
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"os"
"sort"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/gogoproto/proto"
"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward"
Expand Down Expand Up @@ -40,6 +38,8 @@ import (
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
"cosmossdk.io/client/v2/autocli"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/log"
Expand Down
1 change: 0 additions & 1 deletion tests/interchaintest/feeabs/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func CrossChainSwap(c *cosmos.CosmosChain, ctx context.Context, keyName string,
"feeabs", "swap", ibcDenom,
"--gas", "auto",
)

if err != nil {
return tx, fmt.Errorf("executing transaction failed: %w", err)
}
Expand Down
8 changes: 4 additions & 4 deletions tests/interchaintest/ibc_transfer_customfee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdktypes "github.com/cosmos/cosmos-sdk/types"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
feeabsCli "github.com/osmosis-labs/fee-abstraction/v8/tests/interchaintest/feeabs"
"github.com/osmosis-labs/fee-abstraction/v8/tests/interchaintest/tendermint"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/require"

feeabsCli "github.com/osmosis-labs/fee-abstraction/v8/tests/interchaintest/feeabs"
"github.com/osmosis-labs/fee-abstraction/v8/tests/interchaintest/tendermint"

feeabstypes "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types"
)

Expand Down Expand Up @@ -239,8 +240,8 @@ func TestFeeabsGaiaIBCTransferWithIBCFee(t *testing.T) {
// Compose an IBC transfer and send from Feeabs -> Gaia, with insufficient fee, should fail
customTransferTx, err = SendIBCTransferWithCustomFee(feeabs, ctx, feeabsUser.KeyName(), channFeeabsGaia.ChannelID, transfer, sdk.Coins{ibcFee})
require.Error(t, err)

}

func SendIBCTransferWithCustomFee(c *cosmos.CosmosChain, ctx context.Context, keyName string, channelID string, amount ibc.WalletAmount, fees sdk.Coins) (ibc.Tx, error) {
tn := c.Validators[0]

Expand All @@ -250,7 +251,6 @@ func SendIBCTransferWithCustomFee(c *cosmos.CosmosChain, ctx context.Context, ke
}
var tx ibc.Tx
txHash, err := tn.ExecTx(ctx, keyName, command...)

if err != nil {
return tx, fmt.Errorf("send ibc transfer: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions tests/interchaintest/query_osmosis_twap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import (
sdktypes "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
feeabsCli "github.com/osmosis-labs/fee-abstraction/v8/tests/interchaintest/feeabs"
feeabstypes "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/require"

feeabsCli "github.com/osmosis-labs/fee-abstraction/v8/tests/interchaintest/feeabs"
feeabstypes "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types"
)

func TestQueryOsmosisTwap(t *testing.T) {
Expand Down Expand Up @@ -157,7 +158,6 @@ func ParamChangeProposal(t *testing.T, ctx context.Context, feeabs *cosmos.Cosmo

_, err = cosmos.PollForProposalStatus(ctx, feeabs, height, height+20, propID, v1beta1.StatusPassed)
require.NoError(t, err, "proposal status did not change to passed in expected number of blocks")

}

func AddHostZoneProposal(t *testing.T, ctx context.Context, feeabs *cosmos.CosmosChain, feeabsUser ibc.Wallet) {
Expand Down
3 changes: 2 additions & 1 deletion tests/interchaintest/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

feeabstype "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types"
balancertypes "github.com/osmosis-labs/osmosis/v25/x/gamm/pool-models/balancer"
gammtypes "github.com/osmosis-labs/osmosis/v25/x/gamm/types"

feeabstype "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types"
)

type HasPacketForwarding struct {
Expand Down
2 changes: 2 additions & 0 deletions x/feeabs/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import (
"github.com/stretchr/testify/require"

math "cosmossdk.io/math"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

"github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/ante"
"github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types"
)
Expand Down
17 changes: 10 additions & 7 deletions x/feeabs/ante/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ package ante_test
import (
"testing"

capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
transferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
channelkeeper "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper"
portkeeper "github.com/cosmos/ibc-go/v8/modules/core/05-port/keeper"
"github.com/stretchr/testify/require"
ubermock "go.uber.org/mock/gomock"

storetypes "cosmossdk.io/store/types"

"github.com/cosmos/cosmos-sdk/client"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/runtime"
Expand All @@ -17,20 +25,15 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/bank/keeper"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
transferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
channelkeeper "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper"
portkeeper "github.com/cosmos/ibc-go/v8/modules/core/05-port/keeper"

feeabskeeper "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/keeper"
feeabstestutil "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/testutil"
feeabstypes "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types"
"github.com/stretchr/testify/require"
ubermock "go.uber.org/mock/gomock"
)

// TestAccount represents an account used in the tests in x/auth/ante.
type TestAccount struct {
acc authtypes.AccountI
acc sdk.AccountI
priv cryptotypes.PrivKey
}

Expand Down
1 change: 1 addition & 0 deletions x/feeabs/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"

"github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/types"
)

Expand Down
1 change: 0 additions & 1 deletion x/feeabs/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.
var genesisState types.GenesisState
cdc.MustUnmarshalJSON(data, &genesisState)
am.keeper.InitGenesis(ctx, genesisState)

}

// ExportGenesis export feeabs state as raw message for feeabs module
Expand Down
19 changes: 8 additions & 11 deletions x/feeabs/types/expected_keepers.go
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
package types

import (
context "context"
"context"

clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"

sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
)

// AccountKeeper defines the expected account keeper used for simulations (noalias)
type AccountKeeper interface {
GetAccount(ctx context.Context, addr sdk.AccAddress) authtypes.AccountI
GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
GetModuleAddress(moduleName string) sdk.AccAddress
GetModuleAccount(ctx context.Context, moduleName string) authtypes.ModuleAccountI
IterateAccounts(ctx context.Context, process func(authtypes.AccountI) (stop bool))
SetModuleAccount(context.Context, authtypes.ModuleAccountI)
GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI
IterateAccounts(ctx context.Context, process func(sdk.AccountI) (stop bool))
SetModuleAccount(context.Context, sdk.ModuleAccountI)
GetParams(ctx context.Context) authtypes.Params
SetAccount(ctx context.Context, acc authtypes.AccountI)
NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) authtypes.AccountI
SetAccount(ctx context.Context, acc sdk.AccountI)
NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
}

// BankKeeper defines the expected interface needed to retrieve account balances.
Expand Down Expand Up @@ -72,7 +71,5 @@ type ScopedKeeper interface {
type ChannelKeeper interface {
GetChannel(ctx context.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool)
GetNextSequenceSend(ctx context.Context, portID, channelID string) (uint64, bool)
SendPacket(ctx context.Context, channelCap *capabilitytypes.Capability, sourcePort string, sourceChannel string,
timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte) (uint64, error)
ChanCloseInit(ctx context.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error
}

0 comments on commit cdb35df

Please sign in to comment.