diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..95e2316 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,13 @@ +run: + # Timeout for analysis, e.g. 30s, 5m. + # Default: 1m + timeout: 5m + + # Include test files or not. + # Default: true + tests: true + + # Define the Go version limit. + # Mainly related to generics support since go1.18. + # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18 + go: '1.18' \ No newline at end of file diff --git a/Makefile b/Makefile index a5428c1..a7bf1d4 100644 --- a/Makefile +++ b/Makefile @@ -124,12 +124,20 @@ draw-deps: lint: @echo "--> Running linter" - golangci-lint run -v --timeout 5m + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + @go install mvdan.cc/gofumpt@latest + golangci-lint run -v --go=1.18 --timeout 10m + find . -name '*.go' -type f -not -path "./build*" -not -name "statik.go" -not -name "*.pb.go" -not -name "*.pb.gw.go" | xargs gofumpt -d -format: - find . -name '*.go' -type f -not -path "./vendor*" -not -path "./build*" -not -path "*.git*" -not -path "./docs/statik/statik.go" -not -name "*.pb.go" -not -name "*.pb.gw.go" -not -name "*.pulsar.go" -not -path "./crypto/keys/secp256k1/*" | xargs gofumpt -w -l +format: format-goimports + find . -name '*.go' -type f -not -path "./build*" -not -name "statik.go" -not -name "*.pb.go" -not -name "*.pb.gw.go" | xargs gofumpt -w -l golangci-lint run --fix -.PHONY: format + +format-goimports: + @go install github.com/incu6us/goimports-reviser/v3@latest + @find . -name '*.go' -type f -not -path './build*' -not -name 'statik.go' -not -name '*.pb.go' -not -name '*.pb.gw.go' -exec goimports-reviser -use-cache -rm-unused {} \; + +.PHONY: format lint ############################################################################### ### Tests & Simulation ### diff --git a/app/app.go b/app/app.go index 76e9f08..6e669cb 100644 --- a/app/app.go +++ b/app/app.go @@ -7,23 +7,6 @@ import ( "os" "path/filepath" - "github.com/pundix/pundix/server/grpc/base/gasprice" - gaspricelegacy "github.com/pundix/pundix/server/grpc/base/gasprice/legacy" - - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - - "github.com/cosmos/cosmos-sdk/simapp" - "github.com/cosmos/cosmos-sdk/x/auth/ante" - - pundixante "github.com/pundix/pundix/ante" - "github.com/pundix/pundix/app/keepers" - appparams "github.com/pundix/pundix/app/params" - "github.com/pundix/pundix/app/upgrades" - v2 "github.com/pundix/pundix/app/upgrades/v2" - - "github.com/gorilla/mux" - "github.com/rakyll/statik/fs" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" @@ -33,15 +16,21 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" + "github.com/cosmos/cosmos-sdk/x/auth/ante" authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/crisis" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" + "github.com/gorilla/mux" + "github.com/rakyll/statik/fs" "github.com/spf13/cast" abci "github.com/tendermint/tendermint/abci/types" tmjson "github.com/tendermint/tendermint/libs/json" @@ -49,11 +38,15 @@ import ( tmos "github.com/tendermint/tendermint/libs/os" dbm "github.com/tendermint/tm-db" - pxtypes "github.com/pundix/pundix/types" - - ibctesting "github.com/cosmos/ibc-go/v3/testing" - + pundixante "github.com/pundix/pundix/ante" + "github.com/pundix/pundix/app/keepers" + appparams "github.com/pundix/pundix/app/params" + "github.com/pundix/pundix/app/upgrades" + v2 "github.com/pundix/pundix/app/upgrades/v2" _ "github.com/pundix/pundix/docs/statik" + "github.com/pundix/pundix/server/grpc/base/gasprice" + gaspricelegacy "github.com/pundix/pundix/server/grpc/base/gasprice/legacy" + pxtypes "github.com/pundix/pundix/types" ) var ( diff --git a/app/cli/add_genesis_account.go b/app/cli/add_genesis_account.go index 3e4bde3..c0ead40 100644 --- a/app/cli/add_genesis_account.go +++ b/app/cli/add_genesis_account.go @@ -5,10 +5,9 @@ import ( "errors" "fmt" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/app/cli/block.go b/app/cli/block.go index 0219422..675be00 100644 --- a/app/cli/block.go +++ b/app/cli/block.go @@ -6,12 +6,11 @@ import ( "os" "strconv" - "gopkg.in/yaml.v2" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" tmcli "github.com/tendermint/tendermint/libs/cli" + "gopkg.in/yaml.v2" ) // BlockCommand returns the verified block data for a given heights diff --git a/app/cli/block_result.go b/app/cli/block_result.go index 70ba937..e119c8c 100644 --- a/app/cli/block_result.go +++ b/app/cli/block_result.go @@ -6,14 +6,13 @@ import ( "encoding/json" "strconv" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/gogo/protobuf/proto" - "github.com/tendermint/tendermint/abci/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/gogo/protobuf/proto" "github.com/spf13/cobra" + "github.com/tendermint/tendermint/abci/types" coretypes "github.com/tendermint/tendermint/rpc/core/types" ) diff --git a/app/cli/collect_gentx.go b/app/cli/collect_gentx.go index 8d7c049..4ead137 100644 --- a/app/cli/collect_gentx.go +++ b/app/cli/collect_gentx.go @@ -8,21 +8,19 @@ import ( "runtime" "strings" - cfg "github.com/tendermint/tendermint/config" - tmtypes "github.com/tendermint/tendermint/types" - "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" + "github.com/cosmos/cosmos-sdk/x/genutil" "github.com/cosmos/cosmos-sdk/x/genutil/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/x/genutil" "github.com/pkg/errors" "github.com/spf13/cobra" + cfg "github.com/tendermint/tendermint/config" + tmtypes "github.com/tendermint/tendermint/types" ) const flagGenTxDir = "gentx-dir" diff --git a/app/cli/config.go b/app/cli/config.go index 052674f..789aed6 100644 --- a/app/cli/config.go +++ b/app/cli/config.go @@ -5,8 +5,6 @@ import ( "path/filepath" "strings" - appparams "github.com/pundix/pundix/app/params" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/config" @@ -15,6 +13,8 @@ import ( "github.com/spf13/viper" tmcfg "github.com/tendermint/tendermint/config" tmcli "github.com/tendermint/tendermint/libs/cli" + + appparams "github.com/pundix/pundix/app/params" ) const ( diff --git a/app/cli/data.go b/app/cli/data.go index 311dec0..a70efee 100644 --- a/app/cli/data.go +++ b/app/cli/data.go @@ -8,15 +8,14 @@ import ( "time" "github.com/cosmos/cosmos-sdk/server" + "github.com/spf13/cobra" + "github.com/spf13/viper" "github.com/syndtr/goleveldb/leveldb/util" cfg "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/node" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/store" dbm "github.com/tendermint/tm-db" - - "github.com/spf13/cobra" - "github.com/spf13/viper" ) const ( diff --git a/app/cli/debug.go b/app/cli/debug.go index fa53d10..1dddaad 100644 --- a/app/cli/debug.go +++ b/app/cli/debug.go @@ -9,26 +9,21 @@ import ( "fmt" "strings" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/debug" - tmcli "github.com/tendermint/tendermint/libs/cli" - - "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - // nolint - "github.com/cosmos/cosmos-sdk/types/bech32/legacybech32" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - "github.com/cosmos/cosmos-sdk/server" - "github.com/tendermint/tendermint/privval" - - "github.com/cosmos/cosmos-sdk/client" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32/legacybech32" // nolint "github.com/cosmos/cosmos-sdk/version" + "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/auth/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/spf13/cobra" + tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/tendermint/tendermint/privval" ) func Debug() *cobra.Command { diff --git a/app/cli/export_state.go b/app/cli/export_state.go index 1204a81..8202866 100644 --- a/app/cli/export_state.go +++ b/app/cli/export_state.go @@ -6,16 +6,14 @@ import ( "os" "path/filepath" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" - + "github.com/cosmos/cosmos-sdk/server/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" tmjson "github.com/tendermint/tendermint/libs/json" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/server/types" - sdk "github.com/cosmos/cosmos-sdk/types" ) const ( diff --git a/app/cli/gentx.go b/app/cli/gentx.go index 9acf8f9..311b319 100644 --- a/app/cli/gentx.go +++ b/app/cli/gentx.go @@ -9,26 +9,24 @@ import ( "os" "path/filepath" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - types2 "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/pkg/errors" - "github.com/spf13/cobra" - tmos "github.com/tendermint/tendermint/libs/os" - tmtypes "github.com/tendermint/tendermint/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" authclient "github.com/cosmos/cosmos-sdk/x/auth/client" "github.com/cosmos/cosmos-sdk/x/genutil" "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/staking/client/cli" + types2 "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/pkg/errors" + "github.com/spf13/cobra" + tmos "github.com/tendermint/tendermint/libs/os" + tmtypes "github.com/tendermint/tendermint/types" ) // GenTxCmd builds the application's gentx command. diff --git a/app/cli/query_store.go b/app/cli/query_store.go index 1dabae3..2477174 100644 --- a/app/cli/query_store.go +++ b/app/cli/query_store.go @@ -5,11 +5,10 @@ import ( "encoding/hex" "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/spf13/cobra" ) diff --git a/app/cli/query_tx.go b/app/cli/query_tx.go index 0474420..6af5dc0 100644 --- a/app/cli/query_tx.go +++ b/app/cli/query_tx.go @@ -4,9 +4,6 @@ import ( "fmt" "strings" - "github.com/spf13/cobra" - tmtypes "github.com/tendermint/tendermint/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" @@ -15,6 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/rest" "github.com/cosmos/cosmos-sdk/version" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + "github.com/spf13/cobra" + tmtypes "github.com/tendermint/tendermint/types" ) const ( diff --git a/app/cli/status.go b/app/cli/status.go index 2fecf0a..90b0f7a 100644 --- a/app/cli/status.go +++ b/app/cli/status.go @@ -5,17 +5,15 @@ import ( "strconv" "time" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/spf13/cobra" - "github.com/tendermint/tendermint/libs/bytes" tmcli "github.com/tendermint/tendermint/libs/cli" "github.com/tendermint/tendermint/p2p" ctypes "github.com/tendermint/tendermint/rpc/core/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) // ValidatorInfo is info about the node's validator, same as Tendermint, diff --git a/app/cli/validator.go b/app/cli/validator.go index 9fdfda7..382643a 100644 --- a/app/cli/validator.go +++ b/app/cli/validator.go @@ -8,17 +8,15 @@ import ( "path/filepath" "strconv" - cfg "github.com/tendermint/tendermint/config" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" + "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/types/rest" "github.com/cosmos/go-bip39" "github.com/spf13/cobra" + cfg "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/crypto/secp256k1" tmos "github.com/tendermint/tendermint/libs/os" diff --git a/app/export.go b/app/export.go index 8613dc0..9cfe5e2 100644 --- a/app/export.go +++ b/app/export.go @@ -3,13 +3,12 @@ package app import ( "encoding/json" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) // ExportAppStateAndValidators exports the state of the application for a genesis diff --git a/app/genesis.go b/app/genesis.go index 40f05db..2baf51c 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -5,13 +5,6 @@ import ( "math/big" "time" - pundixtransfertypes "github.com/pundix/pundix/x/ibc/applications/transfer/types" - - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/tendermint/tendermint/types" - - pxtypes "github.com/pundix/pundix/types" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -21,11 +14,15 @@ import ( minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" ibctypes "github.com/cosmos/ibc-go/v3/modules/core/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/tendermint/tendermint/types" - ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + pxtypes "github.com/pundix/pundix/types" + pundixtransfertypes "github.com/pundix/pundix/x/ibc/applications/transfer/types" ) // GenesisState The genesis state of the blockchain is represented here as a map of raw json diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index a713400..e41dac9 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -2,6 +2,7 @@ package keepers import ( "github.com/cosmos/cosmos-sdk/baseapp" + _ "github.com/cosmos/cosmos-sdk/client/docs/statik" "github.com/cosmos/cosmos-sdk/codec" servertypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/store/streaming" @@ -22,12 +23,8 @@ import ( evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" "github.com/cosmos/cosmos-sdk/x/feegrant" feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - pundixtransfer "github.com/pundix/pundix/x/ibc/applications/transfer" - pundixtransferkeeper "github.com/pundix/pundix/x/ibc/applications/transfer/keeper" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/params" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" @@ -52,10 +49,9 @@ import ( ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" tmos "github.com/tendermint/tendermint/libs/os" + pundixtransfer "github.com/pundix/pundix/x/ibc/applications/transfer" + pundixtransferkeeper "github.com/pundix/pundix/x/ibc/applications/transfer/keeper" pundixmintkeeper "github.com/pundix/pundix/x/mint/keeper" - - // unnamed import of statik for swagger UI support - _ "github.com/cosmos/cosmos-sdk/client/docs/statik" ) type AppKeepers struct { diff --git a/app/modules.go b/app/modules.go index 9676588..6cfff93 100644 --- a/app/modules.go +++ b/app/modules.go @@ -43,12 +43,10 @@ import ( ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client" ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" + appparams "github.com/pundix/pundix/app/params" pundixtransfer "github.com/pundix/pundix/x/ibc/applications/transfer" pundixtransfertypes "github.com/pundix/pundix/x/ibc/applications/transfer/types" - pundixmint "github.com/pundix/pundix/x/mint" - - appparams "github.com/pundix/pundix/app/params" ) var maccPerms = map[string][]string{ diff --git a/app/test_helpers.go b/app/test_helpers.go index 0a7cbd2..b3ee67c 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -4,11 +4,14 @@ import ( "encoding/json" "time" - "github.com/pundix/pundix/types" - + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ibctesting "github.com/cosmos/ibc-go/v3/testing" "github.com/cosmos/ibc-go/v3/testing/mock" abci "github.com/tendermint/tendermint/abci/types" @@ -17,11 +20,7 @@ import ( tmtypes "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tm-db" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/pundix/pundix/types" ) // DefaultTestingAppInit defines the IBC application used for testing diff --git a/cmd/init.go b/cmd/init.go index fb5017c..d312710 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -8,12 +8,10 @@ import ( "os" "path/filepath" - "github.com/cosmos/cosmos-sdk/codec" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/genutil" @@ -21,6 +19,7 @@ import ( cfg "github.com/tendermint/tendermint/config" tmcli "github.com/tendermint/tendermint/libs/cli" tmos "github.com/tendermint/tendermint/libs/os" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/tendermint/tendermint/types" bip39 "github.com/tyler-smith/go-bip39" diff --git a/cmd/root.go b/cmd/root.go index e30d9c0..b539ce7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -8,15 +8,6 @@ import ( "path/filepath" "time" - "github.com/cosmos/cosmos-sdk/version" - tmcfg "github.com/tendermint/tendermint/config" - "github.com/tendermint/tendermint/node" - tmstore "github.com/tendermint/tendermint/store" - - "github.com/pundix/pundix/server/grpc/base/gasprice" - - appparams "github.com/pundix/pundix/app/params" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" sdkCfg "github.com/cosmos/cosmos-sdk/client/config" @@ -29,6 +20,7 @@ import ( "github.com/cosmos/cosmos-sdk/snapshots" "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/types" vestingcli "github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli" @@ -38,13 +30,18 @@ import ( "github.com/spf13/cast" "github.com/spf13/cobra" "github.com/spf13/pflag" + tmcfg "github.com/tendermint/tendermint/config" tmcli "github.com/tendermint/tendermint/libs/cli" "github.com/tendermint/tendermint/libs/log" + "github.com/tendermint/tendermint/node" + tmstore "github.com/tendermint/tendermint/store" tmtypes "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tm-db" "github.com/pundix/pundix/app" "github.com/pundix/pundix/app/cli" + appparams "github.com/pundix/pundix/app/params" + "github.com/pundix/pundix/server/grpc/base/gasprice" pxtypes "github.com/pundix/pundix/types" ) diff --git a/ibc/testing/app.go b/ibc/testing/app.go index 0a463bc..5365c39 100644 --- a/ibc/testing/app.go +++ b/ibc/testing/app.go @@ -5,19 +5,17 @@ import ( "testing" "time" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" - ibctesting "github.com/cosmos/ibc-go/v3/testing" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmtypes "github.com/tendermint/tendermint/types" pxapp "github.com/pundix/pundix/app" pxtypes "github.com/pundix/pundix/types" diff --git a/ibc/testing/chain.go b/ibc/testing/chain.go index cb727ef..000e21d 100644 --- a/ibc/testing/chain.go +++ b/ibc/testing/chain.go @@ -4,21 +4,17 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - - "github.com/pundix/pundix/types" - - "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" ibcgotesting "github.com/cosmos/ibc-go/v3/testing" "github.com/cosmos/ibc-go/v3/testing/mock" + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmtypes "github.com/tendermint/tendermint/types" + + "github.com/pundix/pundix/types" ) // ChainIDPrefix defines the default chain ID prefix for Evmos test chains diff --git a/x/ibc/applications/transfer/client/cli/cli.go b/x/ibc/applications/transfer/client/cli/cli.go index e8e0244..4b14ba3 100644 --- a/x/ibc/applications/transfer/client/cli/cli.go +++ b/x/ibc/applications/transfer/client/cli/cli.go @@ -1,9 +1,8 @@ package cli import ( - "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" ) // GetQueryCmd returns the query commands for IBC connections diff --git a/x/ibc/applications/transfer/client/cli/query.go b/x/ibc/applications/transfer/client/cli/query.go index d0619c1..a8ec1d5 100644 --- a/x/ibc/applications/transfer/client/cli/query.go +++ b/x/ibc/applications/transfer/client/cli/query.go @@ -4,14 +4,11 @@ import ( "encoding/json" "fmt" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" ) func GetCmdDenomToIBcDenom() *cobra.Command { diff --git a/x/ibc/applications/transfer/client/cli/tx.go b/x/ibc/applications/transfer/client/cli/tx.go index e40e5b2..9739de1 100644 --- a/x/ibc/applications/transfer/client/cli/tx.go +++ b/x/ibc/applications/transfer/client/cli/tx.go @@ -6,19 +6,17 @@ import ( "strings" "time" - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - - "github.com/pundix/pundix/x/ibc/applications/transfer/types" - - "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" channelutils "github.com/cosmos/ibc-go/v3/modules/core/04-channel/client/utils" + "github.com/spf13/cobra" + + "github.com/pundix/pundix/x/ibc/applications/transfer/types" ) const ( diff --git a/x/ibc/applications/transfer/ibc_module.go b/x/ibc/applications/transfer/ibc_module.go index 1379a1a..bb3384b 100644 --- a/x/ibc/applications/transfer/ibc_module.go +++ b/x/ibc/applications/transfer/ibc_module.go @@ -3,15 +3,13 @@ package transfer import ( "fmt" - "github.com/cosmos/ibc-go/v3/modules/apps/transfer" - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - - "github.com/cosmos/ibc-go/v3/modules/core/exported" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/ibc-go/v3/modules/apps/transfer" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v3/modules/core/exported" "github.com/pundix/pundix/x/ibc/applications/transfer/keeper" "github.com/pundix/pundix/x/ibc/applications/transfer/types" diff --git a/x/ibc/applications/transfer/keeper/keeper.go b/x/ibc/applications/transfer/keeper/keeper.go index 679e6b4..1d356fc 100644 --- a/x/ibc/applications/transfer/keeper/keeper.go +++ b/x/ibc/applications/transfer/keeper/keeper.go @@ -1,18 +1,17 @@ package keeper import ( + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper" transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" "github.com/tendermint/tendermint/libs/log" "github.com/pundix/pundix/x/ibc/applications/transfer/types" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" ) // Keeper defines the IBC fungible transfer keeper diff --git a/x/ibc/applications/transfer/keeper/msg_server.go b/x/ibc/applications/transfer/keeper/msg_server.go index e4c5a0e..f7cf95a 100644 --- a/x/ibc/applications/transfer/keeper/msg_server.go +++ b/x/ibc/applications/transfer/keeper/msg_server.go @@ -3,11 +3,10 @@ package keeper import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" "github.com/pundix/pundix/x/ibc/applications/transfer/types" - - sdk "github.com/cosmos/cosmos-sdk/types" ) var ( diff --git a/x/ibc/applications/transfer/keeper/relay.go b/x/ibc/applications/transfer/keeper/relay.go index deeeba6..35c9ab2 100644 --- a/x/ibc/applications/transfer/keeper/relay.go +++ b/x/ibc/applications/transfer/keeper/relay.go @@ -2,23 +2,20 @@ package keeper import ( "fmt" - pxtypes "github.com/pundix/pundix/types" "strings" - coretypes "github.com/cosmos/ibc-go/v3/modules/core/types" - - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - - "github.com/pundix/pundix/x/ibc/applications/transfer/types" - "github.com/armon/go-metrics" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + coretypes "github.com/cosmos/ibc-go/v3/modules/core/types" + + pxtypes "github.com/pundix/pundix/types" + "github.com/pundix/pundix/x/ibc/applications/transfer/types" ) // SendTransfer handles transfer sending logic. There are 2 possible cases: diff --git a/x/ibc/applications/transfer/keeper/relay_test.go b/x/ibc/applications/transfer/keeper/relay_test.go index 5e5fbeb..00e6013 100644 --- a/x/ibc/applications/transfer/keeper/relay_test.go +++ b/x/ibc/applications/transfer/keeper/relay_test.go @@ -10,12 +10,13 @@ import ( clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" ibcgotesting "github.com/cosmos/ibc-go/v3/testing" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/rand" + "github.com/pundix/pundix/app" pxtypes "github.com/pundix/pundix/types" pundixtransfer "github.com/pundix/pundix/x/ibc/applications/transfer" pxtransfertypes "github.com/pundix/pundix/x/ibc/applications/transfer/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/rand" ) func (suite *KeeperTestSuite) TestOnRecvPacket() { diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index 1ed487b..04cfaa2 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -5,24 +5,20 @@ import ( "encoding/json" "fmt" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" - + "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" "github.com/pundix/pundix/x/ibc/applications/transfer/client/cli" "github.com/pundix/pundix/x/ibc/applications/transfer/keeper" "github.com/pundix/pundix/x/ibc/applications/transfer/types" - - "github.com/gorilla/mux" - "github.com/spf13/cobra" - - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" ) // type check to ensure the interface is properly implemented diff --git a/x/ibc/applications/transfer/types/msgs.go b/x/ibc/applications/transfer/types/msgs.go index 7fd3c01..61ca98f 100644 --- a/x/ibc/applications/transfer/types/msgs.go +++ b/x/ibc/applications/transfer/types/msgs.go @@ -4,10 +4,9 @@ import ( "fmt" "strings" - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" host "github.com/cosmos/ibc-go/v3/modules/core/24-host" ) diff --git a/x/ibc/applications/transfer/types/msgs_test.go b/x/ibc/applications/transfer/types/msgs_test.go index 57c15f2..1398f04 100644 --- a/x/ibc/applications/transfer/types/msgs_test.go +++ b/x/ibc/applications/transfer/types/msgs_test.go @@ -4,13 +4,12 @@ import ( "fmt" "testing" - "github.com/pundix/pundix/x/ibc/applications/transfer/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" "github.com/stretchr/testify/require" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + "github.com/pundix/pundix/x/ibc/applications/transfer/types" ) // define constants used for testing diff --git a/x/ibc/applications/transfer/types/packet.go b/x/ibc/applications/transfer/types/packet.go index e0d5b80..0a06787 100644 --- a/x/ibc/applications/transfer/types/packet.go +++ b/x/ibc/applications/transfer/types/packet.go @@ -4,10 +4,9 @@ import ( "strings" "time" - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" ) // DefaultRelativePacketTimeoutTimestamp is the default packet timeout timestamp (in nanoseconds) diff --git a/x/ibc/applications/transfer/types/packet_test.go b/x/ibc/applications/transfer/types/packet_test.go index cf72666..41af99f 100644 --- a/x/ibc/applications/transfer/types/packet_test.go +++ b/x/ibc/applications/transfer/types/packet_test.go @@ -3,13 +3,11 @@ package types_test import ( "testing" + sdk "github.com/cosmos/cosmos-sdk/types" transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + "github.com/stretchr/testify/require" types "github.com/pundix/pundix/x/ibc/applications/transfer/types" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/stretchr/testify/require" ) const ( diff --git a/x/mint/module.go b/x/mint/module.go index b85add8..b8c444e 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -5,19 +5,16 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/client" - - "github.com/pundix/pundix/x/mint/types" - - "github.com/cosmos/cosmos-sdk/x/mint" - mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/mint" + mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/pundix/pundix/x/mint/keeper" + "github.com/pundix/pundix/x/mint/types" ) var _ module.AppModule = AppModule{} diff --git a/x/mint/types/params.go b/x/mint/types/params.go index 69195f9..5566b48 100644 --- a/x/mint/types/params.go +++ b/x/mint/types/params.go @@ -5,9 +5,8 @@ import ( "fmt" "strings" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - sdk "github.com/cosmos/cosmos-sdk/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) diff --git a/x/mint/types/params_test.go b/x/mint/types/params_test.go index ea55a30..53950b4 100644 --- a/x/mint/types/params_test.go +++ b/x/mint/types/params_test.go @@ -6,9 +6,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/stretchr/testify/require" ) func TestParamsValidate(t *testing.T) {