Skip to content

Commit

Permalink
make lint
Browse files Browse the repository at this point in the history
  • Loading branch information
anhductn2001 committed Aug 21, 2023
1 parent 60a9bb9 commit 3bf0a0b
Show file tree
Hide file tree
Showing 63 changed files with 86 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ docker-build-debug:
lint:
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run mvdan.cc/gofumpt -w .
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run github.com/client9/misspell/cmd/misspell -w
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run golang.org/x/tools/cmd/goimports -w -local github.com/notional-labs/composable-centauri
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run golang.org/x/tools/cmd/goimports -w -local github.com/notional-labs/centauri
.PHONY: lint

###############################################################################
Expand Down
1 change: 1 addition & 0 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
ante "github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/signing"

tfmwKeeper "github.com/notional-labs/centauri/v4/x/transfermiddleware/keeper"
)

Expand Down
1 change: 1 addition & 0 deletions app/ante/ibc_ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/cosmos/cosmos-sdk/x/authz"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"

tfmwKeeper "github.com/notional-labs/centauri/v4/x/transfermiddleware/keeper"
)

Expand Down
4 changes: 3 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ import (
icq "github.com/strangelove-ventures/async-icq/v7"
icqtypes "github.com/strangelove-ventures/async-icq/v7/types"

custombankmodule "github.com/notional-labs/centauri/v4/custom/bank"
"github.com/strangelove-ventures/packet-forward-middleware/v7/router"
routertypes "github.com/strangelove-ventures/packet-forward-middleware/v7/router/types"
alliancemodule "github.com/terra-money/alliance/x/alliance"
alliancemoduleclient "github.com/terra-money/alliance/x/alliance/client"
alliancemoduletypes "github.com/terra-money/alliance/x/alliance/types"

custombankmodule "github.com/notional-labs/centauri/v4/custom/bank"

"github.com/notional-labs/centauri/v4/app/ante"
transfermiddleware "github.com/notional-labs/centauri/v4/x/transfermiddleware"
transfermiddlewaretypes "github.com/notional-labs/centauri/v4/x/transfermiddleware/types"
Expand All @@ -112,6 +113,7 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

v4_5 "github.com/notional-labs/centauri/v4/app/upgrades/v4_5"
v4_5_1 "github.com/notional-labs/centauri/v4/app/upgrades/v4_5_1"

Expand Down
3 changes: 2 additions & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/ibc-go/v7/testing/mock"
centauri "github.com/notional-labs/centauri/v4/app"
"github.com/stretchr/testify/require"

centauri "github.com/notional-labs/centauri/v4/app"
)

// SimAppChainID hardcoded chainID for simulation
Expand Down
5 changes: 3 additions & 2 deletions app/ibctesting/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ import (
ibctesting "github.com/cosmos/ibc-go/v7/testing"
"github.com/cosmos/ibc-go/v7/testing/mock"
ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"

centauri "github.com/notional-labs/centauri/v4/app"
"github.com/notional-labs/centauri/v4/app/ibctesting/simapp"
routerKeeper "github.com/notional-labs/centauri/v4/x/transfermiddleware/keeper"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)

// TestChain is a testing struct that wraps a simapp with the last TM Header, the current ABCI
Expand Down
1 change: 1 addition & 0 deletions app/ibctesting/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ import (
wasm08 "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/keeper"
ibcmock "github.com/cosmos/ibc-go/v7/testing/mock"
ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types"

simappparams "github.com/notional-labs/centauri/v4/app/ibctesting/simapp/params"
simappupgrades "github.com/notional-labs/centauri/v4/app/ibctesting/simapp/upgrades"
v6 "github.com/notional-labs/centauri/v4/app/ibctesting/simapp/upgrades/v6"
Expand Down
3 changes: 2 additions & 1 deletion app/ibctesting/simapp/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ import (
"github.com/cosmos/cosmos-sdk/x/simulation"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
minttypes "github.com/notional-labs/centauri/v4/x/mint/types"
"github.com/stretchr/testify/require"

minttypes "github.com/notional-labs/centauri/v4/x/mint/types"

ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
)
Expand Down
1 change: 1 addition & 0 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"

storetypes "github.com/cosmos/cosmos-sdk/store/types"

minttypes "github.com/notional-labs/centauri/v4/x/mint/types"

"github.com/CosmWasm/wasmd/x/wasm"
Expand Down
1 change: 1 addition & 0 deletions app/test_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
wasm08 "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/keeper"

ratelimitkeeper "github.com/notional-labs/centauri/v4/x/ratelimit/keeper"
tfmdKeeper "github.com/notional-labs/centauri/v4/x/transfermiddleware/keeper"
)
Expand Down
1 change: 1 addition & 0 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

