From 3c971214418d2a889493e1e4d0a776054a494a2b Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Thu, 14 Apr 2022 20:19:14 +0700 Subject: [PATCH] Enable gofumpt (#1179) * Update Makefile Draft PR aimed at enabling fumpt linter and using golangci-lint run --fix to make developer environments match ci * update to go1.18 * Update Makefile * fumpt & update makefile to exclude dirs * Update Makefile Co-authored-by: Aleksandr Bezobchuk * Update Makefile Co-authored-by: Aleksandr Bezobchuk * Update Makefile Co-authored-by: Aleksandr Bezobchuk --- .golangci.yml | 2 +- Makefile | 7 ++- app/ante.go | 5 +- app/app.go | 21 ++++--- app/config.go | 5 +- app/encoding.go | 3 +- app/modules.go | 17 ++--- app/params/config.go | 3 +- app/test_helpers.go | 5 +- app/upgrades/v4/upgrade_test.go | 13 ++-- app/upgrades/v5/upgrades.go | 7 ++- app/upgrades/v7/upgrades.go | 1 + app/wasm/bindings/types_test.go | 3 +- app/wasm/test/custom_msg_test.go | 2 +- app/wasm/test/helpers_test.go | 5 +- app/wasm/test/messages_test.go | 7 +-- app/wasm/test/queries_test.go | 1 - app/wasm/test/store_run_test.go | 2 +- .../cmd/balances_from_state_export.go | 13 ++-- cmd/osmosisd/cmd/genwasm.go | 3 +- cmd/osmosisd/cmd/root.go | 13 ++-- simapp/sim_test.go | 9 +-- tests/e2e/e2e_setup_test.go | 2 +- tests/e2e/e2e_test.go | 1 - tests/e2e/io.go | 2 +- tests/e2e/validator.go | 6 +- v043_temp/address/hash_test.go | 4 +- x/claim/abci.go | 3 +- x/claim/client/cli/cli_test.go | 13 ++-- x/claim/client/cli/query.go | 5 +- x/claim/client/cli/tx.go | 3 +- x/claim/genesis_test.go | 49 ++++++++------- x/claim/handler.go | 5 +- x/claim/keeper/claim.go | 5 +- x/claim/keeper/claim_test.go | 3 +- x/claim/keeper/grpc_query.go | 3 +- x/claim/keeper/hooks.go | 5 +- x/claim/keeper/keeper.go | 3 +- x/claim/keeper/keeper_test.go | 3 +- x/claim/keeper/params.go | 3 +- x/claim/module.go | 9 +-- x/epochs/abci.go | 5 +- x/epochs/abci_test.go | 3 +- x/epochs/client/cli/cli_test.go | 5 +- x/epochs/client/cli/query.go | 5 +- x/epochs/genesis.go | 3 +- x/epochs/genesis_test.go | 2 +- x/epochs/handler.go | 5 +- x/epochs/keeper/epoch.go | 3 +- x/epochs/keeper/keeper.go | 5 +- x/epochs/keeper/keeper_test.go | 5 +- x/epochs/module.go | 9 +-- x/epochs/simulation/genesis.go | 3 +- x/gamm/client/cli/cli_test.go | 15 ++--- x/gamm/client/cli/tx.go | 5 +- x/gamm/client/rest/api.go | 3 +- x/gamm/client/testutil/test_helpers.go | 3 +- x/gamm/handler.go | 5 +- x/gamm/keeper/gas_test.go | 11 ++-- x/gamm/keeper/grpc_query.go | 5 +- x/gamm/keeper/keeper.go | 3 +- x/gamm/keeper/keeper_test.go | 7 ++- x/gamm/keeper/marshal_bench_test.go | 5 +- x/gamm/keeper/params.go | 3 +- x/gamm/keeper/pool.go | 3 +- x/gamm/keeper/pool_service.go | 3 +- x/gamm/module.go | 9 +-- x/gamm/pool-models/balancer/balancer_pool.go | 9 ++- .../balancer/balancer_pool_test.go | 4 +- x/gamm/pool-models/balancer/codec.go | 3 +- x/gamm/pool-models/balancer/marshal_test.go | 1 - x/gamm/pool-models/balancer/msgs.go | 10 ++- x/gamm/pool-models/balancer/pool_asset.go | 5 +- x/gamm/pool-models/balancer/suite_test.go | 3 +- x/gamm/pool-models/stableswap/msgs.go | 10 ++- x/gamm/pool-models/stableswap/pool.go | 4 ++ x/gamm/simulation/operations.go | 10 +-- x/gamm/types/params.go | 3 +- x/gamm/types/pool.go | 3 +- x/incentives/abci_test.go | 5 +- x/incentives/client/cli/cli_test.go | 5 +- x/incentives/client/cli/query.go | 5 +- x/incentives/client/cli/tx.go | 7 ++- x/incentives/genesis.go | 3 +- x/incentives/genesis_test.go | 6 +- x/incentives/handler.go | 5 +- x/incentives/keeper/bench_test.go | 12 ++-- x/incentives/keeper/distribute.go | 3 +- x/incentives/keeper/distribute_test.go | 3 +- x/incentives/keeper/gauge.go | 3 +- x/incentives/keeper/gauge_test.go | 3 +- x/incentives/keeper/grpc_query.go | 5 +- x/incentives/keeper/hooks.go | 3 +- x/incentives/keeper/iterator.go | 5 +- x/incentives/keeper/keeper.go | 5 +- x/incentives/keeper/keeper_test.go | 3 +- x/incentives/keeper/msg_server.go | 5 +- x/incentives/keeper/params.go | 3 +- x/incentives/keeper/store.go | 3 +- x/incentives/keeper/store_test.go | 1 - x/incentives/keeper/suite_test.go | 11 ++-- x/incentives/keeper/utils.go | 3 +- x/incentives/keeper/utils_test.go | 3 +- x/incentives/module.go | 9 +-- x/incentives/simulation/operations.go | 10 +-- x/incentives/types/expected_keepers.go | 3 +- x/incentives/types/gauge.go | 3 +- x/incentives/types/msgs.go | 3 +- x/incentives/types/msgs_test.go | 4 +- x/incentives/types/params.go | 3 +- x/lockup/abci.go | 3 +- x/lockup/client/cli/cli_test.go | 11 ++-- x/lockup/client/cli/tx.go | 3 +- x/lockup/client/rest/query.go | 3 +- x/lockup/client/rest/tx.go | 3 +- x/lockup/client/testutil/test_helpers.go | 3 +- x/lockup/genesis.go | 3 +- x/lockup/genesis_test.go | 63 ++++++++++--------- x/lockup/handler.go | 5 +- x/lockup/keeper/admin_keeper.go | 3 +- x/lockup/keeper/admin_keeper_test.go | 5 +- x/lockup/keeper/bench_test.go | 7 ++- x/lockup/keeper/export_test.go | 3 +- x/lockup/keeper/gas_test.go | 3 +- x/lockup/keeper/grpc_query_test.go | 4 +- x/lockup/keeper/iterator.go | 5 +- x/lockup/keeper/keeper.go | 3 +- x/lockup/keeper/keeper_test.go | 3 +- x/lockup/keeper/lock.go | 5 +- x/lockup/keeper/lock_refs.go | 3 +- x/lockup/keeper/lock_test.go | 8 +-- x/lockup/keeper/migration.go | 3 +- x/lockup/keeper/migration_test.go | 3 +- x/lockup/keeper/msg_server.go | 5 +- x/lockup/keeper/msg_server_test.go | 5 +- x/lockup/keeper/store.go | 5 +- x/lockup/keeper/store_test.go | 1 - x/lockup/keeper/synthetic_lock.go | 3 +- x/lockup/keeper/synthetic_lock_test.go | 3 +- x/lockup/keeper/utils.go | 3 +- x/lockup/keeper/utils_test.go | 3 +- x/lockup/module.go | 9 +-- x/lockup/simulation/operations.go | 8 ++- x/mint/client/cli/cli_test.go | 5 +- x/mint/client/cli/query.go | 3 +- x/mint/client/rest/grpc_query_test.go | 3 +- x/mint/client/rest/query.go | 3 +- x/mint/genesis.go | 3 +- x/mint/genesis_test.go | 3 +- x/mint/keeper/grpc_query_test.go | 5 +- x/mint/keeper/hooks.go | 5 +- x/mint/keeper/hooks_test.go | 5 +- x/mint/keeper/integration_test.go | 3 +- x/mint/keeper/keeper.go | 7 ++- x/mint/module_test.go | 3 +- x/mint/simulation/decoder.go | 3 +- x/mint/simulation/decoder_test.go | 5 +- x/mint/simulation/genesis.go | 3 +- x/mint/simulation/genesis_test.go | 5 +- x/mint/simulation/params_test.go | 1 - x/mint/types/expected_keepers.go | 3 +- x/mint/types/params.go | 5 +- x/pool-incentives/abci.go | 3 +- x/pool-incentives/client/cli/cli_test.go | 5 +- x/pool-incentives/client/cli/query.go | 5 +- x/pool-incentives/client/proposal_handler.go | 3 +- x/pool-incentives/genesis_test.go | 42 +++++++------ x/pool-incentives/keeper/distr.go | 3 +- x/pool-incentives/keeper/distr_test.go | 7 ++- x/pool-incentives/keeper/grpc_query.go | 5 +- x/pool-incentives/keeper/grpc_query_test.go | 6 +- x/pool-incentives/keeper/keeper.go | 9 +-- x/pool-incentives/keeper/keeper_test.go | 7 ++- x/pool-incentives/module.go | 9 +-- x/pool-incentives/types/genesis_test.go | 4 +- x/pool-incentives/types/gov_test.go | 4 +- x/pool-incentives/types/incentives_test.go | 7 +-- x/pool-incentives/types/params.go | 3 +- x/pool-incentives/types/query_test.go | 2 - x/superfluid/abci.go | 3 +- x/superfluid/client/cli/query.go | 5 +- x/superfluid/client/cli/tx.go | 5 +- x/superfluid/client/proposal_handler.go | 3 +- x/superfluid/genesis.go | 3 +- x/superfluid/genesis_test.go | 3 +- x/superfluid/handler.go | 5 +- x/superfluid/keeper/distribution_test.go | 5 +- x/superfluid/keeper/export_test.go | 6 +- x/superfluid/keeper/gov/gov.go | 3 +- x/superfluid/keeper/gov/gov_test.go | 3 +- x/superfluid/keeper/gov/suite_test.go | 3 +- x/superfluid/keeper/hooks.go | 3 +- x/superfluid/keeper/intermediary_account.go | 7 ++- .../keeper/intermediary_account_test.go | 1 - x/superfluid/keeper/keeper.go | 5 +- x/superfluid/keeper/keeper_test.go | 7 ++- x/superfluid/keeper/msg_server.go | 3 +- x/superfluid/keeper/params.go | 3 +- x/superfluid/keeper/slash.go | 3 +- x/superfluid/keeper/slash_test.go | 5 +- x/superfluid/keeper/stake.go | 5 +- x/superfluid/keeper/stake_test.go | 7 ++- x/superfluid/keeper/superfluid_asset.go | 3 +- x/superfluid/keeper/superfluid_asset_store.go | 5 +- x/superfluid/keeper/superfluid_asset_test.go | 3 +- x/superfluid/keeper/synthetic_lock_wrapper.go | 3 +- x/superfluid/keeper/twap_price.go | 5 +- x/superfluid/keeper/twap_price_test.go | 3 +- x/superfluid/module.go | 9 +-- x/superfluid/simulation/genesis.go | 3 +- x/superfluid/simulation/operations.go | 10 +-- x/superfluid/types/gov.go | 3 +- x/txfees/client/cli/query.go | 5 +- x/txfees/genesis.go | 3 +- x/txfees/keeper/feedecorator_test.go | 3 +- x/txfees/keeper/feetokens.go | 5 +- x/txfees/keeper/feetokens_test.go | 4 +- x/txfees/keeper/keeper_test.go | 7 ++- x/txfees/keeper/txfee_filters/arb_tx.go | 3 +- x/txfees/module.go | 9 +-- x/txfees/types/options.go | 3 +- 221 files changed, 704 insertions(+), 495 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 803a5d32c83..53338ac9193 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -38,7 +38,7 @@ linters: # - godox <- detects TODO/BUG/FIXME and we may wantnthis later but isn't appropriate now # - goerr113 <- disabled due to lack of comprehension - gofmt - # - gofumpt + - gofumpt - goheader - goimports # - gomoddirectives <- disables replaces diff --git a/Makefile b/Makefile index a5ee11d11a3..508c98b1f1d 100644 --- a/Makefile +++ b/Makefile @@ -247,9 +247,10 @@ lint: @go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m format: - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/cosmos/cosmos-sdk + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name "*.pb.gw.go" -not -name "*.pb.go" | xargs gofumpt -w -s + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name "*.pb.gw.go" -not -name "*.pb.go" | xargs misspell -w + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name "*.pb.gw.go" -not -name "*.pb.go" | xargs goimports -w -local github.com/cosmos/cosmos-sdk + @go run github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --fix ############################################################################### ### Localnet ### diff --git a/app/ante.go b/app/ante.go index ce6bc621e41..ec45267fb39 100644 --- a/app/ante.go +++ b/app/ante.go @@ -3,13 +3,14 @@ package app import ( wasm "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + channelkeeper "github.com/cosmos/ibc-go/v2/modules/core/04-channel/keeper" + ibcante "github.com/cosmos/ibc-go/v2/modules/core/ante" + servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" ante "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/cosmos/cosmos-sdk/x/auth/signing" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - channelkeeper "github.com/cosmos/ibc-go/v2/modules/core/04-channel/keeper" - ibcante "github.com/cosmos/ibc-go/v2/modules/core/ante" txfeeskeeper "github.com/osmosis-labs/osmosis/v7/x/txfees/keeper" txfeestypes "github.com/osmosis-labs/osmosis/v7/x/txfees/types" diff --git a/app/app.go b/app/app.go index 6c7ab4307cf..00ada88ae00 100644 --- a/app/app.go +++ b/app/app.go @@ -9,6 +9,17 @@ import ( "strings" "github.com/CosmWasm/wasmd/x/wasm" + transfer "github.com/cosmos/ibc-go/v2/modules/apps/transfer" + "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" + "github.com/tendermint/tendermint/libs/log" + tmos "github.com/tendermint/tendermint/libs/os" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" @@ -30,16 +41,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/crisis" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - transfer "github.com/cosmos/ibc-go/v2/modules/apps/transfer" - "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" - "github.com/tendermint/tendermint/libs/log" - tmos "github.com/tendermint/tendermint/libs/os" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - dbm "github.com/tendermint/tm-db" appparams "github.com/osmosis-labs/osmosis/v7/app/params" v4 "github.com/osmosis-labs/osmosis/v7/app/upgrades/v4" diff --git a/app/config.go b/app/config.go index 4e9fa1b551a..f73c8dd126f 100644 --- a/app/config.go +++ b/app/config.go @@ -4,13 +4,14 @@ import ( "fmt" "time" + "github.com/osmosis-labs/osmosis/v7/app/params" + dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/network" - "github.com/osmosis-labs/osmosis/v7/app/params" - dbm "github.com/tendermint/tm-db" servertypes "github.com/cosmos/cosmos-sdk/server/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" diff --git a/app/encoding.go b/app/encoding.go index 67057957882..809483a93d4 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -1,8 +1,9 @@ package app import ( - "github.com/cosmos/cosmos-sdk/std" "github.com/osmosis-labs/osmosis/v7/app/params" + + "github.com/cosmos/cosmos-sdk/std" ) // MakeEncodingConfig creates an EncodingConfig for testing. diff --git a/app/modules.go b/app/modules.go index 90ef5936ed7..29a716c7bc6 100644 --- a/app/modules.go +++ b/app/modules.go @@ -3,6 +3,15 @@ package app import ( "github.com/CosmWasm/wasmd/x/wasm" wasmclient "github.com/CosmWasm/wasmd/x/wasm/client" + transfer "github.com/cosmos/ibc-go/v2/modules/apps/transfer" + ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v2/modules/core" + ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client" + ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host" + "github.com/osmosis-labs/bech32-ibc/x/bech32ibc" + bech32ibctypes "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/types" + "github.com/osmosis-labs/bech32-ibc/x/bech32ics20" + "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" @@ -36,14 +45,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - transfer "github.com/cosmos/ibc-go/v2/modules/apps/transfer" - ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v2/modules/core" - ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client" - ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host" - "github.com/osmosis-labs/bech32-ibc/x/bech32ibc" - bech32ibctypes "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/types" - "github.com/osmosis-labs/bech32-ibc/x/bech32ics20" appparams "github.com/osmosis-labs/osmosis/v7/app/params" _ "github.com/osmosis-labs/osmosis/v7/client/docs/statik" diff --git a/app/params/config.go b/app/params/config.go index 69e56315978..8b571373742 100644 --- a/app/params/config.go +++ b/app/params/config.go @@ -1,9 +1,10 @@ package params import ( + "github.com/osmosis-labs/osmosis/v7/v043_temp/address" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/osmosis-labs/osmosis/v7/v043_temp/address" ) const ( diff --git a/app/test_helpers.go b/app/test_helpers.go index 6456afb7984..65af5804e2f 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -4,11 +4,12 @@ import ( "encoding/json" "os" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" ) // Setup initializes a new OsmosisApp. diff --git a/app/upgrades/v4/upgrade_test.go b/app/upgrades/v4/upgrade_test.go index 77a75ece912..0a402b6f768 100644 --- a/app/upgrades/v4/upgrade_test.go +++ b/app/upgrades/v4/upgrade_test.go @@ -7,13 +7,14 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/osmosis-labs/osmosis/v7/app" v4 "github.com/osmosis-labs/osmosis/v7/app/upgrades/v4" "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) type UpgradeTestSuite struct { @@ -47,7 +48,7 @@ func (suite *UpgradeTestSuite) TestUpgradePayments() { func() { // mint coins to distribution module / feepool.communitypool - var bal = int64(1000000000000) + bal := int64(1000000000000) coin := sdk.NewInt64Coin("uosmo", bal) coins := sdk.NewCoins(coin) err := suite.app.BankKeeper.MintCoins(suite.ctx, "mint", coins) @@ -57,7 +58,6 @@ func (suite *UpgradeTestSuite) TestUpgradePayments() { feePool := suite.app.DistrKeeper.GetFeePool(suite.ctx) feePool.CommunityPool = feePool.CommunityPool.Add(sdk.NewDecCoinFromCoin(coin)) suite.app.DistrKeeper.SetFeePool(suite.ctx, feePool) - }, func() { // run upgrade @@ -75,7 +75,7 @@ func (suite *UpgradeTestSuite) TestUpgradePayments() { }) }, func() { - var total = int64(0) + total := int64(0) // check that each account got the payment expected payments := v4.GetProp12Payments() @@ -92,7 +92,7 @@ func (suite *UpgradeTestSuite) TestUpgradePayments() { total += amount } - //check that the total paid out was as expected + // check that the total paid out was as expected suite.Require().Equal(total, int64(367926557424)) expectedBal := 1000000000000 - total @@ -122,7 +122,6 @@ func (suite *UpgradeTestSuite) TestUpgradePayments() { tc.pre_update() tc.update() tc.post_update() - }) } } diff --git a/app/upgrades/v5/upgrades.go b/app/upgrades/v5/upgrades.go index d7cb25c5c94..cf0a4c84414 100644 --- a/app/upgrades/v5/upgrades.go +++ b/app/upgrades/v5/upgrades.go @@ -1,15 +1,16 @@ package v5 import ( + connectionkeeper "github.com/cosmos/ibc-go/v2/modules/core/03-connection/keeper" + ibcconnectiontypes "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types" + bech32ibctypes "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - connectionkeeper "github.com/cosmos/ibc-go/v2/modules/core/03-connection/keeper" - ibcconnectiontypes "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types" - bech32ibctypes "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/types" gammkeeper "github.com/osmosis-labs/osmosis/v7/x/gamm/keeper" "github.com/osmosis-labs/osmosis/v7/x/txfees" diff --git a/app/upgrades/v7/upgrades.go b/app/upgrades/v7/upgrades.go index 8e4afa082e7..d819db043e4 100644 --- a/app/upgrades/v7/upgrades.go +++ b/app/upgrades/v7/upgrades.go @@ -3,6 +3,7 @@ package v7 import ( "github.com/CosmWasm/wasmd/x/wasm" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" diff --git a/app/wasm/bindings/types_test.go b/app/wasm/bindings/types_test.go index d3c0e5670d8..ae2c9ce154c 100644 --- a/app/wasm/bindings/types_test.go +++ b/app/wasm/bindings/types_test.go @@ -2,10 +2,11 @@ package wasmbindings import ( "encoding/json" + "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "testing" ) var ( diff --git a/app/wasm/test/custom_msg_test.go b/app/wasm/test/custom_msg_test.go index 25477567edc..8b10300b37f 100644 --- a/app/wasm/test/custom_msg_test.go +++ b/app/wasm/test/custom_msg_test.go @@ -395,7 +395,7 @@ func TestSwapMsg(t *testing.T) { func prepareSwapState(t *testing.T, ctx sdk.Context, osmosis *app.OsmosisApp) BaseState { actor := RandomAccountAddress() - var swapperFunds = sdk.NewCoins( + swapperFunds := sdk.NewCoins( sdk.NewInt64Coin("uatom", 333000000), sdk.NewInt64Coin("uosmo", 555000000+3*poolFee), sdk.NewInt64Coin("uregen", 777000000), diff --git a/app/wasm/test/helpers_test.go b/app/wasm/test/helpers_test.go index aa0f2e25a15..bebc1938ef0 100644 --- a/app/wasm/test/helpers_test.go +++ b/app/wasm/test/helpers_test.go @@ -6,12 +6,13 @@ import ( "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/ed25519" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/v7/app" ) diff --git a/app/wasm/test/messages_test.go b/app/wasm/test/messages_test.go index 8d1b45b8d73..73ba91246b0 100644 --- a/app/wasm/test/messages_test.go +++ b/app/wasm/test/messages_test.go @@ -1,12 +1,13 @@ package wasm import ( + "math" + "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/app/wasm" wasmbindings "github.com/osmosis-labs/osmosis/v7/app/wasm/bindings" "github.com/stretchr/testify/assert" - "math" - "testing" "github.com/stretchr/testify/require" ) @@ -334,7 +335,6 @@ func TestSwap(t *testing.T) { assert.InEpsilonf(t, (*spec.expCost.Out).ToDec().MustFloat64(), (*gotAmount.Out).ToDec().MustFloat64(), epsilon, "exp %s but got %s", spec.expCost.Out.String(), gotAmount.Out.String()) }) } - } func TestSwapMultiHop(t *testing.T) { @@ -517,5 +517,4 @@ func TestSwapMultiHop(t *testing.T) { assert.InEpsilonf(t, (*spec.expCost.Out).ToDec().MustFloat64(), (*gotAmount.Out).ToDec().MustFloat64(), epsilon, "exp %s but got %s", spec.expCost.Out.String(), gotAmount.Out.String()) }) } - } diff --git a/app/wasm/test/queries_test.go b/app/wasm/test/queries_test.go index 88855d1888a..2e29eefa287 100644 --- a/app/wasm/test/queries_test.go +++ b/app/wasm/test/queries_test.go @@ -486,5 +486,4 @@ func TestEstimateSwap(t *testing.T) { assert.InEpsilonf(t, (*spec.expCost.Out).ToDec().MustFloat64(), (*gotCost.Out).ToDec().MustFloat64(), epsilon, "exp %s but got %s", spec.expCost.Out.String(), gotCost.Out.String()) }) } - } diff --git a/app/wasm/test/store_run_test.go b/app/wasm/test/store_run_test.go index 8b24bc149c8..92c44d385f7 100644 --- a/app/wasm/test/store_run_test.go +++ b/app/wasm/test/store_run_test.go @@ -10,6 +10,7 @@ import ( "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/CosmWasm/wasmd/x/wasm/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/app" @@ -50,7 +51,6 @@ func storeCodeViaProposal(t *testing.T, ctx sdk.Context, osmosis *app.OsmosisApp handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute()) err = handler(ctx, storedProposal.GetContent()) require.NoError(t, err) - } func TestStoreCodeProposal(t *testing.T) { diff --git a/cmd/osmosisd/cmd/balances_from_state_export.go b/cmd/osmosisd/cmd/balances_from_state_export.go index ca89d080fcf..0474855408e 100644 --- a/cmd/osmosisd/cmd/balances_from_state_export.go +++ b/cmd/osmosisd/cmd/balances_from_state_export.go @@ -6,12 +6,6 @@ import ( "io/ioutil" "os" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/server" - 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" appparams "github.com/osmosis-labs/osmosis/v7/app/params" "github.com/osmosis-labs/osmosis/v7/osmoutils" claimtypes "github.com/osmosis-labs/osmosis/v7/x/claim/types" @@ -20,6 +14,13 @@ import ( "github.com/spf13/cobra" tmjson "github.com/tendermint/tendermint/libs/json" tmtypes "github.com/tendermint/tendermint/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/server" + 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" ) const FlagSelectPoolIds = "breakdown-by-pool-ids" diff --git a/cmd/osmosisd/cmd/genwasm.go b/cmd/osmosisd/cmd/genwasm.go index ee58db9ef3a..14e601e7901 100644 --- a/cmd/osmosisd/cmd/genwasm.go +++ b/cmd/osmosisd/cmd/genwasm.go @@ -1,9 +1,10 @@ package cmd import ( - "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" + wasmcli "github.com/CosmWasm/wasmd/x/wasm/client/cli" ) diff --git a/cmd/osmosisd/cmd/root.go b/cmd/osmosisd/cmd/root.go index 2e66a144dd4..179ff6b0823 100644 --- a/cmd/osmosisd/cmd/root.go +++ b/cmd/osmosisd/cmd/root.go @@ -9,6 +9,13 @@ import ( "github.com/osmosis-labs/osmosis/v7/app/params" + "github.com/spf13/cast" + "github.com/spf13/cobra" + tmcmds "github.com/tendermint/tendermint/cmd/tendermint/commands" + tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" @@ -28,12 +35,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - "github.com/spf13/cast" - "github.com/spf13/cobra" - tmcmds "github.com/tendermint/tendermint/cmd/tendermint/commands" - tmcli "github.com/tendermint/tendermint/libs/cli" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" diff --git a/simapp/sim_test.go b/simapp/sim_test.go index 92f5e217d75..dcc053d009c 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -7,16 +7,17 @@ import ( "os" "testing" + "github.com/osmosis-labs/osmosis/v7/app" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/baseapp" sdkSimapp "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/simapp/helpers" "github.com/cosmos/cosmos-sdk/store" simulation2 "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/osmosis-labs/osmosis/v7/app" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" ) // Profile with: diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 53bf8cbd67c..1704ca1f296 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -363,7 +363,7 @@ func (s *IntegrationTestSuite) runIBCRelayer() { gaiaBVal := s.chainB.validators[0] hermesCfgPath := path.Join(tmpDir, "hermes") - s.Require().NoError(os.MkdirAll(hermesCfgPath, 0755)) + s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) _, err = copyFile( filepath.Join("./scripts/", "hermes_bootstrap.sh"), filepath.Join(hermesCfgPath, "hermes_bootstrap.sh"), diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 8be7b7dd446..65e53a8db5a 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -50,7 +50,6 @@ func (s *IntegrationTestSuite) TestQueryBalances() { s.Require().ElementsMatch(expectedBalancesA, actualBalancesA) s.Require().ElementsMatch(expectedDenomsB, actualDenomsB) s.Require().ElementsMatch(expectedBalancesB, actualBalancesB) - } func queryBalances(endpoint, addr string) (sdk.Coins, error) { diff --git a/tests/e2e/io.go b/tests/e2e/io.go index 97bfac75dce..9fa57132e25 100644 --- a/tests/e2e/io.go +++ b/tests/e2e/io.go @@ -39,5 +39,5 @@ func writeFile(path string, body []byte) error { return err } - return ioutil.WriteFile(path, body, 0600) + return ioutil.WriteFile(path, body, 0o600) } diff --git a/tests/e2e/validator.go b/tests/e2e/validator.go index 6c7941614c6..9e1b4da63da 100644 --- a/tests/e2e/validator.go +++ b/tests/e2e/validator.go @@ -49,7 +49,7 @@ func (v *validator) configDir() string { func (v *validator) createConfig() error { p := path.Join(v.configDir(), "config") - return os.MkdirAll(p, 0755) + return os.MkdirAll(p, 0o755) } func (v *validator) init() error { @@ -109,12 +109,12 @@ func (v *validator) createConsensusKey() error { config.Moniker = v.moniker pvKeyFile := config.PrivValidatorKeyFile() - if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0777); err != nil { + if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0o777); err != nil { return err } pvStateFile := config.PrivValidatorStateFile() - if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0777); err != nil { + if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0o777); err != nil { return err } diff --git a/v043_temp/address/hash_test.go b/v043_temp/address/hash_test.go index ae712c18dd4..06fede65948 100644 --- a/v043_temp/address/hash_test.go +++ b/v043_temp/address/hash_test.go @@ -63,7 +63,7 @@ func (suite *AddressSuite) TestComposed() { func (suite *AddressSuite) TestModule() { assert := suite.Assert() - var modName, key = "myModule", []byte{1, 2} + modName, key := "myModule", []byte{1, 2} addr := Module(modName, key) assert.Len(addr, Len, "must have address length") @@ -77,7 +77,7 @@ func (suite *AddressSuite) TestModule() { func (suite *AddressSuite) TestDerive() { assert := suite.Assert() - var addr, key1, key2 = []byte{1, 2}, []byte{3, 4}, []byte{1, 2} + addr, key1, key2 := []byte{1, 2}, []byte{3, 4}, []byte{1, 2} d1 := Derive(addr, key1) d2 := Derive(addr, key2) d3 := Derive(key1, key2) diff --git a/x/claim/abci.go b/x/claim/abci.go index a810418ba0f..3a884379370 100644 --- a/x/claim/abci.go +++ b/x/claim/abci.go @@ -1,8 +1,9 @@ package claim import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/claim/keeper" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // EndBlocker called every block, process inflation, update validator set. diff --git a/x/claim/client/cli/cli_test.go b/x/claim/client/cli/cli_test.go index 870faf44211..9340a87dbe9 100644 --- a/x/claim/client/cli/cli_test.go +++ b/x/claim/client/cli/cli_test.go @@ -6,9 +6,6 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/app/params" "github.com/osmosis-labs/osmosis/v7/x/claim/client/cli" @@ -16,10 +13,16 @@ import ( claimtypes "github.com/osmosis-labs/osmosis/v7/x/claim/types" "github.com/stretchr/testify/suite" tmcli "github.com/tendermint/tendermint/libs/cli" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/cosmos/cosmos-sdk/testutil/network" + sdk "github.com/cosmos/cosmos-sdk/types" ) -var addr1 sdk.AccAddress -var addr2 sdk.AccAddress +var ( + addr1 sdk.AccAddress + addr2 sdk.AccAddress +) func init() { params.SetAddressPrefixes() diff --git a/x/claim/client/cli/query.go b/x/claim/client/cli/query.go index 0a756697245..72dd9e17ec1 100644 --- a/x/claim/client/cli/query.go +++ b/x/claim/client/cli/query.go @@ -5,11 +5,12 @@ import ( "fmt" "strings" + "github.com/osmosis-labs/osmosis/v7/x/claim/types" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - "github.com/osmosis-labs/osmosis/v7/x/claim/types" - "github.com/spf13/cobra" ) // GetQueryCmd returns the cli query commands for this module. diff --git a/x/claim/client/cli/tx.go b/x/claim/client/cli/tx.go index 3e212682ec2..9aef77998c7 100644 --- a/x/claim/client/cli/tx.go +++ b/x/claim/client/cli/tx.go @@ -3,9 +3,10 @@ package cli import ( "fmt" - "github.com/cosmos/cosmos-sdk/client" "github.com/osmosis-labs/osmosis/v7/x/claim/types" "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" ) // GetTxCmd returns the transaction commands for this module. diff --git a/x/claim/genesis_test.go b/x/claim/genesis_test.go index f62f0152141..ca93849febb 100644 --- a/x/claim/genesis_test.go +++ b/x/claim/genesis_test.go @@ -4,39 +4,42 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" simapp "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/claim" "github.com/osmosis-labs/osmosis/v7/x/claim/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) -var now = time.Now().UTC() -var acc1 = sdk.AccAddress([]byte("addr1---------------")) -var acc2 = sdk.AccAddress([]byte("addr2---------------")) -var testGenesis = types.GenesisState{ - ModuleAccountBalance: sdk.NewInt64Coin(types.DefaultClaimDenom, 750000000), - Params: types.Params{ - AirdropStartTime: now, - DurationUntilDecay: types.DefaultDurationUntilDecay, - DurationOfDecay: types.DefaultDurationOfDecay, - ClaimDenom: types.DefaultClaimDenom, // uosmo - }, - ClaimRecords: []types.ClaimRecord{ - { - Address: acc1.String(), - InitialClaimableAmount: sdk.Coins{sdk.NewInt64Coin(types.DefaultClaimDenom, 1000000000)}, - ActionCompleted: []bool{true, false, true, true}, +var ( + now = time.Now().UTC() + acc1 = sdk.AccAddress([]byte("addr1---------------")) + acc2 = sdk.AccAddress([]byte("addr2---------------")) + testGenesis = types.GenesisState{ + ModuleAccountBalance: sdk.NewInt64Coin(types.DefaultClaimDenom, 750000000), + Params: types.Params{ + AirdropStartTime: now, + DurationUntilDecay: types.DefaultDurationUntilDecay, + DurationOfDecay: types.DefaultDurationOfDecay, + ClaimDenom: types.DefaultClaimDenom, // uosmo }, - { - Address: acc2.String(), - InitialClaimableAmount: sdk.Coins{sdk.NewInt64Coin(types.DefaultClaimDenom, 500000000)}, - ActionCompleted: []bool{false, false, false, false}, + ClaimRecords: []types.ClaimRecord{ + { + Address: acc1.String(), + InitialClaimableAmount: sdk.Coins{sdk.NewInt64Coin(types.DefaultClaimDenom, 1000000000)}, + ActionCompleted: []bool{true, false, true, true}, + }, + { + Address: acc2.String(), + InitialClaimableAmount: sdk.Coins{sdk.NewInt64Coin(types.DefaultClaimDenom, 500000000)}, + ActionCompleted: []bool{false, false, false, false}, + }, }, - }, -} + } +) func TestClaimInitGenesis(t *testing.T) { app := simapp.Setup(false) diff --git a/x/claim/handler.go b/x/claim/handler.go index 4521d250f8b..a1580932179 100644 --- a/x/claim/handler.go +++ b/x/claim/handler.go @@ -3,10 +3,11 @@ package claim import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/v7/x/claim/keeper" "github.com/osmosis-labs/osmosis/v7/x/claim/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler returns claim module messages. diff --git a/x/claim/keeper/claim.go b/x/claim/keeper/claim.go index 197c4c5c4a9..2d6769e18be 100644 --- a/x/claim/keeper/claim.go +++ b/x/claim/keeper/claim.go @@ -3,11 +3,12 @@ package keeper import ( "fmt" + "github.com/gogo/protobuf/proto" + "github.com/osmosis-labs/osmosis/v7/x/claim/types" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/gogo/protobuf/proto" - "github.com/osmosis-labs/osmosis/v7/x/claim/types" ) // GetModuleAccountBalance gets the airdrop coin balance of module account. diff --git a/x/claim/keeper/claim_test.go b/x/claim/keeper/claim_test.go index 69c184b9aa6..1f8702d13ff 100644 --- a/x/claim/keeper/claim_test.go +++ b/x/claim/keeper/claim_test.go @@ -3,13 +3,14 @@ package keeper_test import ( "time" + "github.com/osmosis-labs/osmosis/v7/x/claim/types" + "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" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/osmosis-labs/osmosis/v7/x/claim/types" ) func (suite *KeeperTestSuite) TestHookOfUnclaimableAccount() { diff --git a/x/claim/keeper/grpc_query.go b/x/claim/keeper/grpc_query.go index 5cd99ff38a6..4362de13172 100644 --- a/x/claim/keeper/grpc_query.go +++ b/x/claim/keeper/grpc_query.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/claim/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + sdk "github.com/cosmos/cosmos-sdk/types" ) var _ types.QueryServer = Querier{} diff --git a/x/claim/keeper/hooks.go b/x/claim/keeper/hooks.go index 5bc99d52d2e..5ebedd05b61 100644 --- a/x/claim/keeper/hooks.go +++ b/x/claim/keeper/hooks.go @@ -1,11 +1,12 @@ package keeper import ( + "github.com/osmosis-labs/osmosis/v7/x/claim/types" + gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/osmosis-labs/osmosis/v7/x/claim/types" - gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" ) func (k Keeper) AfterAddLiquidity(ctx sdk.Context, sender sdk.AccAddress) { diff --git a/x/claim/keeper/keeper.go b/x/claim/keeper/keeper.go index f3cd0853669..ec6333c3be4 100644 --- a/x/claim/keeper/keeper.go +++ b/x/claim/keeper/keeper.go @@ -5,9 +5,10 @@ import ( "github.com/tendermint/tendermint/libs/log" + "github.com/osmosis-labs/osmosis/v7/x/claim/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/osmosis-labs/osmosis/v7/x/claim/types" ) // Keeper struct. diff --git a/x/claim/keeper/keeper_test.go b/x/claim/keeper/keeper_test.go index f226fce74d3..31d18839159 100644 --- a/x/claim/keeper/keeper_test.go +++ b/x/claim/keeper/keeper_test.go @@ -4,11 +4,12 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/claim/types" "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) type KeeperTestSuite struct { diff --git a/x/claim/keeper/params.go b/x/claim/keeper/params.go index 438bed706ba..0d892a6764c 100644 --- a/x/claim/keeper/params.go +++ b/x/claim/keeper/params.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/claim/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // GetParams get params. diff --git a/x/claim/module.go b/x/claim/module.go index f8f274acc06..f90a7d9b48f 100644 --- a/x/claim/module.go +++ b/x/claim/module.go @@ -11,15 +11,16 @@ import ( abci "github.com/tendermint/tendermint/abci/types" + "github.com/osmosis-labs/osmosis/v7/x/claim/client/cli" + "github.com/osmosis-labs/osmosis/v7/x/claim/client/rest" + "github.com/osmosis-labs/osmosis/v7/x/claim/keeper" + "github.com/osmosis-labs/osmosis/v7/x/claim/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/osmosis-labs/osmosis/v7/x/claim/client/cli" - "github.com/osmosis-labs/osmosis/v7/x/claim/client/rest" - "github.com/osmosis-labs/osmosis/v7/x/claim/keeper" - "github.com/osmosis-labs/osmosis/v7/x/claim/types" ) var ( diff --git a/x/epochs/abci.go b/x/epochs/abci.go index 48d9048a02e..5406d89afe9 100644 --- a/x/epochs/abci.go +++ b/x/epochs/abci.go @@ -4,10 +4,11 @@ import ( "fmt" "time" - "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/epochs/keeper" "github.com/osmosis-labs/osmosis/v7/x/epochs/types" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" ) // BeginBlocker of epochs module. diff --git a/x/epochs/abci_test.go b/x/epochs/abci_test.go index 018c3c46f54..437c1002909 100644 --- a/x/epochs/abci_test.go +++ b/x/epochs/abci_test.go @@ -4,12 +4,13 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" simapp "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/epochs" "github.com/osmosis-labs/osmosis/v7/x/epochs/types" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { diff --git a/x/epochs/client/cli/cli_test.go b/x/epochs/client/cli/cli_test.go index 1880f0eeb93..c30a1d8d20a 100644 --- a/x/epochs/client/cli/cli_test.go +++ b/x/epochs/client/cli/cli_test.go @@ -4,11 +4,12 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/suite" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/epochs/client/cli" "github.com/osmosis-labs/osmosis/v7/x/epochs/types" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/cosmos/cosmos-sdk/testutil/network" ) type IntegrationTestSuite struct { diff --git a/x/epochs/client/cli/query.go b/x/epochs/client/cli/query.go index 00b9df9e431..69943e34ad0 100644 --- a/x/epochs/client/cli/query.go +++ b/x/epochs/client/cli/query.go @@ -4,11 +4,12 @@ import ( "fmt" "strings" + "github.com/osmosis-labs/osmosis/v7/x/epochs/types" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - "github.com/osmosis-labs/osmosis/v7/x/epochs/types" - "github.com/spf13/cobra" ) // GetQueryCmd returns the cli query commands for this module. diff --git a/x/epochs/genesis.go b/x/epochs/genesis.go index 72e7eb4f447..57aefc50fb4 100644 --- a/x/epochs/genesis.go +++ b/x/epochs/genesis.go @@ -3,9 +3,10 @@ package epochs import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/epochs/keeper" "github.com/osmosis-labs/osmosis/v7/x/epochs/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/epochs/genesis_test.go b/x/epochs/genesis_test.go index 588e100f8df..480f1bcd8f0 100644 --- a/x/epochs/genesis_test.go +++ b/x/epochs/genesis_test.go @@ -52,7 +52,7 @@ func TestEpochsInitGenesis(t *testing.T) { ctx = ctx.WithBlockHeight(1) ctx = ctx.WithBlockTime(now) - //test genesisState validation + // test genesisState validation genesisState := types.GenesisState{ Epochs: []types.EpochInfo{ { diff --git a/x/epochs/handler.go b/x/epochs/handler.go index f6a83716f9e..d0c49e4e9be 100644 --- a/x/epochs/handler.go +++ b/x/epochs/handler.go @@ -3,10 +3,11 @@ package epochs import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/v7/x/epochs/keeper" "github.com/osmosis-labs/osmosis/v7/x/epochs/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler returns a handler for epochs module messages. diff --git a/x/epochs/keeper/epoch.go b/x/epochs/keeper/epoch.go index f02659d2eaa..53b82a426bc 100644 --- a/x/epochs/keeper/epoch.go +++ b/x/epochs/keeper/epoch.go @@ -3,9 +3,10 @@ package keeper import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/protobuf/proto" "github.com/osmosis-labs/osmosis/v7/x/epochs/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // GetEpochInfo returns epoch info by identifier. diff --git a/x/epochs/keeper/keeper.go b/x/epochs/keeper/keeper.go index 157aa6549ef..6ae659d3e71 100644 --- a/x/epochs/keeper/keeper.go +++ b/x/epochs/keeper/keeper.go @@ -3,10 +3,11 @@ package keeper import ( "fmt" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/epochs/types" "github.com/tendermint/tendermint/libs/log" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" ) type ( diff --git a/x/epochs/keeper/keeper_test.go b/x/epochs/keeper/keeper_test.go index d5443f9ce31..91a6b111ef7 100644 --- a/x/epochs/keeper/keeper_test.go +++ b/x/epochs/keeper/keeper_test.go @@ -3,13 +3,14 @@ package keeper_test import ( "testing" - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/epochs/keeper" "github.com/osmosis-labs/osmosis/v7/x/epochs/types" "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" ) type KeeperTestSuite struct { diff --git a/x/epochs/module.go b/x/epochs/module.go index d97b1b62b17..bad7cd8c1fe 100644 --- a/x/epochs/module.go +++ b/x/epochs/module.go @@ -6,16 +6,17 @@ import ( "fmt" "math/rand" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/osmosis-labs/osmosis/v7/x/epochs/client/cli" "github.com/osmosis-labs/osmosis/v7/x/epochs/client/rest" diff --git a/x/epochs/simulation/genesis.go b/x/epochs/simulation/genesis.go index e371ed8474b..a477cbe0e74 100644 --- a/x/epochs/simulation/genesis.go +++ b/x/epochs/simulation/genesis.go @@ -7,8 +7,9 @@ import ( "fmt" "time" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/osmosis-labs/osmosis/v7/x/epochs/types" + + "github.com/cosmos/cosmos-sdk/types/module" ) // RandomizedGenState generates a random GenesisState for mint. diff --git a/x/gamm/client/cli/cli_test.go b/x/gamm/client/cli/cli_test.go index 271c4ef1f58..9c4498af2e7 100644 --- a/x/gamm/client/cli/cli_test.go +++ b/x/gamm/client/cli/cli_test.go @@ -7,6 +7,14 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/suite" + "github.com/osmosis-labs/osmosis/v7/app" + "github.com/osmosis-labs/osmosis/v7/osmoutils" + "github.com/osmosis-labs/osmosis/v7/x/gamm/client/cli" + gammtestutil "github.com/osmosis-labs/osmosis/v7/x/gamm/client/testutil" + "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -15,13 +23,6 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" - "github.com/osmosis-labs/osmosis/v7/app" - "github.com/osmosis-labs/osmosis/v7/osmoutils" - "github.com/osmosis-labs/osmosis/v7/x/gamm/client/cli" - gammtestutil "github.com/osmosis-labs/osmosis/v7/x/gamm/client/testutil" - "github.com/osmosis-labs/osmosis/v7/x/gamm/types" - gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" - tmcli "github.com/tendermint/tendermint/libs/cli" ) type IntegrationTestSuite struct { diff --git a/x/gamm/client/cli/tx.go b/x/gamm/client/cli/tx.go index 66169169c54..6d71303f05a 100644 --- a/x/gamm/client/cli/tx.go +++ b/x/gamm/client/cli/tx.go @@ -10,13 +10,14 @@ import ( "github.com/spf13/cobra" flag "github.com/spf13/pflag" + "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" + "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + "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" - "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" - "github.com/osmosis-labs/osmosis/v7/x/gamm/types" ) func NewTxCmd() *cobra.Command { diff --git a/x/gamm/client/rest/api.go b/x/gamm/client/rest/api.go index f093278e354..6947813955f 100644 --- a/x/gamm/client/rest/api.go +++ b/x/gamm/client/rest/api.go @@ -1,8 +1,9 @@ package rest import ( - "github.com/cosmos/cosmos-sdk/client" "github.com/gorilla/mux" + + "github.com/cosmos/cosmos-sdk/client" ) func RegisterHandlers(ctx client.Context, r *mux.Router) { diff --git a/x/gamm/client/testutil/test_helpers.go b/x/gamm/client/testutil/test_helpers.go index 48ab1d4337b..630ecae2dd4 100644 --- a/x/gamm/client/testutil/test_helpers.go +++ b/x/gamm/client/testutil/test_helpers.go @@ -4,12 +4,13 @@ import ( "fmt" "testing" + gammcli "github.com/osmosis-labs/osmosis/v7/x/gamm/client/cli" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" - gammcli "github.com/osmosis-labs/osmosis/v7/x/gamm/client/cli" ) // commonArgs is args for CLI test commands. diff --git a/x/gamm/handler.go b/x/gamm/handler.go index fd5a51a943d..d9385638a7a 100644 --- a/x/gamm/handler.go +++ b/x/gamm/handler.go @@ -1,11 +1,12 @@ package gamm import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/v7/x/gamm/keeper" "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler returns a handler for "gamm" type messages. diff --git a/x/gamm/keeper/gas_test.go b/x/gamm/keeper/gas_test.go index e8e54a846ec..9c8fc8e964f 100644 --- a/x/gamm/keeper/gas_test.go +++ b/x/gamm/keeper/gas_test.go @@ -4,11 +4,12 @@ import ( "fmt" "strconv" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" balancertypes "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" ) var ( @@ -20,7 +21,8 @@ var ( func (suite *KeeperTestSuite) measureJoinPoolGas( addr sdk.AccAddress, poolID uint64, - shareOutAmountMax sdk.Int, maxCoins sdk.Coins) uint64 { + shareOutAmountMax sdk.Int, maxCoins sdk.Coins, +) uint64 { alreadySpent := suite.ctx.GasMeter().GasConsumed() err := suite.app.GAMMKeeper.JoinPoolNoSwap(suite.ctx, addr, poolID, shareOutAmountMax, maxCoins) suite.Require().NoError(err) @@ -36,7 +38,8 @@ func (suite *KeeperTestSuite) measureAvgAndMaxJoinPoolGas( addr sdk.AccAddress, poolIDFn func(int) uint64, shareOutAmountMaxFn func(int) sdk.Int, - maxCoinsFn func(int) sdk.Coins) (avg uint64, maxGas uint64) { + maxCoinsFn func(int) sdk.Coins, +) (avg uint64, maxGas uint64) { runningTotal := uint64(0) maxGas = uint64(0) for i := 1; i <= numIterations; i++ { diff --git a/x/gamm/keeper/grpc_query.go b/x/gamm/keeper/grpc_query.go index 8b1f24d77a6..f95f037c324 100644 --- a/x/gamm/keeper/grpc_query.go +++ b/x/gamm/keeper/grpc_query.go @@ -5,13 +5,14 @@ import ( "fmt" "math/big" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v7/x/gamm/types" diff --git a/x/gamm/keeper/keeper.go b/x/gamm/keeper/keeper.go index 1722e21595f..183bdf1c878 100644 --- a/x/gamm/keeper/keeper.go +++ b/x/gamm/keeper/keeper.go @@ -4,11 +4,12 @@ import ( "fmt" "strconv" + "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/osmosis-labs/osmosis/v7/x/gamm/types" ) func permContains(perms []string, perm string) bool { diff --git a/x/gamm/keeper/keeper_test.go b/x/gamm/keeper/keeper_test.go index d858c1764d6..c658bf1f73e 100644 --- a/x/gamm/keeper/keeper_test.go +++ b/x/gamm/keeper/keeper_test.go @@ -3,13 +3,14 @@ package keeper_test import ( "testing" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" "github.com/tendermint/tendermint/crypto/ed25519" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/gamm/keeper" "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" diff --git a/x/gamm/keeper/marshal_bench_test.go b/x/gamm/keeper/marshal_bench_test.go index fc5a04d0516..f9f0f9db9a0 100644 --- a/x/gamm/keeper/marshal_bench_test.go +++ b/x/gamm/keeper/marshal_bench_test.go @@ -5,12 +5,13 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" balancertypes "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) func genPoolAssets(r *rand.Rand) []balancertypes.PoolAsset { diff --git a/x/gamm/keeper/params.go b/x/gamm/keeper/params.go index 6353bcadaff..5a65da4960a 100644 --- a/x/gamm/keeper/params.go +++ b/x/gamm/keeper/params.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // GetParams returns the total set params. diff --git a/x/gamm/keeper/pool.go b/x/gamm/keeper/pool.go index 655c6e5d8fb..326246b6866 100644 --- a/x/gamm/keeper/pool.go +++ b/x/gamm/keeper/pool.go @@ -3,9 +3,10 @@ package keeper import ( "fmt" + gogotypes "github.com/gogo/protobuf/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - gogotypes "github.com/gogo/protobuf/types" "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" "github.com/osmosis-labs/osmosis/v7/x/gamm/types" diff --git a/x/gamm/keeper/pool_service.go b/x/gamm/keeper/pool_service.go index 54034a03b1d..aafea76d787 100644 --- a/x/gamm/keeper/pool_service.go +++ b/x/gamm/keeper/pool_service.go @@ -53,7 +53,8 @@ func (k Keeper) validateCreatedPool( ctx sdk.Context, initialPoolLiquidity sdk.Coins, poolId uint64, - pool types.PoolI) error { + pool types.PoolI, +) error { if pool.GetId() != poolId { return sdkerrors.Wrapf(types.ErrInvalidPool, "Pool was attempted to be created with incorrect pool ID.") diff --git a/x/gamm/module.go b/x/gamm/module.go index c184f8f88a3..be2be578eee 100644 --- a/x/gamm/module.go +++ b/x/gamm/module.go @@ -6,6 +6,11 @@ import ( "fmt" "math/rand" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "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" @@ -13,10 +18,6 @@ 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/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/osmosis-labs/osmosis/v7/x/gamm/client/cli" "github.com/osmosis-labs/osmosis/v7/x/gamm/client/rest" diff --git a/x/gamm/pool-models/balancer/balancer_pool.go b/x/gamm/pool-models/balancer/balancer_pool.go index 0efdfa8550b..9fc62c844fd 100644 --- a/x/gamm/pool-models/balancer/balancer_pool.go +++ b/x/gamm/pool-models/balancer/balancer_pool.go @@ -239,7 +239,8 @@ func (pa Pool) getPoolAssetAndIndex(denom string) (int, PoolAsset, error) { } func (p Pool) parsePoolAssetsByDenoms(tokenADenom, tokenBDenom string) ( - Aasset PoolAsset, Basset PoolAsset, err error) { + Aasset PoolAsset, Basset PoolAsset, err error, +) { Aasset, found1 := GetPoolAssetByDenom(p.PoolAssets, tokenADenom) Basset, found2 := GetPoolAssetByDenom(p.PoolAssets, tokenBDenom) if !(found1 && found2) { @@ -249,7 +250,8 @@ func (p Pool) parsePoolAssetsByDenoms(tokenADenom, tokenBDenom string) ( } func (p Pool) parsePoolAssets(tokensA sdk.Coins, tokenBDenom string) ( - tokenA sdk.Coin, Aasset PoolAsset, Basset PoolAsset, err error) { + tokenA sdk.Coin, Aasset PoolAsset, Basset PoolAsset, err error, +) { if len(tokensA) != 1 { return tokenA, Aasset, Basset, errors.New("expected tokensB to be of length one") } @@ -258,7 +260,8 @@ func (p Pool) parsePoolAssets(tokensA sdk.Coins, tokenBDenom string) ( } func (p Pool) parsePoolAssetsCoins(tokensA sdk.Coins, tokensB sdk.Coins) ( - Aasset PoolAsset, Basset PoolAsset, err error) { + Aasset PoolAsset, Basset PoolAsset, err error, +) { if len(tokensB) != 1 { return Aasset, Basset, errors.New("expected tokensA to be of length one") } diff --git a/x/gamm/pool-models/balancer/balancer_pool_test.go b/x/gamm/pool-models/balancer/balancer_pool_test.go index 85e6040ef6a..646b8d6f351 100644 --- a/x/gamm/pool-models/balancer/balancer_pool_test.go +++ b/x/gamm/pool-models/balancer/balancer_pool_test.go @@ -5,8 +5,9 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) var ( @@ -563,5 +564,4 @@ func TestBalancerPoolPokeTokenWeights(t *testing.T) { // Should have been deleted by the last test case of after PokeTokenWeights pokes past end time. require.Nil(t, pacc.PoolParams.SmoothWeightChangeParams) } - } diff --git a/x/gamm/pool-models/balancer/codec.go b/x/gamm/pool-models/balancer/codec.go index 2bd12699993..9e7cd9192a8 100644 --- a/x/gamm/pool-models/balancer/codec.go +++ b/x/gamm/pool-models/balancer/codec.go @@ -1,11 +1,12 @@ package balancer import ( + types "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + "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/msgservice" - types "github.com/osmosis-labs/osmosis/v7/x/gamm/types" ) // RegisterLegacyAminoCodec registers the necessary x/gamm interfaces and concrete types diff --git a/x/gamm/pool-models/balancer/marshal_test.go b/x/gamm/pool-models/balancer/marshal_test.go index c079598207e..867886fde20 100644 --- a/x/gamm/pool-models/balancer/marshal_test.go +++ b/x/gamm/pool-models/balancer/marshal_test.go @@ -54,7 +54,6 @@ func TestPoolJson(t *testing.T) { } func TestPoolProtoMarshal(t *testing.T) { - // hex of serialzied poolI from v6.x decodedByteArray, err := hex.DecodeString("0a3f6f736d6f316b727033387a7a63337a7a356173396e64716b79736b686b7a76367839653330636b63713567346c637375357770776371793073613364656132100a1a260a113235303030303030303030303030303030121132353030303030303030303030303030302a110a0c67616d6d2f706f6f6c2f3130120130321e0a0e0a05746573743112053130303030120c313037333734313832343030321e0a0e0a05746573743212053530303030120c3231343734383336343830303a0c333232313232353437323030") require.NoError(t, err) diff --git a/x/gamm/pool-models/balancer/msgs.go b/x/gamm/pool-models/balancer/msgs.go index c4db7cfa640..f5012b34ed5 100644 --- a/x/gamm/pool-models/balancer/msgs.go +++ b/x/gamm/pool-models/balancer/msgs.go @@ -11,14 +11,17 @@ const ( TypeMsgCreateBalancerPool = "create_balancer_pool" ) -var _ sdk.Msg = &MsgCreateBalancerPool{} -var _ types.CreatePoolMsg = &MsgCreateBalancerPool{} +var ( + _ sdk.Msg = &MsgCreateBalancerPool{} + _ types.CreatePoolMsg = &MsgCreateBalancerPool{} +) func NewMsgCreateBalancerPool( sender sdk.AccAddress, poolParams PoolParams, poolAssets []PoolAsset, - futurePoolGovernor string) MsgCreateBalancerPool { + futurePoolGovernor string, +) MsgCreateBalancerPool { return MsgCreateBalancerPool{ Sender: sender.String(), PoolParams: &poolParams, @@ -74,6 +77,7 @@ func (msg MsgCreateBalancerPool) PoolCreator() sdk.AccAddress { } return sender } + func (msg MsgCreateBalancerPool) Validate(ctx sdk.Context) error { return msg.ValidateBasic() } diff --git a/x/gamm/pool-models/balancer/pool_asset.go b/x/gamm/pool-models/balancer/pool_asset.go index 8d269cfa580..43729f9d409 100644 --- a/x/gamm/pool-models/balancer/pool_asset.go +++ b/x/gamm/pool-models/balancer/pool_asset.go @@ -5,10 +5,11 @@ import ( "sort" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/v7/x/gamm/types" "gopkg.in/yaml.v2" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // Validates a pool asset, to check if it has a valid weight. diff --git a/x/gamm/pool-models/balancer/suite_test.go b/x/gamm/pool-models/balancer/suite_test.go index ccf7ec68e82..cf7123ccf64 100644 --- a/x/gamm/pool-models/balancer/suite_test.go +++ b/x/gamm/pool-models/balancer/suite_test.go @@ -3,10 +3,11 @@ package balancer_test import ( "testing" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/app/apptesting" "github.com/osmosis-labs/osmosis/v7/x/gamm/keeper" diff --git a/x/gamm/pool-models/stableswap/msgs.go b/x/gamm/pool-models/stableswap/msgs.go index 8a87a893851..121f66d4e73 100644 --- a/x/gamm/pool-models/stableswap/msgs.go +++ b/x/gamm/pool-models/stableswap/msgs.go @@ -11,14 +11,17 @@ const ( TypeMsgCreateStableswapPool = "create_stableswap_pool" ) -var _ sdk.Msg = &MsgCreateStableswapPool{} -var _ types.CreatePoolMsg = &MsgCreateStableswapPool{} +var ( + _ sdk.Msg = &MsgCreateStableswapPool{} + _ types.CreatePoolMsg = &MsgCreateStableswapPool{} +) func NewMsgCreateStableswapPool( sender sdk.AccAddress, poolParams PoolParams, initialLiquidity sdk.Coins, - futurePoolGovernor string) MsgCreateStableswapPool { + futurePoolGovernor string, +) MsgCreateStableswapPool { return MsgCreateStableswapPool{ Sender: sender.String(), PoolParams: &poolParams, @@ -71,6 +74,7 @@ func (msg MsgCreateStableswapPool) PoolCreator() sdk.AccAddress { } return sender } + func (msg MsgCreateStableswapPool) Validate(ctx sdk.Context) error { return msg.ValidateBasic() } diff --git a/x/gamm/pool-models/stableswap/pool.go b/x/gamm/pool-models/stableswap/pool.go index 1811d6a8d88..2e66e5c6d30 100644 --- a/x/gamm/pool-models/stableswap/pool.go +++ b/x/gamm/pool-models/stableswap/pool.go @@ -35,6 +35,7 @@ func (pa Pool) GetId() uint64 { func (pa Pool) GetSwapFee(ctx sdk.Context) sdk.Dec { return pa.PoolParams.SwapFee } + func (pa Pool) GetExitFee(ctx sdk.Context) sdk.Dec { return pa.PoolParams.ExitFee } @@ -56,6 +57,7 @@ func (pa Pool) GetTotalShares() sdk.Int { func (pa Pool) CalcOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.DecCoin, err error) { return sdk.DecCoin{}, types.ErrNotImplemented } + func (pa *Pool) SwapOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.Coin, err error) { return sdk.Coin{}, types.ErrNotImplemented } @@ -63,6 +65,7 @@ func (pa *Pool) SwapOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDe func (pa Pool) CalcInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.DecCoin, err error) { return sdk.DecCoin{}, types.ErrNotImplemented } + func (pa *Pool) SwapInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.Coin, err error) { return sdk.Coin{}, types.ErrNotImplemented } @@ -74,6 +77,7 @@ func (pa Pool) SpotPrice(ctx sdk.Context, baseAssetDenom string, quoteAssetDenom func (pa Pool) CalcJoinPoolShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, newLiquidity sdk.Coins, err error) { return sdk.Int{}, sdk.Coins{}, types.ErrNotImplemented } + func (pa *Pool) JoinPool(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, err error) { return sdk.Int{}, types.ErrNotImplemented } diff --git a/x/gamm/simulation/operations.go b/x/gamm/simulation/operations.go index c6b98189dad..ce53a37b330 100644 --- a/x/gamm/simulation/operations.go +++ b/x/gamm/simulation/operations.go @@ -5,18 +5,20 @@ import ( "math/rand" "time" - "github.com/cosmos/cosmos-sdk/baseapp" osmo_simulation "github.com/osmosis-labs/osmosis/v7/x/simulation" + "github.com/cosmos/cosmos-sdk/baseapp" + + "github.com/osmosis-labs/osmosis/v7/x/gamm/keeper" + "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" + "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + "github.com/cosmos/cosmos-sdk/codec" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/osmosis-labs/osmosis/v7/x/gamm/keeper" - "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" - "github.com/osmosis-labs/osmosis/v7/x/gamm/types" ) // Simulation operation weights constants. diff --git a/x/gamm/types/params.go b/x/gamm/types/params.go index 08fe91ff87f..72dfd3d46f4 100644 --- a/x/gamm/types/params.go +++ b/x/gamm/types/params.go @@ -3,9 +3,10 @@ package types import ( "fmt" + appparams "github.com/osmosis-labs/osmosis/v7/app/params" + sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - appparams "github.com/osmosis-labs/osmosis/v7/app/params" ) // Parameter store keys. diff --git a/x/gamm/types/pool.go b/x/gamm/types/pool.go index be697f681e2..38d8bfa31a6 100644 --- a/x/gamm/types/pool.go +++ b/x/gamm/types/pool.go @@ -3,10 +3,11 @@ package types import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" proto "github.com/gogo/protobuf/proto" "github.com/osmosis-labs/osmosis/v7/v043_temp/address" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // PoolI defines an interface for pools that hold tokens. diff --git a/x/incentives/abci_test.go b/x/incentives/abci_test.go index e203cf5c215..9acb9e9af5e 100644 --- a/x/incentives/abci_test.go +++ b/x/incentives/abci_test.go @@ -4,13 +4,14 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" osmoapp "github.com/osmosis-labs/osmosis/v7/app" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestPerpetualGaugeNotExpireAfterDistribution(t *testing.T) { diff --git a/x/incentives/client/cli/cli_test.go b/x/incentives/client/cli/cli_test.go index 752dc1ce416..99c0d51d97a 100644 --- a/x/incentives/client/cli/cli_test.go +++ b/x/incentives/client/cli/cli_test.go @@ -6,11 +6,12 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/suite" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/incentives/client/cli" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/cosmos/cosmos-sdk/testutil/network" ) type IntegrationTestSuite struct { diff --git a/x/incentives/client/cli/query.go b/x/incentives/client/cli/query.go index 4231bcc3abb..d113346e146 100644 --- a/x/incentives/client/cli/query.go +++ b/x/incentives/client/cli/query.go @@ -5,11 +5,12 @@ import ( "strconv" "strings" + "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - "github.com/osmosis-labs/osmosis/v7/x/incentives/types" - "github.com/spf13/cobra" ) // GetQueryCmd returns the cli query commands for this module. diff --git a/x/incentives/client/cli/tx.go b/x/incentives/client/cli/tx.go index bad6068c6ee..1dfad7072dd 100644 --- a/x/incentives/client/cli/tx.go +++ b/x/incentives/client/cli/tx.go @@ -6,13 +6,14 @@ import ( "strconv" "time" + "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/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/osmosis-labs/osmosis/v7/x/incentives/types" - lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" - "github.com/spf13/cobra" ) // GetTxCmd returns the transaction commands for this module. diff --git a/x/incentives/genesis.go b/x/incentives/genesis.go index bc284062257..ce3f3f437b5 100644 --- a/x/incentives/genesis.go +++ b/x/incentives/genesis.go @@ -1,9 +1,10 @@ package incentives import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/keeper" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/incentives/genesis_test.go b/x/incentives/genesis_test.go index 8c2c09a96c5..ebe17d71254 100644 --- a/x/incentives/genesis_test.go +++ b/x/incentives/genesis_test.go @@ -4,14 +4,15 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" osmoapp "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/incentives" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestIncentivesExportGenesis(t *testing.T) { @@ -97,5 +98,4 @@ func TestIncentivesInitGenesis(t *testing.T) { gauges := app.IncentivesKeeper.GetGauges(ctx) require.Len(t, gauges, 1) require.Equal(t, gauges[0], gauge) - } diff --git a/x/incentives/handler.go b/x/incentives/handler.go index 33a27f15bfc..06a8d7630a0 100644 --- a/x/incentives/handler.go +++ b/x/incentives/handler.go @@ -3,10 +3,11 @@ package incentives import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/v7/x/incentives/keeper" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler returns msg handler for this module. diff --git a/x/incentives/keeper/bench_test.go b/x/incentives/keeper/bench_test.go index 5806b2138cc..6c68aab8c7a 100644 --- a/x/incentives/keeper/bench_test.go +++ b/x/incentives/keeper/bench_test.go @@ -6,15 +6,16 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/tendermint/tendermint/crypto/secp256k1" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) func Min(x, y int) int { @@ -47,7 +48,8 @@ func genQueryCondition( r *rand.Rand, blocktime time.Time, coins sdk.Coins, - durationOptions []time.Duration) lockuptypes.QueryCondition { + durationOptions []time.Duration, +) lockuptypes.QueryCondition { lockQueryType := r.Intn(2) denom := coins[r.Intn(len(coins))].Denom durationOption := r.Intn(len(durationOptions)) diff --git a/x/incentives/keeper/distribute.go b/x/incentives/keeper/distribute.go index fd9ab4e4bb2..9946b7d52ee 100644 --- a/x/incentives/keeper/distribute.go +++ b/x/incentives/keeper/distribute.go @@ -4,10 +4,11 @@ import ( "fmt" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" db "github.com/tendermint/tm-db" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (k Keeper) getDistributedCoinsFromGauges(gauges []types.Gauge) sdk.Coins { diff --git a/x/incentives/keeper/distribute_test.go b/x/incentives/keeper/distribute_test.go index 6d30be5224b..e6dc17fddbb 100644 --- a/x/incentives/keeper/distribute_test.go +++ b/x/incentives/keeper/distribute_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // TestDistribute tests that when the distribute command is executed on diff --git a/x/incentives/keeper/gauge.go b/x/incentives/keeper/gauge.go index 2119bd86bd8..0c5bbc1e01a 100644 --- a/x/incentives/keeper/gauge.go +++ b/x/incentives/keeper/gauge.go @@ -6,12 +6,13 @@ import ( "strings" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/protobuf/proto" epochtypes "github.com/osmosis-labs/osmosis/v7/x/epochs/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" db "github.com/tendermint/tm-db" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // Iterate over everything in a gauges iterator, until it reaches the end. Return all gauges iterated over. diff --git a/x/incentives/keeper/gauge_test.go b/x/incentives/keeper/gauge_test.go index f33e52624f4..2b1eeddce72 100644 --- a/x/incentives/keeper/gauge_test.go +++ b/x/incentives/keeper/gauge_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (suite *KeeperTestSuite) TestInvalidDurationGaugeCreationValidation() { diff --git a/x/incentives/keeper/grpc_query.go b/x/incentives/keeper/grpc_query.go index 7d500cad455..2d9c22ca6fe 100644 --- a/x/incentives/keeper/grpc_query.go +++ b/x/incentives/keeper/grpc_query.go @@ -4,12 +4,13 @@ import ( "context" "encoding/json" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" diff --git a/x/incentives/keeper/hooks.go b/x/incentives/keeper/hooks.go index d2f8da30ae5..7caa243606a 100644 --- a/x/incentives/keeper/hooks.go +++ b/x/incentives/keeper/hooks.go @@ -1,10 +1,11 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" epochstypes "github.com/osmosis-labs/osmosis/v7/x/epochs/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) { diff --git a/x/incentives/keeper/iterator.go b/x/incentives/keeper/iterator.go index 383dec9f52b..5222a4df7ed 100644 --- a/x/incentives/keeper/iterator.go +++ b/x/incentives/keeper/iterator.go @@ -3,10 +3,11 @@ package keeper import ( "time" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) // Returns an iterator over all gauges in the {prefix} space of state, that begin distributing rewards after a specific time. diff --git a/x/incentives/keeper/keeper.go b/x/incentives/keeper/keeper.go index d90eac3f59a..11f9023a545 100644 --- a/x/incentives/keeper/keeper.go +++ b/x/incentives/keeper/keeper.go @@ -4,11 +4,12 @@ import ( "fmt" "time" + "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + "github.com/tendermint/tendermint/libs/log" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/osmosis-labs/osmosis/v7/x/incentives/types" - "github.com/tendermint/tendermint/libs/log" ) type Keeper struct { diff --git a/x/incentives/keeper/keeper_test.go b/x/incentives/keeper/keeper_test.go index 2f6a1efeba0..bcf1a2d29e3 100644 --- a/x/incentives/keeper/keeper_test.go +++ b/x/incentives/keeper/keeper_test.go @@ -4,10 +4,11 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/incentives/keeper" ) diff --git a/x/incentives/keeper/msg_server.go b/x/incentives/keeper/msg_server.go index 16ff28e8876..05bc7c9a3c7 100644 --- a/x/incentives/keeper/msg_server.go +++ b/x/incentives/keeper/msg_server.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/v7/x/gamm/utils" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) type msgServer struct { diff --git a/x/incentives/keeper/params.go b/x/incentives/keeper/params.go index d3e82b1dc50..3ec764771d4 100644 --- a/x/incentives/keeper/params.go +++ b/x/incentives/keeper/params.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // GetParams returns the total set params. diff --git a/x/incentives/keeper/store.go b/x/incentives/keeper/store.go index 31004be9bad..bd752f328c1 100644 --- a/x/incentives/keeper/store.go +++ b/x/incentives/keeper/store.go @@ -4,8 +4,9 @@ import ( "encoding/json" "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // GetLastGaugeID returns ID used last time. diff --git a/x/incentives/keeper/store_test.go b/x/incentives/keeper/store_test.go index e459624edab..b656ac3cd6b 100644 --- a/x/incentives/keeper/store_test.go +++ b/x/incentives/keeper/store_test.go @@ -1,7 +1,6 @@ package keeper_test func (suite *KeeperTestSuite) TestGaugeReferencesManagement() { - key1 := []byte{0x11} key2 := []byte{0x12} diff --git a/x/incentives/keeper/suite_test.go b/x/incentives/keeper/suite_test.go index 9b9fcd66186..8f82377b2b3 100644 --- a/x/incentives/keeper/suite_test.go +++ b/x/incentives/keeper/suite_test.go @@ -5,10 +5,11 @@ import ( "math/rand" "time" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" ) var ( @@ -106,7 +107,8 @@ func (suite *KeeperTestSuite) LockTokens(addr sdk.AccAddress, coins sdk.Coins, d } func (suite *KeeperTestSuite) setupNewGaugeWithDuration(isPerpetual bool, coins sdk.Coins, duration time.Duration) ( - uint64, *types.Gauge, sdk.Coins, time.Time) { + uint64, *types.Gauge, sdk.Coins, time.Time, +) { addr := sdk.AccAddress([]byte("Gauge_Creation_Addr_")) startTime2 := time.Now() distrTo := lockuptypes.QueryCondition{ @@ -134,7 +136,8 @@ func (suite *KeeperTestSuite) SetupNewGauge(isPerpetual bool, coins sdk.Coins) ( } func (suite *KeeperTestSuite) SetupManyLocks(numLocks int, liquidBalance sdk.Coins, coinsPerLock sdk.Coins, - lockDuration time.Duration) []sdk.AccAddress { + lockDuration time.Duration, +) []sdk.AccAddress { addrs := make([]sdk.AccAddress, 0, numLocks) randPrefix := make([]byte, 8) _, _ = rand.Read(randPrefix) diff --git a/x/incentives/keeper/utils.go b/x/incentives/keeper/utils.go index edbb34e7dc3..168e7acf72f 100644 --- a/x/incentives/keeper/utils.go +++ b/x/incentives/keeper/utils.go @@ -3,8 +3,9 @@ package keeper import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func findIndex(IDs []uint64, ID uint64) int { diff --git a/x/incentives/keeper/utils_test.go b/x/incentives/keeper/utils_test.go index deb1741272e..36f781fa961 100644 --- a/x/incentives/keeper/utils_test.go +++ b/x/incentives/keeper/utils_test.go @@ -5,9 +5,10 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestCombineKeys(t *testing.T) { diff --git a/x/incentives/module.go b/x/incentives/module.go index 8a41760e443..cdee0d3dae4 100644 --- a/x/incentives/module.go +++ b/x/incentives/module.go @@ -6,6 +6,11 @@ import ( "fmt" "math/rand" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -13,10 +18,6 @@ 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/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/osmosis-labs/osmosis/v7/x/incentives/client/cli" "github.com/osmosis-labs/osmosis/v7/x/incentives/client/rest" diff --git a/x/incentives/simulation/operations.go b/x/incentives/simulation/operations.go index 54a61a88ca0..a74fa014832 100644 --- a/x/incentives/simulation/operations.go +++ b/x/incentives/simulation/operations.go @@ -4,18 +4,20 @@ import ( "math/rand" "time" - "github.com/cosmos/cosmos-sdk/baseapp" osmo_simulation "github.com/osmosis-labs/osmosis/v7/x/simulation" + "github.com/cosmos/cosmos-sdk/baseapp" + + "github.com/osmosis-labs/osmosis/v7/x/incentives/keeper" + "github.com/osmosis-labs/osmosis/v7/x/incentives/types" + lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + "github.com/cosmos/cosmos-sdk/codec" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/osmosis-labs/osmosis/v7/x/incentives/keeper" - "github.com/osmosis-labs/osmosis/v7/x/incentives/types" - lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" ) // Simulation operation weights constants. diff --git a/x/incentives/types/expected_keepers.go b/x/incentives/types/expected_keepers.go index 661edb05607..374941306ce 100644 --- a/x/incentives/types/expected_keepers.go +++ b/x/incentives/types/expected_keepers.go @@ -3,9 +3,10 @@ package types import ( time "time" - sdk "github.com/cosmos/cosmos-sdk/types" epochstypes "github.com/osmosis-labs/osmosis/v7/x/epochs/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // BankKeeper defines the expected interface needed to retrieve account balances. diff --git a/x/incentives/types/gauge.go b/x/incentives/types/gauge.go index f5a16f378eb..7da16d81e2f 100644 --- a/x/incentives/types/gauge.go +++ b/x/incentives/types/gauge.go @@ -3,8 +3,9 @@ package types import ( time "time" - sdk "github.com/cosmos/cosmos-sdk/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func NewGauge(id uint64, isPerpetual bool, distrTo lockuptypes.QueryCondition, coins sdk.Coins, startTime time.Time, numEpochsPaidOver uint64, filledEpochs uint64, distrCoins sdk.Coins) Gauge { diff --git a/x/incentives/types/msgs.go b/x/incentives/types/msgs.go index 0a6d6cee771..a3e20b21626 100644 --- a/x/incentives/types/msgs.go +++ b/x/incentives/types/msgs.go @@ -4,8 +4,9 @@ import ( "errors" "time" - sdk "github.com/cosmos/cosmos-sdk/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // constants. diff --git a/x/incentives/types/msgs_test.go b/x/incentives/types/msgs_test.go index 3827172bfa9..ca6b34e60e2 100644 --- a/x/incentives/types/msgs_test.go +++ b/x/incentives/types/msgs_test.go @@ -4,10 +4,11 @@ import ( "testing" time "time" - sdk "github.com/cosmos/cosmos-sdk/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto/ed25519" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestMsgCreatePool(t *testing.T) { @@ -15,7 +16,6 @@ func TestMsgCreatePool(t *testing.T) { addr1 := sdk.AccAddress(pk1.Address()) createMsg := func(after func(msg MsgCreateGauge) MsgCreateGauge) MsgCreateGauge { - distributeTo := lockuptypes.QueryCondition{ LockQueryType: lockuptypes.ByDuration, Denom: "lptoken", diff --git a/x/incentives/types/params.go b/x/incentives/types/params.go index d88ff742bc8..37fe1d27b42 100644 --- a/x/incentives/types/params.go +++ b/x/incentives/types/params.go @@ -1,8 +1,9 @@ package types import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" epochtypes "github.com/osmosis-labs/osmosis/v7/x/epochs/types" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) // Parameter store keys. diff --git a/x/lockup/abci.go b/x/lockup/abci.go index 3448b65a6e3..3c530bd0fb2 100644 --- a/x/lockup/abci.go +++ b/x/lockup/abci.go @@ -3,8 +3,9 @@ package lockup import ( abci "github.com/tendermint/tendermint/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/keeper" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // BeginBlocker is called on every block. diff --git a/x/lockup/client/cli/cli_test.go b/x/lockup/client/cli/cli_test.go index b9f87c57c86..cfea64c0362 100644 --- a/x/lockup/client/cli/cli_test.go +++ b/x/lockup/client/cli/cli_test.go @@ -9,6 +9,12 @@ import ( "github.com/stretchr/testify/suite" tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/osmosis-labs/osmosis/v7/app" + "github.com/osmosis-labs/osmosis/v7/osmoutils" + "github.com/osmosis-labs/osmosis/v7/x/lockup/client/cli" + lockuptestutil "github.com/osmosis-labs/osmosis/v7/x/lockup/client/testutil" + "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -16,11 +22,6 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" - "github.com/osmosis-labs/osmosis/v7/app" - "github.com/osmosis-labs/osmosis/v7/osmoutils" - "github.com/osmosis-labs/osmosis/v7/x/lockup/client/cli" - lockuptestutil "github.com/osmosis-labs/osmosis/v7/x/lockup/client/testutil" - "github.com/osmosis-labs/osmosis/v7/x/lockup/types" ) type IntegrationTestSuite struct { diff --git a/x/lockup/client/cli/tx.go b/x/lockup/client/cli/tx.go index 603f2aa3ea9..fc655af30fd 100644 --- a/x/lockup/client/cli/tx.go +++ b/x/lockup/client/cli/tx.go @@ -7,11 +7,12 @@ import ( "github.com/spf13/cobra" + "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + "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/osmosis-labs/osmosis/v7/x/lockup/types" ) // GetTxCmd returns the transaction commands for this module. diff --git a/x/lockup/client/rest/query.go b/x/lockup/client/rest/query.go index c7eaeb958d1..10f7acecd0c 100644 --- a/x/lockup/client/rest/query.go +++ b/x/lockup/client/rest/query.go @@ -8,10 +8,11 @@ import ( "github.com/gorilla/mux" + "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/osmosis-labs/osmosis/v7/x/lockup/types" ) func registerQueryRoutes(clientCtx client.Context, r *mux.Router) { diff --git a/x/lockup/client/rest/tx.go b/x/lockup/client/rest/tx.go index f7c4d0c7f96..6111bc7b430 100644 --- a/x/lockup/client/rest/tx.go +++ b/x/lockup/client/rest/tx.go @@ -6,10 +6,11 @@ import ( "github.com/gorilla/mux" + "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/osmosis-labs/osmosis/v7/x/lockup/types" ) func registerTxHandlers(clientCtx client.Context, r *mux.Router) { diff --git a/x/lockup/client/testutil/test_helpers.go b/x/lockup/client/testutil/test_helpers.go index 174a29c44cc..48e03eecaa2 100644 --- a/x/lockup/client/testutil/test_helpers.go +++ b/x/lockup/client/testutil/test_helpers.go @@ -3,12 +3,13 @@ package testutil import ( "fmt" + lockupcli "github.com/osmosis-labs/osmosis/v7/x/lockup/client/cli" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" - lockupcli "github.com/osmosis-labs/osmosis/v7/x/lockup/client/cli" ) // commonArgs is args for CLI test commands. diff --git a/x/lockup/genesis.go b/x/lockup/genesis.go index 187f8fd5f94..fd0911cc35b 100644 --- a/x/lockup/genesis.go +++ b/x/lockup/genesis.go @@ -1,9 +1,10 @@ package lockup import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/keeper" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/lockup/genesis_test.go b/x/lockup/genesis_test.go index f99d8d3ba98..4f5b251cba2 100644 --- a/x/lockup/genesis_test.go +++ b/x/lockup/genesis_test.go @@ -4,45 +4,48 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" osmoapp "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/lockup" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" ) -var now = time.Now().UTC() -var acc1 = sdk.AccAddress([]byte("addr1---------------")) -var acc2 = sdk.AccAddress([]byte("addr2---------------")) -var testGenesis = types.GenesisState{ - LastLockId: 10, - Locks: []types.PeriodLock{ - { - ID: 1, - Owner: acc1.String(), - Duration: time.Second, - EndTime: time.Time{}, - Coins: sdk.Coins{sdk.NewInt64Coin("foo", 10000000)}, +var ( + now = time.Now().UTC() + acc1 = sdk.AccAddress([]byte("addr1---------------")) + acc2 = sdk.AccAddress([]byte("addr2---------------")) + testGenesis = types.GenesisState{ + LastLockId: 10, + Locks: []types.PeriodLock{ + { + ID: 1, + Owner: acc1.String(), + Duration: time.Second, + EndTime: time.Time{}, + Coins: sdk.Coins{sdk.NewInt64Coin("foo", 10000000)}, + }, + { + ID: 2, + Owner: acc1.String(), + Duration: time.Hour, + EndTime: time.Time{}, + Coins: sdk.Coins{sdk.NewInt64Coin("foo", 15000000)}, + }, + { + ID: 3, + Owner: acc2.String(), + Duration: time.Minute, + EndTime: time.Time{}, + Coins: sdk.Coins{sdk.NewInt64Coin("foo", 5000000)}, + }, }, - { - ID: 2, - Owner: acc1.String(), - Duration: time.Hour, - EndTime: time.Time{}, - Coins: sdk.Coins{sdk.NewInt64Coin("foo", 15000000)}, - }, - { - ID: 3, - Owner: acc2.String(), - Duration: time.Minute, - EndTime: time.Time{}, - Coins: sdk.Coins{sdk.NewInt64Coin("foo", 5000000)}, - }, - }, -} + } +) func TestInitGenesis(t *testing.T) { app := osmoapp.Setup(false) diff --git a/x/lockup/handler.go b/x/lockup/handler.go index 839b2b0b45e..3419731de0a 100644 --- a/x/lockup/handler.go +++ b/x/lockup/handler.go @@ -3,10 +3,11 @@ package lockup import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/v7/x/lockup/keeper" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler returns a handler for "lockup" type messages. diff --git a/x/lockup/keeper/admin_keeper.go b/x/lockup/keeper/admin_keeper.go index f663307bd41..0fc3a77bd37 100644 --- a/x/lockup/keeper/admin_keeper.go +++ b/x/lockup/keeper/admin_keeper.go @@ -1,9 +1,10 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/protobuf/proto" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // Relock unlock previous lockID and create a new lock with newCoins with same duration and endtime. diff --git a/x/lockup/keeper/admin_keeper_test.go b/x/lockup/keeper/admin_keeper_test.go index 6db67389d4f..14756970829 100644 --- a/x/lockup/keeper/admin_keeper_test.go +++ b/x/lockup/keeper/admin_keeper_test.go @@ -3,10 +3,11 @@ package keeper_test import ( "time" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/keeper" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" ) func (suite *KeeperTestSuite) TestRelock() { diff --git a/x/lockup/keeper/bench_test.go b/x/lockup/keeper/bench_test.go index bbf28d0e856..4630b3e4c67 100644 --- a/x/lockup/keeper/bench_test.go +++ b/x/lockup/keeper/bench_test.go @@ -6,13 +6,14 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/osmosis-labs/osmosis/v7/app" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/tendermint/tendermint/crypto/secp256k1" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) func Min(x, y int) int { diff --git a/x/lockup/keeper/export_test.go b/x/lockup/keeper/export_test.go index e35e3c0fdf5..97dfe9579cf 100644 --- a/x/lockup/keeper/export_test.go +++ b/x/lockup/keeper/export_test.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (k Keeper) AddLockRefByKey(ctx sdk.Context, key []byte, lockID uint64) error { diff --git a/x/lockup/keeper/gas_test.go b/x/lockup/keeper/gas_test.go index edd0dd553b4..487ce9b0d80 100644 --- a/x/lockup/keeper/gas_test.go +++ b/x/lockup/keeper/gas_test.go @@ -30,7 +30,8 @@ func (suite *KeeperTestSuite) measureAvgAndMaxLockGas( numIterations int, addr sdk.AccAddress, coinsFn func(int) sdk.Coins, - durFn func(int) time.Duration) (avg uint64, maxGas uint64) { + durFn func(int) time.Duration, +) (avg uint64, maxGas uint64) { runningTotal := uint64(0) maxGas = uint64(0) for i := 1; i <= numIterations; i++ { diff --git a/x/lockup/keeper/grpc_query_test.go b/x/lockup/keeper/grpc_query_test.go index 294aa49660e..1cbae2cda80 100644 --- a/x/lockup/keeper/grpc_query_test.go +++ b/x/lockup/keeper/grpc_query_test.go @@ -344,7 +344,7 @@ func (suite *KeeperTestSuite) TestLockedByID() { suite.SetupTest() addr1 := sdk.AccAddress([]byte("addr1---------------")) - // lock by not avaialble id check + // lock by not available id check res, err := suite.querier.LockedByID(sdk.WrapSDKContext(suite.ctx), &types.LockedRequest{LockId: 0}) suite.Require().Error(err) @@ -352,7 +352,7 @@ func (suite *KeeperTestSuite) TestLockedByID() { coins := sdk.Coins{sdk.NewInt64Coin("stake", 10)} suite.LockTokens(addr1, coins, time.Second) - // lock by available availble id check + // lock by available available id check res, err = suite.querier.LockedByID(sdk.WrapSDKContext(suite.ctx), &types.LockedRequest{LockId: 1}) suite.Require().NoError(err) suite.Require().Equal(res.Lock.ID, uint64(1)) diff --git a/x/lockup/keeper/iterator.go b/x/lockup/keeper/iterator.go index 37850e2c1a9..44faf7abebb 100644 --- a/x/lockup/keeper/iterator.go +++ b/x/lockup/keeper/iterator.go @@ -3,10 +3,11 @@ package keeper import ( "time" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" db "github.com/tendermint/tm-db" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) func unlockingPrefix(isUnlocking bool) []byte { diff --git a/x/lockup/keeper/keeper.go b/x/lockup/keeper/keeper.go index d6c98a37729..931280c0190 100644 --- a/x/lockup/keeper/keeper.go +++ b/x/lockup/keeper/keeper.go @@ -5,9 +5,10 @@ import ( "github.com/tendermint/tendermint/libs/log" + "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/osmosis-labs/osmosis/v7/x/lockup/types" ) // Keeper provides a way to manage module storage. diff --git a/x/lockup/keeper/keeper_test.go b/x/lockup/keeper/keeper_test.go index 4114b983656..ebadacc952e 100644 --- a/x/lockup/keeper/keeper_test.go +++ b/x/lockup/keeper/keeper_test.go @@ -4,10 +4,11 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/lockup/keeper" ) diff --git a/x/lockup/keeper/lock.go b/x/lockup/keeper/lock.go index e83b0b11ea0..61f32eeb43d 100644 --- a/x/lockup/keeper/lock.go +++ b/x/lockup/keeper/lock.go @@ -5,11 +5,12 @@ import ( "sort" "time" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/protobuf/proto" "github.com/osmosis-labs/osmosis/v7/store" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" ) // TODO: Reorganize functions in this file diff --git a/x/lockup/keeper/lock_refs.go b/x/lockup/keeper/lock_refs.go index 30be8f0b5f3..2dee37ca0da 100644 --- a/x/lockup/keeper/lock_refs.go +++ b/x/lockup/keeper/lock_refs.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (k Keeper) addLockRefs(ctx sdk.Context, lock types.PeriodLock) error { diff --git a/x/lockup/keeper/lock_test.go b/x/lockup/keeper/lock_test.go index aacd213bd6b..523d0b6d52f 100644 --- a/x/lockup/keeper/lock_test.go +++ b/x/lockup/keeper/lock_test.go @@ -4,9 +4,10 @@ import ( "fmt" "time" + "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/osmosis-labs/osmosis/v7/x/lockup/types" ) func (suite *KeeperTestSuite) TestBeginUnlocking() { // test for all unlockable coins @@ -267,7 +268,6 @@ func (suite *KeeperTestSuite) TestPartialUnlock() { locked = suite.app.LockupKeeper.GetAccountLockedCoins(suite.ctx, addr1) suite.Require().Equal(len(locked), 1) suite.Require().Equal(locked[0].Amount.Int64(), int64(9)) - } func (suite *KeeperTestSuite) TestModuleLockedCoins() { @@ -448,7 +448,7 @@ func (suite *KeeperTestSuite) AddTokensToLockForSynth() { // by GetPeriodLocksAccumulation for i := 1; i <= 3; i++ { for j := 1; j <= 3; j++ { - // get accumulation with always-qualifiing condition + // get accumulation with always-qualifying condition acc := suite.app.LockupKeeper.GetPeriodLocksAccumulation(suite.ctx, types.QueryCondition{ Denom: fmt.Sprintf("synth%d/%d", j, i), Duration: time.Second / 10, @@ -456,7 +456,7 @@ func (suite *KeeperTestSuite) AddTokensToLockForSynth() { // amount retrieved should be equal with underlying lock's locked amount suite.Require().Equal(acc.Int64(), amounts[i]) - // get accumulation with non-qualifiing condition + // get accumulation with non-qualifying condition acc = suite.app.LockupKeeper.GetPeriodLocksAccumulation(suite.ctx, types.QueryCondition{ Denom: fmt.Sprintf("synth%d/%d", j, i), Duration: time.Second * 100, diff --git a/x/lockup/keeper/migration.go b/x/lockup/keeper/migration.go index dac7785eb98..b79f00f0516 100644 --- a/x/lockup/keeper/migration.go +++ b/x/lockup/keeper/migration.go @@ -4,8 +4,9 @@ import ( "strconv" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) var ( diff --git a/x/lockup/keeper/migration_test.go b/x/lockup/keeper/migration_test.go index 714609988e3..7efbc93b27e 100644 --- a/x/lockup/keeper/migration_test.go +++ b/x/lockup/keeper/migration_test.go @@ -5,8 +5,9 @@ import ( "math/rand" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/keeper" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (suite *KeeperTestSuite) TestLockupMergeMigration() { diff --git a/x/lockup/keeper/msg_server.go b/x/lockup/keeper/msg_server.go index 22f2d12367b..f051aafe043 100644 --- a/x/lockup/keeper/msg_server.go +++ b/x/lockup/keeper/msg_server.go @@ -4,10 +4,11 @@ import ( "context" "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/v7/x/gamm/utils" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) type msgServer struct { diff --git a/x/lockup/keeper/msg_server_test.go b/x/lockup/keeper/msg_server_test.go index d4c8f277560..042156cc4d6 100644 --- a/x/lockup/keeper/msg_server_test.go +++ b/x/lockup/keeper/msg_server_test.go @@ -3,10 +3,11 @@ package keeper_test import ( "time" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/keeper" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" ) func (suite *KeeperTestSuite) TestMsgLockTokens() { diff --git a/x/lockup/keeper/store.go b/x/lockup/keeper/store.go index 98d91680f07..80c37098c91 100644 --- a/x/lockup/keeper/store.go +++ b/x/lockup/keeper/store.go @@ -5,11 +5,12 @@ import ( "fmt" "time" + "github.com/gogo/protobuf/proto" + "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/gogo/protobuf/proto" - "github.com/osmosis-labs/osmosis/v7/x/lockup/types" ) // GetLastLockID returns ID used last time. diff --git a/x/lockup/keeper/store_test.go b/x/lockup/keeper/store_test.go index 1975d37a214..81ad71e636b 100644 --- a/x/lockup/keeper/store_test.go +++ b/x/lockup/keeper/store_test.go @@ -1,7 +1,6 @@ package keeper_test func (suite *KeeperTestSuite) TestLockReferencesManagement() { - key1 := []byte{0x11} key2 := []byte{0x12} diff --git a/x/lockup/keeper/synthetic_lock.go b/x/lockup/keeper/synthetic_lock.go index 1ba2eec6094..ffb3a3d8e36 100644 --- a/x/lockup/keeper/synthetic_lock.go +++ b/x/lockup/keeper/synthetic_lock.go @@ -4,9 +4,10 @@ import ( "fmt" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/protobuf/proto" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (k Keeper) setSyntheticLockupObject(ctx sdk.Context, synthLock *types.SyntheticLock) error { diff --git a/x/lockup/keeper/synthetic_lock_test.go b/x/lockup/keeper/synthetic_lock_test.go index c5d25536834..7e223910082 100644 --- a/x/lockup/keeper/synthetic_lock_test.go +++ b/x/lockup/keeper/synthetic_lock_test.go @@ -3,8 +3,9 @@ package keeper_test import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (suite *KeeperTestSuite) TestSyntheticLockupCreation() { diff --git a/x/lockup/keeper/utils.go b/x/lockup/keeper/utils.go index f0479b23138..de294c9c312 100644 --- a/x/lockup/keeper/utils.go +++ b/x/lockup/keeper/utils.go @@ -4,8 +4,9 @@ import ( "bytes" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // combineKeys combine bytes array into a single bytes. diff --git a/x/lockup/keeper/utils_test.go b/x/lockup/keeper/utils_test.go index 8fd49ee338d..ba95bc4ccab 100644 --- a/x/lockup/keeper/utils_test.go +++ b/x/lockup/keeper/utils_test.go @@ -5,9 +5,10 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestCombineKeys(t *testing.T) { diff --git a/x/lockup/module.go b/x/lockup/module.go index a82baca205a..4c03e1e9641 100644 --- a/x/lockup/module.go +++ b/x/lockup/module.go @@ -6,6 +6,11 @@ import ( "fmt" "math/rand" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -13,10 +18,6 @@ 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/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/osmosis-labs/osmosis/v7/x/lockup/client/cli" "github.com/osmosis-labs/osmosis/v7/x/lockup/client/rest" diff --git a/x/lockup/simulation/operations.go b/x/lockup/simulation/operations.go index a48b8b9f8e8..084bf7411e7 100644 --- a/x/lockup/simulation/operations.go +++ b/x/lockup/simulation/operations.go @@ -4,17 +4,19 @@ import ( "math/rand" "time" - "github.com/cosmos/cosmos-sdk/baseapp" osmo_simulation "github.com/osmosis-labs/osmosis/v7/x/simulation" + "github.com/cosmos/cosmos-sdk/baseapp" + + "github.com/osmosis-labs/osmosis/v7/x/lockup/keeper" + "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + "github.com/cosmos/cosmos-sdk/codec" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/osmosis-labs/osmosis/v7/x/lockup/keeper" - "github.com/osmosis-labs/osmosis/v7/x/lockup/types" ) // Simulation operation weights constants. diff --git a/x/mint/client/cli/cli_test.go b/x/mint/client/cli/cli_test.go index 9be44dc2b81..c9c2061806f 100644 --- a/x/mint/client/cli/cli_test.go +++ b/x/mint/client/cli/cli_test.go @@ -11,11 +11,12 @@ import ( "github.com/stretchr/testify/suite" tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/osmosis-labs/osmosis/v7/app" + "github.com/osmosis-labs/osmosis/v7/x/mint/client/cli" + "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" - "github.com/osmosis-labs/osmosis/v7/app" - "github.com/osmosis-labs/osmosis/v7/x/mint/client/cli" ) type IntegrationTestSuite struct { diff --git a/x/mint/client/cli/query.go b/x/mint/client/cli/query.go index ec6da9d25c9..26c94d6f9ac 100644 --- a/x/mint/client/cli/query.go +++ b/x/mint/client/cli/query.go @@ -6,9 +6,10 @@ import ( "github.com/spf13/cobra" + "github.com/osmosis-labs/osmosis/v7/x/mint/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/osmosis-labs/osmosis/v7/x/mint/types" ) // GetQueryCmd returns the cli query commands for the minting module. diff --git a/x/mint/client/rest/grpc_query_test.go b/x/mint/client/rest/grpc_query_test.go index ec137b32c48..e1334390367 100644 --- a/x/mint/client/rest/grpc_query_test.go +++ b/x/mint/client/rest/grpc_query_test.go @@ -14,9 +14,10 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/suite" - "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/osmosis-labs/osmosis/v7/app" minttypes "github.com/osmosis-labs/osmosis/v7/x/mint/types" + + "github.com/cosmos/cosmos-sdk/testutil/network" ) type IntegrationTestSuite struct { diff --git a/x/mint/client/rest/query.go b/x/mint/client/rest/query.go index 1b4fb74369f..cab71e70587 100644 --- a/x/mint/client/rest/query.go +++ b/x/mint/client/rest/query.go @@ -6,9 +6,10 @@ import ( "github.com/gorilla/mux" + "github.com/osmosis-labs/osmosis/v7/x/mint/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/osmosis-labs/osmosis/v7/x/mint/types" ) func registerQueryRoutes(clientCtx client.Context, r *mux.Router) { diff --git a/x/mint/genesis.go b/x/mint/genesis.go index ef11acc963e..0710c5a68c4 100644 --- a/x/mint/genesis.go +++ b/x/mint/genesis.go @@ -1,9 +1,10 @@ package mint import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/mint/keeper" "github.com/osmosis-labs/osmosis/v7/x/mint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // InitGenesis new mint genesis. diff --git a/x/mint/genesis_test.go b/x/mint/genesis_test.go index dcdc91bcb98..4a7e412cd58 100644 --- a/x/mint/genesis_test.go +++ b/x/mint/genesis_test.go @@ -3,11 +3,12 @@ package mint_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" simapp "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/mint/types" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestMintInitGenesis(t *testing.T) { diff --git a/x/mint/keeper/grpc_query_test.go b/x/mint/keeper/grpc_query_test.go index 1238447018d..36a946f21c4 100644 --- a/x/mint/keeper/grpc_query_test.go +++ b/x/mint/keeper/grpc_query_test.go @@ -4,11 +4,12 @@ import ( gocontext "context" "testing" - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simapp "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/mint/keeper" "github.com/osmosis-labs/osmosis/v7/x/mint/types" diff --git a/x/mint/keeper/hooks.go b/x/mint/keeper/hooks.go index e8debc6ab57..bce090cbafe 100644 --- a/x/mint/keeper/hooks.go +++ b/x/mint/keeper/hooks.go @@ -3,10 +3,11 @@ package keeper import ( "fmt" - "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" epochstypes "github.com/osmosis-labs/osmosis/v7/x/epochs/types" "github.com/osmosis-labs/osmosis/v7/x/mint/types" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" ) func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) { diff --git a/x/mint/keeper/hooks_test.go b/x/mint/keeper/hooks_test.go index 7fd5fef2e44..91f75affda6 100644 --- a/x/mint/keeper/hooks_test.go +++ b/x/mint/keeper/hooks_test.go @@ -4,14 +4,15 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" osmoapp "github.com/osmosis-labs/osmosis/v7/app" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/osmosis-labs/osmosis/v7/x/mint/types" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestEndOfEpochMintedCoinDistribution(t *testing.T) { diff --git a/x/mint/keeper/integration_test.go b/x/mint/keeper/integration_test.go index e78f380bde9..258236ab776 100644 --- a/x/mint/keeper/integration_test.go +++ b/x/mint/keeper/integration_test.go @@ -3,9 +3,10 @@ package keeper_test import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - sdk "github.com/cosmos/cosmos-sdk/types" simapp "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/mint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // returns context and an app with updated mint keeper diff --git a/x/mint/keeper/keeper.go b/x/mint/keeper/keeper.go index 8f88c387258..dcb08f27c96 100644 --- a/x/mint/keeper/keeper.go +++ b/x/mint/keeper/keeper.go @@ -1,13 +1,14 @@ package keeper import ( + "github.com/osmosis-labs/osmosis/v7/x/mint/types" + poolincentivestypes "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" + "github.com/tendermint/tendermint/libs/log" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/osmosis-labs/osmosis/v7/x/mint/types" - poolincentivestypes "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" - "github.com/tendermint/tendermint/libs/log" ) // Keeper of the mint store. diff --git a/x/mint/module_test.go b/x/mint/module_test.go index c029a0d4ac5..0be8567e544 100644 --- a/x/mint/module_test.go +++ b/x/mint/module_test.go @@ -7,9 +7,10 @@ import ( abcitypes "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" simapp "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/mint/types" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { diff --git a/x/mint/simulation/decoder.go b/x/mint/simulation/decoder.go index 654ea412bb5..33a752a5dc9 100644 --- a/x/mint/simulation/decoder.go +++ b/x/mint/simulation/decoder.go @@ -4,9 +4,10 @@ import ( "bytes" "fmt" + "github.com/osmosis-labs/osmosis/v7/x/mint/types" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/kv" - "github.com/osmosis-labs/osmosis/v7/x/mint/types" ) // NewDecodeStore returns a decoder function closure that umarshals the KVPair's diff --git a/x/mint/simulation/decoder_test.go b/x/mint/simulation/decoder_test.go index 91b1a74965e..23e5adfde66 100644 --- a/x/mint/simulation/decoder_test.go +++ b/x/mint/simulation/decoder_test.go @@ -6,11 +6,12 @@ import ( "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/kv" simapp "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/mint/simulation" "github.com/osmosis-labs/osmosis/v7/x/mint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/kv" ) func TestDecodeStore(t *testing.T) { diff --git a/x/mint/simulation/genesis.go b/x/mint/simulation/genesis.go index a2a150f4ed0..1aa8a68b278 100644 --- a/x/mint/simulation/genesis.go +++ b/x/mint/simulation/genesis.go @@ -6,9 +6,10 @@ import ( "encoding/json" "fmt" + "github.com/osmosis-labs/osmosis/v7/x/mint/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/osmosis-labs/osmosis/v7/x/mint/types" ) // RandomizedGenState generates a random GenesisState for mint. diff --git a/x/mint/simulation/genesis_test.go b/x/mint/simulation/genesis_test.go index d4f402e7fcd..913bd8bfe00 100644 --- a/x/mint/simulation/genesis_test.go +++ b/x/mint/simulation/genesis_test.go @@ -7,12 +7,13 @@ import ( "github.com/stretchr/testify/require" + "github.com/osmosis-labs/osmosis/v7/x/mint/simulation" + "github.com/osmosis-labs/osmosis/v7/x/mint/types" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/osmosis-labs/osmosis/v7/x/mint/simulation" - "github.com/osmosis-labs/osmosis/v7/x/mint/types" ) // TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. diff --git a/x/mint/simulation/params_test.go b/x/mint/simulation/params_test.go index 29519aa6b83..deea672b5cb 100644 --- a/x/mint/simulation/params_test.go +++ b/x/mint/simulation/params_test.go @@ -35,5 +35,4 @@ func TestParamChanges(t *testing.T) { require.Equal(t, expected[i].simValue, p.SimValue()(r)) require.Equal(t, expected[i].subspace, p.Subspace()) } - } diff --git a/x/mint/types/expected_keepers.go b/x/mint/types/expected_keepers.go index ed3b11c83e9..b23f5e53040 100644 --- a/x/mint/types/expected_keepers.go +++ b/x/mint/types/expected_keepers.go @@ -1,9 +1,10 @@ package types // noalias import ( + epochstypes "github.com/osmosis-labs/osmosis/v7/x/epochs/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" - epochstypes "github.com/osmosis-labs/osmosis/v7/x/epochs/types" ) // AccountKeeper defines the contract required for account APIs. diff --git a/x/mint/types/params.go b/x/mint/types/params.go index 00ce93f3d3d..31f6d964685 100644 --- a/x/mint/types/params.go +++ b/x/mint/types/params.go @@ -5,10 +5,11 @@ import ( "fmt" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" epochtypes "github.com/osmosis-labs/osmosis/v7/x/epochs/types" yaml "gopkg.in/yaml.v2" + + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) // Parameter store keys. diff --git a/x/pool-incentives/abci.go b/x/pool-incentives/abci.go index c89e7e9f8b2..fcc815743b3 100644 --- a/x/pool-incentives/abci.go +++ b/x/pool-incentives/abci.go @@ -1,9 +1,10 @@ package pool_incentives import ( - sdk "github.com/cosmos/cosmos-sdk/types" abci "github.com/tendermint/tendermint/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/keeper" ) diff --git a/x/pool-incentives/client/cli/cli_test.go b/x/pool-incentives/client/cli/cli_test.go index f76ae27b945..a2f38150a08 100644 --- a/x/pool-incentives/client/cli/cli_test.go +++ b/x/pool-incentives/client/cli/cli_test.go @@ -4,11 +4,12 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/suite" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/client/cli" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/cosmos/cosmos-sdk/testutil/network" ) type IntegrationTestSuite struct { diff --git a/x/pool-incentives/client/cli/query.go b/x/pool-incentives/client/cli/query.go index 644f670b219..5b2940ac69b 100644 --- a/x/pool-incentives/client/cli/query.go +++ b/x/pool-incentives/client/cli/query.go @@ -5,11 +5,12 @@ import ( "strconv" "strings" + "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" - "github.com/spf13/cobra" ) // GetQueryCmd returns the cli query commands for this module. diff --git a/x/pool-incentives/client/proposal_handler.go b/x/pool-incentives/client/proposal_handler.go index f7484b00c29..f70f5d1071d 100644 --- a/x/pool-incentives/client/proposal_handler.go +++ b/x/pool-incentives/client/proposal_handler.go @@ -1,9 +1,10 @@ package client import ( - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/client/cli" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/client/rest" + + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" ) var UpdatePoolIncentivesHandler = govclient.NewProposalHandler(cli.NewCmdSubmitUpdatePoolIncentivesProposal, rest.ProposalUpdatePoolIncentivesRESTHandler) diff --git a/x/pool-incentives/genesis_test.go b/x/pool-incentives/genesis_test.go index 1a4c13b9aff..da86fe9e6b9 100644 --- a/x/pool-incentives/genesis_test.go +++ b/x/pool-incentives/genesis_test.go @@ -4,35 +4,38 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" simapp "github.com/osmosis-labs/osmosis/v7/app" pool_incentives "github.com/osmosis-labs/osmosis/v7/x/pool-incentives" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) -var now = time.Now().UTC() -var testGenesis = types.GenesisState{ - Params: types.Params{ - MintedDenom: "uosmo", - }, - LockableDurations: []time.Duration{ - time.Second, - time.Minute, - time.Hour, - }, - DistrInfo: &types.DistrInfo{ - TotalWeight: sdk.NewInt(1), - Records: []types.DistrRecord{ - { - GaugeId: 1, - Weight: sdk.NewInt(1), +var ( + now = time.Now().UTC() + testGenesis = types.GenesisState{ + Params: types.Params{ + MintedDenom: "uosmo", + }, + LockableDurations: []time.Duration{ + time.Second, + time.Minute, + time.Hour, + }, + DistrInfo: &types.DistrInfo{ + TotalWeight: sdk.NewInt(1), + Records: []types.DistrRecord{ + { + GaugeId: 1, + Weight: sdk.NewInt(1), + }, }, }, - }, -} + } +) func TestMarshalUnmarshalGenesis(t *testing.T) { app := simapp.Setup(false) @@ -54,7 +57,6 @@ func TestMarshalUnmarshalGenesis(t *testing.T) { ctx = ctx.WithBlockTime(now.Add(time.Second)) am := pool_incentives.NewAppModule(appCodec, *app.PoolIncentivesKeeper) am.InitGenesis(ctx, appCodec, genesisExported) - }) } diff --git a/x/pool-incentives/keeper/distr.go b/x/pool-incentives/keeper/distr.go index 600e26dd4b5..f70f7d76b29 100644 --- a/x/pool-incentives/keeper/distr.go +++ b/x/pool-incentives/keeper/distr.go @@ -4,9 +4,10 @@ import ( "fmt" "sort" + "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" ) func (k Keeper) FundCommunityPoolFromModule(ctx sdk.Context, asset sdk.Coin) error { diff --git a/x/pool-incentives/keeper/distr_test.go b/x/pool-incentives/keeper/distr_test.go index e61b2c56fe6..3b9c3b25c92 100644 --- a/x/pool-incentives/keeper/distr_test.go +++ b/x/pool-incentives/keeper/distr_test.go @@ -1,13 +1,14 @@ package keeper_test import ( + minttypes "github.com/osmosis-labs/osmosis/v7/x/mint/types" + "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" + abci "github.com/tendermint/tendermint/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/distribution" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - minttypes "github.com/osmosis-labs/osmosis/v7/x/mint/types" - "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" - abci "github.com/tendermint/tendermint/abci/types" ) func (suite *KeeperTestSuite) TestAllocateAssetToCommunityPoolWhenNoDistrRecords() { diff --git a/x/pool-incentives/keeper/grpc_query.go b/x/pool-incentives/keeper/grpc_query.go index ab9907ac355..c8a93b261f7 100644 --- a/x/pool-incentives/keeper/grpc_query.go +++ b/x/pool-incentives/keeper/grpc_query.go @@ -3,11 +3,12 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + incentivetypes "github.com/osmosis-labs/osmosis/v7/x/incentives/types" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" ) diff --git a/x/pool-incentives/keeper/grpc_query_test.go b/x/pool-incentives/keeper/grpc_query_test.go index 45b8a7b7222..68b3cf45027 100644 --- a/x/pool-incentives/keeper/grpc_query_test.go +++ b/x/pool-incentives/keeper/grpc_query_test.go @@ -11,8 +11,10 @@ import ( "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" ) -var isPerpetual = true -var notPerpetual = false +var ( + isPerpetual = true + notPerpetual = false +) func (suite *KeeperTestSuite) TestGaugeIds() { suite.SetupTest() diff --git a/x/pool-incentives/keeper/keeper.go b/x/pool-incentives/keeper/keeper.go index 1d9f090863f..6ff5b7cbfa4 100644 --- a/x/pool-incentives/keeper/keeper.go +++ b/x/pool-incentives/keeper/keeper.go @@ -4,15 +4,16 @@ import ( "fmt" "time" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" incentivestypes "github.com/osmosis-labs/osmosis/v7/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" "github.com/tendermint/tendermint/libs/log" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) type Keeper struct { diff --git a/x/pool-incentives/keeper/keeper_test.go b/x/pool-incentives/keeper/keeper_test.go index cbebccf46fb..3352f559837 100644 --- a/x/pool-incentives/keeper/keeper_test.go +++ b/x/pool-incentives/keeper/keeper_test.go @@ -4,13 +4,14 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" "github.com/tendermint/tendermint/crypto/ed25519" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" diff --git a/x/pool-incentives/module.go b/x/pool-incentives/module.go index 18facb84cfc..a8ca6a0ca3b 100644 --- a/x/pool-incentives/module.go +++ b/x/pool-incentives/module.go @@ -6,6 +6,11 @@ import ( "fmt" "math/rand" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "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" @@ -13,10 +18,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/gov/simulation" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/client/cli" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/keeper" diff --git a/x/pool-incentives/types/genesis_test.go b/x/pool-incentives/types/genesis_test.go index 75280ad1a85..a97248f50fc 100644 --- a/x/pool-incentives/types/genesis_test.go +++ b/x/pool-incentives/types/genesis_test.go @@ -4,14 +4,14 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" proto "github.com/gogo/protobuf/proto" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestGenesisStateMarshalUnmarshal(t *testing.T) { - tests := []struct { state *types.GenesisState }{ diff --git a/x/pool-incentives/types/gov_test.go b/x/pool-incentives/types/gov_test.go index 5b59f87119c..267c939cf4b 100644 --- a/x/pool-incentives/types/gov_test.go +++ b/x/pool-incentives/types/gov_test.go @@ -3,14 +3,14 @@ package types_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" proto "github.com/gogo/protobuf/proto" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestUpdatePoolIncentivesProposalMarshalUnmarshal(t *testing.T) { - tests := []struct { proposal *types.UpdatePoolIncentivesProposal }{ diff --git a/x/pool-incentives/types/incentives_test.go b/x/pool-incentives/types/incentives_test.go index 83e786f5691..b5abe93790d 100644 --- a/x/pool-incentives/types/incentives_test.go +++ b/x/pool-incentives/types/incentives_test.go @@ -4,14 +4,14 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" proto "github.com/gogo/protobuf/proto" "github.com/osmosis-labs/osmosis/v7/x/pool-incentives/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestParamsMarshalUnmarshal(t *testing.T) { - tests := []struct { params *types.Params }{ @@ -38,7 +38,6 @@ func TestParamsMarshalUnmarshal(t *testing.T) { } func TestLockableDurationsInfoMarshalUnmarshal(t *testing.T) { - tests := []struct { durations *types.LockableDurationsInfo }{ @@ -68,7 +67,6 @@ func TestLockableDurationsInfoMarshalUnmarshal(t *testing.T) { } func TestDistrInfoMarshalUnmarshal(t *testing.T) { - tests := []struct { info *types.DistrInfo }{ @@ -117,7 +115,6 @@ func TestDistrInfoMarshalUnmarshal(t *testing.T) { } func TestDistrRecordMarshalUnmarshal(t *testing.T) { - tests := []struct { info *types.DistrRecord }{ diff --git a/x/pool-incentives/types/params.go b/x/pool-incentives/types/params.go index 5fdb99307d3..5d53ddb6dd2 100644 --- a/x/pool-incentives/types/params.go +++ b/x/pool-incentives/types/params.go @@ -5,9 +5,10 @@ import ( "fmt" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" "gopkg.in/yaml.v2" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) diff --git a/x/pool-incentives/types/query_test.go b/x/pool-incentives/types/query_test.go index a7038d2fbb8..4de277cf43c 100644 --- a/x/pool-incentives/types/query_test.go +++ b/x/pool-incentives/types/query_test.go @@ -10,7 +10,6 @@ import ( ) func TestQueryGaugeIdsResponseMarshalUnmarshal(t *testing.T) { - tests := []struct { response *types.QueryGaugeIdsResponse }{ @@ -40,7 +39,6 @@ func TestQueryGaugeIdsResponseMarshalUnmarshal(t *testing.T) { } func TestQueryIncentivizedPoolsResponseMarshalUnmarshal(t *testing.T) { - tests := []struct { response *types.QueryIncentivizedPoolsResponse }{ diff --git a/x/superfluid/abci.go b/x/superfluid/abci.go index 36acf7e16da..cf27e4b7ada 100644 --- a/x/superfluid/abci.go +++ b/x/superfluid/abci.go @@ -3,9 +3,10 @@ package superfluid import ( abci "github.com/tendermint/tendermint/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // BeginBlocker is called on every block. diff --git a/x/superfluid/client/cli/query.go b/x/superfluid/client/cli/query.go index f9ed9ecb70b..4560ec78c60 100644 --- a/x/superfluid/client/cli/query.go +++ b/x/superfluid/client/cli/query.go @@ -5,11 +5,12 @@ import ( "strconv" "strings" + "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" - "github.com/spf13/cobra" ) // GetQueryCmd returns the cli query commands for this module. diff --git a/x/superfluid/client/cli/tx.go b/x/superfluid/client/cli/tx.go index aa0ce7ca4dc..d8ddd3cf9e3 100644 --- a/x/superfluid/client/cli/tx.go +++ b/x/superfluid/client/cli/tx.go @@ -5,14 +5,15 @@ import ( "strconv" "strings" + "github.com/osmosis-labs/osmosis/v7/x/superfluid/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" govcli "github.com/cosmos/cosmos-sdk/x/gov/client/cli" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" - "github.com/spf13/cobra" ) // GetTxCmd returns the transaction commands for this module. diff --git a/x/superfluid/client/proposal_handler.go b/x/superfluid/client/proposal_handler.go index d1a2ada1a5c..e6e306acd74 100644 --- a/x/superfluid/client/proposal_handler.go +++ b/x/superfluid/client/proposal_handler.go @@ -1,9 +1,10 @@ package client import ( - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" "github.com/osmosis-labs/osmosis/v7/x/superfluid/client/cli" "github.com/osmosis-labs/osmosis/v7/x/superfluid/client/rest" + + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" ) var ( diff --git a/x/superfluid/genesis.go b/x/superfluid/genesis.go index 591873356ee..71d2a4e3665 100644 --- a/x/superfluid/genesis.go +++ b/x/superfluid/genesis.go @@ -1,9 +1,10 @@ package superfluid import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/superfluid/genesis_test.go b/x/superfluid/genesis_test.go index ab46705452e..7edc49de76f 100644 --- a/x/superfluid/genesis_test.go +++ b/x/superfluid/genesis_test.go @@ -4,13 +4,14 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" simapp "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/superfluid" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) var now = time.Now().UTC() diff --git a/x/superfluid/handler.go b/x/superfluid/handler.go index 4436b78ebf8..a7d655d8675 100644 --- a/x/superfluid/handler.go +++ b/x/superfluid/handler.go @@ -3,10 +3,11 @@ package superfluid import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler returns a handler for "superfluid" type messages. diff --git a/x/superfluid/keeper/distribution_test.go b/x/superfluid/keeper/distribution_test.go index 50db40f78a2..dad228dc539 100644 --- a/x/superfluid/keeper/distribution_test.go +++ b/x/superfluid/keeper/distribution_test.go @@ -1,10 +1,11 @@ package keeper_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper" + + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) func (suite *KeeperTestSuite) TestMoveSuperfluidDelegationRewardToGauges() { diff --git a/x/superfluid/keeper/export_test.go b/x/superfluid/keeper/export_test.go index ebed50d197d..896491cb8ee 100644 --- a/x/superfluid/keeper/export_test.go +++ b/x/superfluid/keeper/export_test.go @@ -1,4 +1,6 @@ package keeper -var StakingSyntheticDenom = stakingSyntheticDenom -var UnstakingSyntheticDenom = unstakingSyntheticDenom +var ( + StakingSyntheticDenom = stakingSyntheticDenom + UnstakingSyntheticDenom = unstakingSyntheticDenom +) diff --git a/x/superfluid/keeper/gov/gov.go b/x/superfluid/keeper/gov/gov.go index a5970eda10f..9a2f6f12717 100644 --- a/x/superfluid/keeper/gov/gov.go +++ b/x/superfluid/keeper/gov/gov.go @@ -3,9 +3,10 @@ package gov import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func HandleSetSuperfluidAssetsProposal(ctx sdk.Context, k keeper.Keeper, ek types.EpochKeeper, p *types.SetSuperfluidAssetsProposal) error { diff --git a/x/superfluid/keeper/gov/gov_test.go b/x/superfluid/keeper/gov/gov_test.go index b05a592a215..90f88eaf9ce 100644 --- a/x/superfluid/keeper/gov/gov_test.go +++ b/x/superfluid/keeper/gov/gov_test.go @@ -3,9 +3,10 @@ package gov_test import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/tendermint/crypto/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer" minttypes "github.com/osmosis-labs/osmosis/v7/x/mint/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper/gov" diff --git a/x/superfluid/keeper/gov/suite_test.go b/x/superfluid/keeper/gov/suite_test.go index 1ede4727f47..f9946e68a42 100644 --- a/x/superfluid/keeper/gov/suite_test.go +++ b/x/superfluid/keeper/gov/suite_test.go @@ -4,10 +4,11 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper" ) diff --git a/x/superfluid/keeper/hooks.go b/x/superfluid/keeper/hooks.go index 5f74f4f13b2..8aa674a17b7 100644 --- a/x/superfluid/keeper/hooks.go +++ b/x/superfluid/keeper/hooks.go @@ -4,9 +4,10 @@ import ( "fmt" "time" - sdk "github.com/cosmos/cosmos-sdk/types" epochstypes "github.com/osmosis-labs/osmosis/v7/x/epochs/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // Hooks wrapper struct for incentives keeper. diff --git a/x/superfluid/keeper/intermediary_account.go b/x/superfluid/keeper/intermediary_account.go index cc6d3c5fbe6..f859fb6d344 100644 --- a/x/superfluid/keeper/intermediary_account.go +++ b/x/superfluid/keeper/intermediary_account.go @@ -1,12 +1,13 @@ package keeper import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/gogo/protobuf/proto" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) func (k Keeper) GetAllIntermediaryAccounts(ctx sdk.Context) []types.SuperfluidIntermediaryAccount { diff --git a/x/superfluid/keeper/intermediary_account_test.go b/x/superfluid/keeper/intermediary_account_test.go index d96c7208af9..ee86ab52e3c 100644 --- a/x/superfluid/keeper/intermediary_account_test.go +++ b/x/superfluid/keeper/intermediary_account_test.go @@ -134,5 +134,4 @@ func (suite *KeeperTestSuite) TestLockIdIntermediaryAccountConnection() { // get account addr = suite.App.SuperfluidKeeper.GetLockIdIntermediaryAccountConnection(suite.Ctx, 1) suite.Require().Equal(addr.String(), "") - } diff --git a/x/superfluid/keeper/keeper.go b/x/superfluid/keeper/keeper.go index e50e248562f..854e51b1f55 100644 --- a/x/superfluid/keeper/keeper.go +++ b/x/superfluid/keeper/keeper.go @@ -3,12 +3,13 @@ package keeper import ( "fmt" + "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + "github.com/tendermint/tendermint/libs/log" + "github.com/cosmos/cosmos-sdk/codec" 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/osmosis/v7/x/superfluid/types" - "github.com/tendermint/tendermint/libs/log" ) // Keeper provides a way to manage module storage. diff --git a/x/superfluid/keeper/keeper_test.go b/x/superfluid/keeper/keeper_test.go index 2b6829ff94d..b1c5e4907ef 100644 --- a/x/superfluid/keeper/keeper_test.go +++ b/x/superfluid/keeper/keeper_test.go @@ -4,13 +4,14 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + "github.com/tendermint/tendermint/crypto/ed25519" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/crypto/ed25519" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/app/apptesting" diff --git a/x/superfluid/keeper/msg_server.go b/x/superfluid/keeper/msg_server.go index 67df89e50b1..46bcf6e101a 100644 --- a/x/superfluid/keeper/msg_server.go +++ b/x/superfluid/keeper/msg_server.go @@ -4,9 +4,10 @@ import ( "context" "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) type msgServer struct { diff --git a/x/superfluid/keeper/params.go b/x/superfluid/keeper/params.go index 2e1add40857..4b79f4d1d74 100644 --- a/x/superfluid/keeper/params.go +++ b/x/superfluid/keeper/params.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // GetParams returns the total set params. diff --git a/x/superfluid/keeper/slash.go b/x/superfluid/keeper/slash.go index 56c3e0119f7..35a04049e4f 100644 --- a/x/superfluid/keeper/slash.go +++ b/x/superfluid/keeper/slash.go @@ -3,9 +3,10 @@ package keeper import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/osmoutils" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // SlashLockupsForValidatorSlash should be called before the validator at valAddr is slashed. diff --git a/x/superfluid/keeper/slash_test.go b/x/superfluid/keeper/slash_test.go index 4ecf41ce872..8f09c51bc1f 100644 --- a/x/superfluid/keeper/slash_test.go +++ b/x/superfluid/keeper/slash_test.go @@ -1,10 +1,11 @@ package keeper_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper" + + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) func (suite *KeeperTestSuite) TestBeforeValidatorSlashed() { diff --git a/x/superfluid/keeper/stake.go b/x/superfluid/keeper/stake.go index 8dea0bfb182..365e95db982 100644 --- a/x/superfluid/keeper/stake.go +++ b/x/superfluid/keeper/stake.go @@ -3,11 +3,12 @@ package keeper import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/osmosis-labs/osmosis/v7/osmoutils" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) func (k Keeper) GetTotalSyntheticAssetsLocked(ctx sdk.Context, denom string) sdk.Int { diff --git a/x/superfluid/keeper/stake_test.go b/x/superfluid/keeper/stake_test.go index 4546f623924..09ce46e584a 100644 --- a/x/superfluid/keeper/stake_test.go +++ b/x/superfluid/keeper/stake_test.go @@ -3,13 +3,14 @@ package keeper_test import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" minttypes "github.com/osmosis-labs/osmosis/v7/x/mint/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" abci "github.com/tendermint/tendermint/abci/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) type superfluidDelegation struct { @@ -497,7 +498,7 @@ func (suite *KeeperTestSuite) TestSuperfluidUnbondLock() { _, err = suite.App.LockupKeeper.GetLockByID(suite.Ctx, lock.ID) suite.Require().Error(err) - // check if finished unlocking succesfully increased balance + // check if finished unlocking successfully increased balance balances = suite.App.BankKeeper.GetAllBalances(suite.Ctx, lock.OwnerAddress()) suite.Require().Equal(1, balances.Len()) suite.Require().Equal(denoms[0], balances[0].Denom) diff --git a/x/superfluid/keeper/superfluid_asset.go b/x/superfluid/keeper/superfluid_asset.go index 9b9469cd568..d0d263b0a85 100644 --- a/x/superfluid/keeper/superfluid_asset.go +++ b/x/superfluid/keeper/superfluid_asset.go @@ -1,9 +1,10 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/osmoutils" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // BeginUnwindSuperfluidAsset starts the deletion process for a superfluid asset. diff --git a/x/superfluid/keeper/superfluid_asset_store.go b/x/superfluid/keeper/superfluid_asset_store.go index ffed8b898a5..41d6cf47546 100644 --- a/x/superfluid/keeper/superfluid_asset_store.go +++ b/x/superfluid/keeper/superfluid_asset_store.go @@ -3,10 +3,11 @@ package keeper // This file handles import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/protobuf/proto" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" ) func (k Keeper) SetSuperfluidAsset(ctx sdk.Context, asset types.SuperfluidAsset) { diff --git a/x/superfluid/keeper/superfluid_asset_test.go b/x/superfluid/keeper/superfluid_asset_test.go index 2ce8219b174..34410196c31 100644 --- a/x/superfluid/keeper/superfluid_asset_test.go +++ b/x/superfluid/keeper/superfluid_asset_test.go @@ -1,8 +1,9 @@ package keeper_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (suite *KeeperTestSuite) TestSuperfluidAssetSetGetDeleteFlow() { diff --git a/x/superfluid/keeper/synthetic_lock_wrapper.go b/x/superfluid/keeper/synthetic_lock_wrapper.go index 033a87949a1..4d99ca38661 100644 --- a/x/superfluid/keeper/synthetic_lock_wrapper.go +++ b/x/superfluid/keeper/synthetic_lock_wrapper.go @@ -4,8 +4,9 @@ import ( "fmt" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func stakingSyntheticDenom(denom, valAddr string) string { diff --git a/x/superfluid/keeper/twap_price.go b/x/superfluid/keeper/twap_price.go index cdcb082768c..cdeb09b8f08 100644 --- a/x/superfluid/keeper/twap_price.go +++ b/x/superfluid/keeper/twap_price.go @@ -1,11 +1,12 @@ package keeper import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/protobuf/proto" gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" ) // This function calculates the osmo equivalent worth of an LP share. diff --git a/x/superfluid/keeper/twap_price_test.go b/x/superfluid/keeper/twap_price_test.go index 386f798815c..f54a68d58f2 100644 --- a/x/superfluid/keeper/twap_price_test.go +++ b/x/superfluid/keeper/twap_price_test.go @@ -1,9 +1,10 @@ package keeper_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" epochstypes "github.com/osmosis-labs/osmosis/v7/x/epochs/types" "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (suite *KeeperTestSuite) TestOsmoEquivalentMultiplierSetGetDeleteFlow() { diff --git a/x/superfluid/module.go b/x/superfluid/module.go index b6a2d2666d8..fa78695c92c 100644 --- a/x/superfluid/module.go +++ b/x/superfluid/module.go @@ -6,6 +6,11 @@ import ( "fmt" "math/rand" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -13,10 +18,6 @@ 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/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/osmosis-labs/osmosis/v7/x/mint/client/rest" "github.com/osmosis-labs/osmosis/v7/x/superfluid/client/cli" diff --git a/x/superfluid/simulation/genesis.go b/x/superfluid/simulation/genesis.go index 1d1e5e9fa14..8dae576a113 100644 --- a/x/superfluid/simulation/genesis.go +++ b/x/superfluid/simulation/genesis.go @@ -4,9 +4,10 @@ import ( "encoding/json" "fmt" + "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" ) // RandomizedGenState generates a random GenesisState for staking. diff --git a/x/superfluid/simulation/operations.go b/x/superfluid/simulation/operations.go index 8c3b613e789..11748bb2c5e 100644 --- a/x/superfluid/simulation/operations.go +++ b/x/superfluid/simulation/operations.go @@ -3,18 +3,20 @@ package simulation import ( "math/rand" - "github.com/cosmos/cosmos-sdk/baseapp" osmo_simulation "github.com/osmosis-labs/osmosis/v7/x/simulation" + "github.com/cosmos/cosmos-sdk/baseapp" + + lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" + "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper" + "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" + "github.com/cosmos/cosmos-sdk/codec" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" - "github.com/osmosis-labs/osmosis/v7/x/superfluid/keeper" - "github.com/osmosis-labs/osmosis/v7/x/superfluid/types" ) // Simulation operation weights constants. diff --git a/x/superfluid/types/gov.go b/x/superfluid/types/gov.go index 2d52c0b1946..8f93b45cade 100644 --- a/x/superfluid/types/gov.go +++ b/x/superfluid/types/gov.go @@ -4,8 +4,9 @@ import ( "fmt" "strings" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) const ( diff --git a/x/txfees/client/cli/query.go b/x/txfees/client/cli/query.go index 400d76006a2..ae961941034 100644 --- a/x/txfees/client/cli/query.go +++ b/x/txfees/client/cli/query.go @@ -4,11 +4,12 @@ import ( "fmt" "strings" + "github.com/osmosis-labs/osmosis/v7/x/txfees/types" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - "github.com/osmosis-labs/osmosis/v7/x/txfees/types" - "github.com/spf13/cobra" ) // GetQueryCmd returns the cli query commands for this module. diff --git a/x/txfees/genesis.go b/x/txfees/genesis.go index db185abbbdd..8900cb624b2 100644 --- a/x/txfees/genesis.go +++ b/x/txfees/genesis.go @@ -1,9 +1,10 @@ package txfees import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/txfees/keeper" "github.com/osmosis-labs/osmosis/v7/x/txfees/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // InitGenesis initializes the txfees module's state from a provided genesis diff --git a/x/txfees/keeper/feedecorator_test.go b/x/txfees/keeper/feedecorator_test.go index 8eae6b35970..95c11ff6e91 100644 --- a/x/txfees/keeper/feedecorator_test.go +++ b/x/txfees/keeper/feedecorator_test.go @@ -1,9 +1,10 @@ package keeper_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/txfees/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" "github.com/osmosis-labs/osmosis/v7/x/txfees/keeper" diff --git a/x/txfees/keeper/feetokens.go b/x/txfees/keeper/feetokens.go index 2558fe50ab2..af158a83ac8 100644 --- a/x/txfees/keeper/feetokens.go +++ b/x/txfees/keeper/feetokens.go @@ -1,10 +1,11 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/gogo/protobuf/proto" "github.com/osmosis-labs/osmosis/v7/x/txfees/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // ConvertToBaseToken converts a fee amount in a whitelisted fee token to the base fee token amount. diff --git a/x/txfees/keeper/feetokens_test.go b/x/txfees/keeper/feetokens_test.go index a76d14dbb47..fc001a1089e 100644 --- a/x/txfees/keeper/feetokens_test.go +++ b/x/txfees/keeper/feetokens_test.go @@ -1,8 +1,9 @@ package keeper_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v7/x/txfees/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (suite *KeeperTestSuite) TestBaseDenom() { @@ -217,5 +218,4 @@ func (suite *KeeperTestSuite) TestFeeTokenConversions() { suite.Require().Error(err, "test: %s", tc.name) } } - } diff --git a/x/txfees/keeper/keeper_test.go b/x/txfees/keeper/keeper_test.go index 2c7a4bfaaa4..9d1910bbe1a 100644 --- a/x/txfees/keeper/keeper_test.go +++ b/x/txfees/keeper/keeper_test.go @@ -4,13 +4,14 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + "github.com/tendermint/tendermint/crypto/ed25519" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/crypto/ed25519" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/osmosis-labs/osmosis/v7/app" "github.com/osmosis-labs/osmosis/v7/app/apptesting" diff --git a/x/txfees/keeper/txfee_filters/arb_tx.go b/x/txfees/keeper/txfee_filters/arb_tx.go index db955dffb49..03a7fb80b10 100644 --- a/x/txfees/keeper/txfee_filters/arb_tx.go +++ b/x/txfees/keeper/txfee_filters/arb_tx.go @@ -1,8 +1,9 @@ package txfee_filters import ( - sdk "github.com/cosmos/cosmos-sdk/types" gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // We check if a tx is an arbitrage for the mempool right now by seeing: diff --git a/x/txfees/module.go b/x/txfees/module.go index f2986123188..b1e00ec9a23 100644 --- a/x/txfees/module.go +++ b/x/txfees/module.go @@ -6,16 +6,17 @@ import ( "fmt" "math/rand" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/osmosis-labs/osmosis/v7/x/txfees/client/cli" "github.com/osmosis-labs/osmosis/v7/x/txfees/keeper" diff --git a/x/txfees/types/options.go b/x/txfees/types/options.go index 049284ae7e2..f4e9f5c7c62 100644 --- a/x/txfees/types/options.go +++ b/x/txfees/types/options.go @@ -3,9 +3,10 @@ package types import ( "fmt" + "github.com/spf13/cast" + servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/cast" ) // If Options are not set in a config somewhere,