minttypes "github.com/notional-labs/centauri/v4/x/mint/types"

"github.com/CosmWasm/wasmd/x/wasm"
Expand Down
1 change: 1 addition & 0 deletions app/upgrades/reward/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

mintkeeper "github.com/notional-labs/centauri/v4/x/mint/keeper"
tfmwkeeper "github.com/notional-labs/centauri/v4/x/transfermiddleware/keeper"
)
Expand Down
1 change: 1 addition & 0 deletions app/upgrades/v4/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
store "github.com/cosmos/cosmos-sdk/store/types"
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"

"github.com/notional-labs/centauri/v4/app/upgrades"
ibchookstypes "github.com/notional-labs/centauri/v4/x/ibc-hooks/types"
ratelimitmoduletypes "github.com/notional-labs/centauri/v4/x/ratelimit/types"
Expand Down
1 change: 1 addition & 0 deletions app/upgrades/v4/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/notional-labs/centauri/v4/app/keepers"
"github.com/notional-labs/centauri/v4/app/upgrades"
tfmdtypes "github.com/notional-labs/centauri/v4/x/transfermiddleware/types"
Expand Down
1 change: 1 addition & 0 deletions bech32-migration/slashing/slashing.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"

"github.com/notional-labs/centauri/v4/bech32-migration/utils"
)

Expand Down
1 change: 1 addition & 0 deletions bech32-migration/staking/staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/notional-labs/centauri/v4/bech32-migration/utils"
)

Expand Down
3 changes: 2 additions & 1 deletion cmd/centaurid/cmd/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"errors"
"fmt"

"github.com/notional-labs/centauri/v4/bech32-migration/utils"
"github.com/spf13/cobra"

"github.com/notional-labs/centauri/v4/bech32-migration/utils"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
Expand Down
3 changes: 2 additions & 1 deletion custom/bank/bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
customibctesting "github.com/notional-labs/centauri/v4/app/ibctesting"
"github.com/stretchr/testify/suite"

customibctesting "github.com/notional-labs/centauri/v4/app/ibctesting"
)

type CustomBankTestSuite struct {
Expand Down
3 changes: 2 additions & 1 deletion custom/bank/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import (
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
"github.com/cosmos/cosmos-sdk/x/bank/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
banktypes "github.com/notional-labs/centauri/v4/custom/bank/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

banktypes "github.com/notional-labs/centauri/v4/custom/bank/types"

transfermiddlewarekeeper "github.com/notional-labs/centauri/v4/x/transfermiddleware/keeper"

alliancekeeper "github.com/terra-money/alliance/x/alliance/keeper"
Expand Down
3 changes: 2 additions & 1 deletion x/ibc-hooks/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/version"
"github.com/notional-labs/centauri/v4/x/ibc-hooks/keeper"
"github.com/spf13/cobra"

"github.com/notional-labs/centauri/v4/x/ibc-hooks/keeper"

"github.com/notional-labs/centauri/v4/x/ibc-hooks/types"
)

Expand Down
1 change: 1 addition & 0 deletions x/ibc-hooks/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/address"

"github.com/notional-labs/centauri/v4/x/ibc-hooks/types"
)

Expand Down
3 changes: 2 additions & 1 deletion x/ibc-hooks/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
"github.com/stretchr/testify/suite"

customibctesting "github.com/notional-labs/centauri/v4/app/ibctesting"
ibchookskeeper "github.com/notional-labs/centauri/v4/x/ibc-hooks/keeper"
"github.com/stretchr/testify/suite"
)

// TODO: use testsuite here.
Expand Down
1 change: 1 addition & 0 deletions x/ibc-hooks/wasm_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"

"github.com/notional-labs/centauri/v4/x/ibc-hooks/keeper"
"github.com/notional-labs/centauri/v4/x/ibc-hooks/types"

Expand Down
1 change: 1 addition & 0 deletions x/mint/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/notional-labs/centauri/v4/x/mint/keeper"
"github.com/notional-labs/centauri/v4/x/mint/types"
)
Expand Down
1 change: 1 addition & 0 deletions x/mint/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"

"github.com/notional-labs/centauri/v4/x/mint/types"
)

Expand Down
3 changes: 2 additions & 1 deletion x/mint/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/notional-labs/centauri/v4/x/mint/types"
"github.com/spf13/cobra"

"github.com/notional-labs/centauri/v4/x/mint/types"
)

// GetTxCmd returns the tx commands for mint
Expand Down
1 change: 1 addition & 0 deletions x/mint/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/notional-labs/centauri/v4/x/mint/types"
)

Expand Down
1 change: 1 addition & 0 deletions x/mint/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/notional-labs/centauri/v4/x/mint/types"
)

Expand Down
1 change: 1 addition & 0 deletions x/mint/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/notional-labs/centauri/v4/x/mint/types"
)

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

govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/notional-labs/centauri/v4/x/mint/types"
)

Expand Down
1 change: 1 addition & 0 deletions x/mint/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"

"github.com/notional-labs/centauri/v4/x/mint/client/cli"
"github.com/notional-labs/centauri/v4/x/mint/keeper"
"github.com/notional-labs/centauri/v4/x/mint/simulation"
Expand Down
1 change: 1 addition & 0 deletions x/mint/simulation/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/kv"

"github.com/notional-labs/centauri/v4/x/mint/types"
)

Expand Down
1 change: 1 addition & 0 deletions x/mint/simulation/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/types/module/testutil"

"github.com/notional-labs/centauri/v4/x/mint/simulation"
centauriminttypes "github.com/notional-labs/centauri/v4/x/mint/types"
)
Expand Down
1 change: 1 addition & 0 deletions x/mint/simulation/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/notional-labs/centauri/v4/x/mint/types"
)

Expand Down
1 change: 1 addition & 0 deletions x/mint/simulation/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/mint"

"github.com/notional-labs/centauri/v4/x/mint/simulation"
"github.com/notional-labs/centauri/v4/x/mint/types"
)
Expand Down
1 change: 1 addition & 0 deletions x/mint/simulation/proposals.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/address"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"

"github.com/notional-labs/centauri/v4/x/mint/types"
)

Expand Down
1 change: 1 addition & 0 deletions x/mint/simulation/proposals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/address"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"

"github.com/notional-labs/centauri/v4/x/mint/simulation"
"github.com/notional-labs/centauri/v4/x/mint/types"
)
Expand Down
3 changes: 2 additions & 1 deletion x/ratelimit/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package cli
import (
"fmt"

"github.com/notional-labs/centauri/v4/x/ratelimit/types"
"github.com/spf13/cobra"

"github.com/notional-labs/centauri/v4/x/ratelimit/types"
)

// GetTxCmd returns the tx commands for router
Expand Down
1 change: 1 addition & 0 deletions x/ratelimit/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/notional-labs/centauri/v4/x/ratelimit/types"
)

Expand Down
1 change: 1 addition & 0 deletions x/ratelimit/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strings"

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/notional-labs/centauri/v4/x/ratelimit/types"
)

Expand Down
1 change: 1 addition & 0 deletions x/ratelimit/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"

"github.com/notional-labs/centauri/v4/x/ratelimit/types"
)

Expand Down
1 change: 1 addition & 0 deletions x/ratelimit/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"

"github.com/notional-labs/centauri/v4/x/ratelimit/types"
tfmwkeeper "github.com/notional-labs/centauri/v4/x/transfermiddleware/keeper"
)
Expand Down
Loading

0 comments on commit 3bf0a0b

Please sign in to comment.