From 63b4906d892042147142ad03f70d0d876ffa013d Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Fri, 6 Oct 2023 13:12:36 +0200 Subject: [PATCH] Add gci and format --- Makefile | 5 +- demo/app/ante.go | 11 ++-- demo/app/app.go | 53 ++++++++++---------- demo/app/app_test.go | 6 +-- demo/app/sim_test.go | 7 ++- demo/app/test_helpers.go | 7 +-- demo/app/test_support.go | 6 +-- demo/app/upgrades.go | 10 ++-- demo/cmd/meshd/root.go | 19 +++---- tests/e2e/Makefile | 2 +- tests/e2e/e2e.go | 3 +- tests/e2e/mvp_test.go | 13 ++--- tests/e2e/test_client.go | 9 ++-- tests/starship/main_test.go | 14 ++++-- tests/starship/mvp_test.go | 30 ++++++----- tests/starship/setup/client.go | 20 ++++---- tests/starship/setup/contract.go | 8 +-- tests/starship/setup/main.go | 15 +++--- tests/starship/setup/runner.go | 2 +- tests/starship/setup/setup.go | 5 +- tests/starship/setup/utils.go | 9 ++-- x/meshsecurity/abci.go | 6 +-- x/meshsecurity/client/cli/gov_tx.go | 6 ++- x/meshsecurity/client/cli/query.go | 3 +- x/meshsecurity/client/cli/tx.go | 3 +- x/meshsecurity/keeper/adapter.go | 1 + x/meshsecurity/keeper/common_test.go | 32 ++++++------ x/meshsecurity/keeper/genesis_test.go | 9 ++-- x/meshsecurity/keeper/handler_plugin.go | 9 ++-- x/meshsecurity/keeper/handler_plugin_test.go | 11 ++-- x/meshsecurity/keeper/keeper.go | 3 +- x/meshsecurity/keeper/keeper_test.go | 6 ++- x/meshsecurity/keeper/msg_server.go | 4 +- x/meshsecurity/keeper/msg_server_test.go | 3 +- x/meshsecurity/keeper/querier.go | 1 + x/meshsecurity/keeper/querier_test.go | 3 +- x/meshsecurity/keeper/query_plugin.go | 6 +-- x/meshsecurity/keeper/query_plugin_test.go | 6 ++- x/meshsecurity/keeper/scheduler_test.go | 5 +- x/meshsecurity/keeper/stake.go | 1 + x/meshsecurity/keeper/stake_test.go | 13 ++--- x/meshsecurity/module.go | 4 +- x/meshsecurity/types/expected_keepers.go | 3 +- x/meshsecurity/types/genesis_test.go | 7 ++- x/meshsecurity/types/params.go | 1 + x/meshsecurity/types/tx.go | 1 + x/meshsecurity/types/tx_test.go | 6 ++- 47 files changed, 227 insertions(+), 180 deletions(-) diff --git a/Makefile b/Makefile index 56d03bd7..fa0d44f2 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ test-e2e: format-tools: go install mvdan.cc/gofumpt@v0.4.0 go install github.com/client9/misspell/cmd/misspell@v0.3.4 - go install golang.org/x/tools/cmd/goimports@latest + go install github.com/daixiang0/gci@v0.11.2 lint: format-tools golangci-lint run --tests=false ./demo/... ./x/... @@ -56,7 +56,8 @@ lint: format-tools format: format-tools find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./x/vendor*" -not -path "./contracts*" -not -path "./packages*" -not -path "./docs*"| xargs misspell -w find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./x/vendor*" -not -path "./contracts*" -not -path "./packages*" -not -path "./docs*"| xargs gofumpt -w -s - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./x/vendor*" -not -path "./contracts*" -not -path "./packages*" -not -path "./docs*"| xargs goimports -w -local github.com/osmosis-labs/mesh-security-sdk + find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gci write --skip-generated -s standard -s default -s "prefix(cosmossdk.io)" -s "prefix(github.com/cosmos/cosmos-sdk)" -s "prefix(github.com/osmosis-labs/mesh-security-sdk)" --custom-order + ############################################################################### ### Protobuf ### diff --git a/demo/app/ante.go b/demo/app/ante.go index e408372f..bb267530 100644 --- a/demo/app/ante.go +++ b/demo/app/ante.go @@ -1,16 +1,17 @@ package app import ( + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types" + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + "github.com/cosmos/ibc-go/v7/modules/core/keeper" + errorsmod "cosmossdk.io/errors" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - "github.com/cosmos/ibc-go/v7/modules/core/keeper" - - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC diff --git a/demo/app/app.go b/demo/app/app.go index 40e3e1a5..50b2cd8d 100644 --- a/demo/app/app.go +++ b/demo/app/app.go @@ -8,9 +8,6 @@ import ( "path/filepath" "strings" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" @@ -19,6 +16,33 @@ import ( "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" + icacontroller "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller" + icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" + icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + ibcfee "github.com/cosmos/ibc-go/v7/modules/apps/29-fee" + ibcfeekeeper "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/keeper" + ibcfeetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" + "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v7/modules/core" + ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" + ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/spf13/cast" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -101,29 +125,6 @@ import ( upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icacontroller "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller" - icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - ibcfee "github.com/cosmos/ibc-go/v7/modules/apps/29-fee" - ibcfeekeeper "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/keeper" - ibcfeetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/spf13/cast" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity" meshseckeeper "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/keeper" diff --git a/demo/app/app_test.go b/demo/app/app_test.go index c57f80f8..53550836 100644 --- a/demo/app/app_test.go +++ b/demo/app/app_test.go @@ -4,14 +4,14 @@ import ( "os" "testing" + "github.com/CosmWasm/wasmd/x/wasm" dbm "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/CosmWasm/wasmd/x/wasm" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" ) var emptyWasmOpts []wasm.Option diff --git a/demo/app/sim_test.go b/demo/app/sim_test.go index 937a3c1a..cb1c87ba 100644 --- a/demo/app/sim_test.go +++ b/demo/app/sim_test.go @@ -9,12 +9,14 @@ import ( "strings" "testing" + "github.com/CosmWasm/wasmd/x/wasm" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" @@ -36,9 +38,6 @@ import ( simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" - - "github.com/CosmWasm/wasmd/x/wasm" ) // SimAppChainID hardcoded chainID for simulation diff --git a/demo/app/test_helpers.go b/demo/app/test_helpers.go index 71c825be..f7e0ea77 100644 --- a/demo/app/test_helpers.go +++ b/demo/app/test_helpers.go @@ -9,8 +9,6 @@ import ( "testing" "time" - "cosmossdk.io/math" - "github.com/CosmWasm/wasmd/x/wasm" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" dbm "github.com/cometbft/cometbft-db" @@ -19,6 +17,10 @@ import ( "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + bam "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -42,7 +44,6 @@ import ( minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" ) // SetupOptions defines arguments that are passed into `MeshApp` constructor. diff --git a/demo/app/test_support.go b/demo/app/test_support.go index c9fc96a9..148f97ca 100644 --- a/demo/app/test_support.go +++ b/demo/app/test_support.go @@ -1,14 +1,14 @@ package app import ( + "github.com/CosmWasm/wasmd/x/wasm" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + "github.com/cosmos/cosmos-sdk/baseapp" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - - "github.com/CosmWasm/wasmd/x/wasm" ) func (app *MeshApp) GetIBCKeeper() *ibckeeper.Keeper { diff --git a/demo/app/upgrades.go b/demo/app/upgrades.go index d9aea43a..3bfb7dd7 100644 --- a/demo/app/upgrades.go +++ b/demo/app/upgrades.go @@ -1,6 +1,11 @@ package app import ( + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" + icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + "github.com/cosmos/cosmos-sdk/baseapp" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,11 +22,6 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" ) // UpgradeName defines the on-chain upgrade name for the sample SimApp upgrade diff --git a/demo/cmd/meshd/root.go b/demo/cmd/meshd/root.go index 260d1453..0bbde60d 100644 --- a/demo/cmd/meshd/root.go +++ b/demo/cmd/meshd/root.go @@ -5,10 +5,19 @@ import ( "io" "os" - rosettaCmd "cosmossdk.io/tools/rosetta/cmd" + "github.com/CosmWasm/wasmd/x/wasm" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" dbm "github.com/cometbft/cometbft-db" tmcfg "github.com/cometbft/cometbft/config" "github.com/cometbft/cometbft/libs/log" + "github.com/prometheus/client_golang/prometheus" + "github.com/spf13/cast" + "github.com/spf13/cobra" + "github.com/spf13/viper" + + rosettaCmd "cosmossdk.io/tools/rosetta/cmd" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" @@ -25,17 +34,9 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - "github.com/prometheus/client_golang/prometheus" - "github.com/spf13/cast" - "github.com/spf13/cobra" - "github.com/spf13/viper" "github.com/osmosis-labs/mesh-security-sdk/demo/app" "github.com/osmosis-labs/mesh-security-sdk/demo/app/params" - - "github.com/CosmWasm/wasmd/x/wasm" - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" ) // NewRootCmd creates a new root command for wasmd. It is called once in the diff --git a/tests/e2e/Makefile b/tests/e2e/Makefile index 2303e174..715675c6 100644 --- a/tests/e2e/Makefile +++ b/tests/e2e/Makefile @@ -16,7 +16,7 @@ build-linux: format: find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./x/vendor*" -not -path "./contracts*" -not -path "./packages*" -not -path "./docs*"| xargs misspell -w find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./x/vendor*" -not -path "./contracts*" -not -path "./packages*" -not -path "./docs*"| xargs gofumpt -w -s - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./x/vendor*" -not -path "./contracts*" -not -path "./packages*" -not -path "./docs*"| xargs goimports -w -local github.com/osmosis-labs/mesh-security-sdk + find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gci write --skip-generated -s standard -s default -s "prefix(cosmossdk.io)" -s "prefix(github.com/cosmos/cosmos-sdk)" -s "prefix(github.com/osmosis-labs/mesh-security-sdk)" --custom-order .PHONY: all build build-linux test format diff --git a/tests/e2e/e2e.go b/tests/e2e/e2e.go index 6e95d5ac..0238fc03 100644 --- a/tests/e2e/e2e.go +++ b/tests/e2e/e2e.go @@ -9,11 +9,12 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/cometbft/cometbft/types" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/stretchr/testify/require" "github.com/osmosis-labs/mesh-security-sdk/demo/app" ) diff --git a/tests/e2e/mvp_test.go b/tests/e2e/mvp_test.go index 0e8f0724..3132b717 100644 --- a/tests/e2e/mvp_test.go +++ b/tests/e2e/mvp_test.go @@ -7,20 +7,21 @@ import ( "testing" "time" - "cosmossdk.io/math" - wasmibctesting "github.com/CosmWasm/wasmd/x/wasm/ibctesting" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/cometbft/cometbft/libs/rand" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" ibctesting "github.com/cosmos/ibc-go/v7/testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" + distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/osmosis-labs/mesh-security-sdk/demo/app" ) diff --git a/tests/e2e/test_client.go b/tests/e2e/test_client.go index a1ae349c..39c71634 100644 --- a/tests/e2e/test_client.go +++ b/tests/e2e/test_client.go @@ -7,15 +7,16 @@ import ( "strings" "testing" - "cosmossdk.io/math" - "github.com/CosmWasm/wasmd/x/wasm/ibctesting" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/mesh-security-sdk/demo/app" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" diff --git a/tests/starship/main_test.go b/tests/starship/main_test.go index d91959a4..978eb093 100644 --- a/tests/starship/main_test.go +++ b/tests/starship/main_test.go @@ -2,16 +2,20 @@ package starship import ( "context" - "cosmossdk.io/math" "flag" "fmt" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/osmosis-labs/mesh-security-sdk/tests/starship/setup" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "os" - "testing" ) var ( diff --git a/tests/starship/mvp_test.go b/tests/starship/mvp_test.go index 400c6845..89630863 100644 --- a/tests/starship/mvp_test.go +++ b/tests/starship/mvp_test.go @@ -2,18 +2,22 @@ package starship import ( "context" - "cosmossdk.io/math" "encoding/base64" "fmt" + "strconv" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/osmosis-labs/mesh-security-sdk/tests/starship/setup" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "strconv" - "testing" - "time" ) func Test2WayContract(t *testing.T) { @@ -67,7 +71,7 @@ func Test2WayContract(t *testing.T) { assert.Equal(t, 70_000_000, providerClient1.QueryVaultFreeBalance()) - // wait for initial packets to be transfered via IBC over + // wait for initial packets to be transferred via IBC over validators, err := stakingtypes.NewQueryClient(consumerClient1.Chain.Client).Validators(context.Background(), &stakingtypes.QueryValidatorsRequest{ Status: "BOND_STATUS_BONDED", }) @@ -83,7 +87,7 @@ func Test2WayContract(t *testing.T) { _, err = providerClient1.MustExecVault(execMsg) require.NoError(t, err) - //require.NoError(t, coord.RelayAndAckPendingPackets(ibcPath)) + // require.NoError(t, coord.RelayAndAckPendingPackets(ibcPath)) require.Equal(t, 20_000_000, providerClient1.QueryVaultFreeBalance()) // = 70 (free) + 30 (local) - 80 (remote staked) // then @@ -97,7 +101,7 @@ func Test2WayContract(t *testing.T) { assert.Equal(t, "80000000", qRsp["stake"], qRsp) assert.Empty(t, qRsp["pending_unbonds"]) - // create oposite clients + // create opposite clients providerClient2, consumerClient2, err := setup.MeshSecurity(consumerChain, providerChain, configFile, wasmContractPath, wasmContractGZipped) require.NoError(t, err) require.NotEmpty(t, providerClient2) @@ -145,7 +149,7 @@ func Test2WayContract(t *testing.T) { assert.Equal(t, 70_000_000, providerClient2.QueryVaultFreeBalance()) - // wait for initial packets to be transfered via IBC over + // wait for initial packets to be transferred via IBC over validators, err = stakingtypes.NewQueryClient(consumerClient2.Chain.Client).Validators(context.Background(), &stakingtypes.QueryValidatorsRequest{ Status: "BOND_STATUS_BONDED", }) @@ -161,7 +165,7 @@ func Test2WayContract(t *testing.T) { _, err = providerClient2.MustExecVault(execMsg) require.NoError(t, err) - //require.NoError(t, coord.RelayAndAckPendingPackets(ibcPath)) + // require.NoError(t, coord.RelayAndAckPendingPackets(ibcPath)) require.Equal(t, 20_000_000, providerClient2.QueryVaultFreeBalance()) // = 70 (free) + 30 (local) - 80 (remote staked) // then @@ -201,7 +205,7 @@ func TestMVP(t *testing.T) { providerChain = providerClient.Chain ) - // wait for initial packets to be transfered via IBC over + // wait for initial packets to be transferred via IBC over validators, err := stakingtypes.NewQueryClient(consumerChain.Client).Validators(context.Background(), &stakingtypes.QueryValidatorsRequest{ Status: "BOND_STATUS_BONDED", }) @@ -300,7 +304,7 @@ func TestMVP(t *testing.T) { _, err = providerClient.MustExecVault(execMsg) require.NoError(t, err) - //require.NoError(t, coord.RelayAndAckPendingPackets(ibcPath)) + // require.NoError(t, coord.RelayAndAckPendingPackets(ibcPath)) require.Equal(t, 20_000_000, providerClient.QueryVaultFreeBalance()) // = 70 (free) + 30 (local) - 80 (remote staked) // then diff --git a/tests/starship/setup/client.go b/tests/starship/setup/client.go index 3466591f..dd3d3446 100644 --- a/tests/starship/setup/client.go +++ b/tests/starship/setup/client.go @@ -3,22 +3,22 @@ package setup import ( "context" "fmt" + "os" + "testing" + "time" + coretypes "github.com/cometbft/cometbft/rpc/core/types" starship "github.com/cosmology-tech/starship/clients/go/client" pb "github.com/cosmology-tech/starship/registry/registry" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/go-bip39" + lens "github.com/strangelove-ventures/lens/client" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "os" - "testing" - "time" - - lens "github.com/strangelove-ventures/lens/client" "go.uber.org/zap" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) type Client struct { @@ -184,7 +184,7 @@ func (c *Client) WaitForTx(t *testing.T, txHex string) { }, 300*time.Second, time.Second, - "waited for too long, still txn not successfull", + "waited for too long, still txn not successful", ) require.NotNil(t, tx) } diff --git a/tests/starship/setup/contract.go b/tests/starship/setup/contract.go index c073a30f..200fe75d 100644 --- a/tests/starship/setup/contract.go +++ b/tests/starship/setup/contract.go @@ -4,7 +4,6 @@ import ( "bytes" "compress/gzip" "context" - "cosmossdk.io/math" "encoding/json" "fmt" "os" @@ -15,9 +14,12 @@ import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/gogoproto/proto" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/cosmos/gogoproto/proto" ) func buildPathToWasm(wasmContractPath string, fileName string, wasmContractGZipped bool) string { @@ -95,7 +97,7 @@ func voteAndPassGovProposal(chain *Client, proposalID uint64) error { if err != nil { return err } - fmt.Print("proposal sucessfully passed...") + fmt.Print("proposal successfully passed...") if proposal.Proposal.Status == govv1.ProposalStatus_PROPOSAL_STATUS_PASSED { return nil } diff --git a/tests/starship/setup/main.go b/tests/starship/setup/main.go index edcfeb78..65211d25 100644 --- a/tests/starship/setup/main.go +++ b/tests/starship/setup/main.go @@ -3,20 +3,23 @@ package setup import ( "context" "fmt" + "os" + "strings" + "time" + starship "github.com/cosmology-tech/starship/clients/go/client" + "go.uber.org/zap" + "gopkg.in/yaml.v3" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/bech32" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/osmosis-labs/mesh-security-sdk/demo/app" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" - "go.uber.org/zap" - "gopkg.in/yaml.v3" - "os" - "strings" - "time" ) func MeshSecurity(provider, consumer, configFile, wasmContractPath string, wasmContractGZipped bool) (*ProviderClient, *ConsumerClient, error) { @@ -117,7 +120,7 @@ func MeshSecurity(provider, consumer, configFile, wasmContractPath string, wasmC fmt.Println("hermes output: ", output) - // wait for initial packets to be transfered via IBC over + // wait for initial packets to be transferred via IBC over validators, err := stakingtypes.NewQueryClient(consumerClient.Client).Validators(context.Background(), &stakingtypes.QueryValidatorsRequest{ Status: "BOND_STATUS_BONDED", }) diff --git a/tests/starship/setup/runner.go b/tests/starship/setup/runner.go index 5a49e7c3..0fe14d8c 100644 --- a/tests/starship/setup/runner.go +++ b/tests/starship/setup/runner.go @@ -2,11 +2,11 @@ package setup import ( "fmt" - starship "github.com/cosmology-tech/starship/clients/go/client" "os" "os/exec" "strings" + starship "github.com/cosmology-tech/starship/clients/go/client" "go.uber.org/zap" ) diff --git a/tests/starship/setup/setup.go b/tests/starship/setup/setup.go index f71e9b4c..829e53c1 100644 --- a/tests/starship/setup/setup.go +++ b/tests/starship/setup/setup.go @@ -10,6 +10,7 @@ import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" _ "github.com/cosmology-tech/starship/clients/go/client" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" @@ -225,8 +226,8 @@ type ConsumerContract struct { func (p *ConsumerClient) BootstrapContracts(remoteDenom string) (*ConsumerContract, error) { // what does this do???? // modify end-blocker to fail fast in tests - //msModule := p.app.ModuleManager.Modules[types.ModuleName].(*meshsecurity.AppModule) - //msModule.SetAsyncTaskRspHandler(meshsecurity.PanicOnErrorExecutionResponseHandler()) + // msModule := p.app.ModuleManager.Modules[types.ModuleName].(*meshsecurity.AppModule) + // msModule.SetAsyncTaskRspHandler(meshsecurity.PanicOnErrorExecutionResponseHandler()) code, err := StoreCodeFile(p.Chain, buildPathToWasm(p.wasmContractPath, "mesh_simple_price_feed.wasm", p.wasmContractGZipped)) if err != nil { diff --git a/tests/starship/setup/utils.go b/tests/starship/setup/utils.go index 33cd9e8e..d5e62f1d 100644 --- a/tests/starship/setup/utils.go +++ b/tests/starship/setup/utils.go @@ -2,12 +2,15 @@ package setup import ( "context" - "cosmossdk.io/math" "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) // IBCTransferTokens will transfer chain native token from chain1 to chain2 at given address diff --git a/x/meshsecurity/abci.go b/x/meshsecurity/abci.go index cbadaa34..29e54357 100644 --- a/x/meshsecurity/abci.go +++ b/x/meshsecurity/abci.go @@ -4,11 +4,11 @@ import ( "fmt" "time" - "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/keeper" - "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/keeper" + "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) // TaskExecutionResponseHandler is an extension point for custom implementations diff --git a/x/meshsecurity/client/cli/gov_tx.go b/x/meshsecurity/client/cli/gov_tx.go index ecd065c5..22186946 100644 --- a/x/meshsecurity/client/cli/gov_tx.go +++ b/x/meshsecurity/client/cli/gov_tx.go @@ -4,7 +4,11 @@ import ( "fmt" "strings" + "github.com/pkg/errors" + "github.com/spf13/cobra" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -13,8 +17,6 @@ import ( "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/pkg/errors" - "github.com/spf13/cobra" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) diff --git a/x/meshsecurity/client/cli/query.go b/x/meshsecurity/client/cli/query.go index e6805244..7347b99f 100644 --- a/x/meshsecurity/client/cli/query.go +++ b/x/meshsecurity/client/cli/query.go @@ -4,11 +4,12 @@ import ( "fmt" "strings" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - "github.com/spf13/cobra" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) diff --git a/x/meshsecurity/client/cli/tx.go b/x/meshsecurity/client/cli/tx.go index 2e0da1c0..17525d88 100644 --- a/x/meshsecurity/client/cli/tx.go +++ b/x/meshsecurity/client/cli/tx.go @@ -1,9 +1,10 @@ package cli import ( - "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" + "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) diff --git a/x/meshsecurity/keeper/adapter.go b/x/meshsecurity/keeper/adapter.go index a934641b..7098b67c 100644 --- a/x/meshsecurity/keeper/adapter.go +++ b/x/meshsecurity/keeper/adapter.go @@ -2,6 +2,7 @@ package keeper import ( "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/x/meshsecurity/keeper/common_test.go b/x/meshsecurity/keeper/common_test.go index 9528e8d6..a620d710 100644 --- a/x/meshsecurity/keeper/common_test.go +++ b/x/meshsecurity/keeper/common_test.go @@ -4,27 +4,18 @@ import ( "testing" "time" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/CosmWasm/wasmd/x/wasm/keeper/wasmtesting" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - "github.com/cosmos/cosmos-sdk/baseapp" - authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + dbm "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + "github.com/stretchr/testify/require" - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - dbm "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -37,22 +28,31 @@ import ( authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + "github.com/cosmos/cosmos-sdk/x/feegrant" "github.com/cosmos/cosmos-sdk/x/gov" govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/mint" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - "github.com/stretchr/testify/require" + upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) diff --git a/x/meshsecurity/keeper/genesis_test.go b/x/meshsecurity/keeper/genesis_test.go index 1b4b5792..3bac3dc2 100644 --- a/x/meshsecurity/keeper/genesis_test.go +++ b/x/meshsecurity/keeper/genesis_test.go @@ -1,11 +1,14 @@ package keeper import ( - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" + "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "testing" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) diff --git a/x/meshsecurity/keeper/handler_plugin.go b/x/meshsecurity/keeper/handler_plugin.go index 836b6ff7..80e84c3e 100644 --- a/x/meshsecurity/keeper/handler_plugin.go +++ b/x/meshsecurity/keeper/handler_plugin.go @@ -3,16 +3,15 @@ package keeper import ( "encoding/json" - "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" - + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" wasmvmtypes "github.com/CosmWasm/wasmvm/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/contract" - - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) // AuthSource abstract type that provides contract authorization. diff --git a/x/meshsecurity/keeper/handler_plugin_test.go b/x/meshsecurity/keeper/handler_plugin_test.go index 2cc03355..95bd947e 100644 --- a/x/meshsecurity/keeper/handler_plugin_test.go +++ b/x/meshsecurity/keeper/handler_plugin_test.go @@ -5,17 +5,16 @@ import ( "fmt" "testing" - "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" "github.com/cometbft/cometbft/libs/rand" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) func TestCustomMeshSecDispatchMsg(t *testing.T) { diff --git a/x/meshsecurity/keeper/keeper.go b/x/meshsecurity/keeper/keeper.go index 9002daa0..e1358e22 100644 --- a/x/meshsecurity/keeper/keeper.go +++ b/x/meshsecurity/keeper/keeper.go @@ -3,10 +3,11 @@ package keeper import ( "fmt" + "github.com/cometbft/cometbft/libs/log" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" - "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" diff --git a/x/meshsecurity/keeper/keeper_test.go b/x/meshsecurity/keeper/keeper_test.go index 447a040e..18d6a6c8 100644 --- a/x/meshsecurity/keeper/keeper_test.go +++ b/x/meshsecurity/keeper/keeper_test.go @@ -3,11 +3,13 @@ package keeper import ( "testing" - "cosmossdk.io/math" "github.com/cometbft/cometbft/libs/rand" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestHasMaxCapLimit(t *testing.T) { diff --git a/x/meshsecurity/keeper/msg_server.go b/x/meshsecurity/keeper/msg_server.go index bdb518c7..e6587ae8 100644 --- a/x/meshsecurity/keeper/msg_server.go +++ b/x/meshsecurity/keeper/msg_server.go @@ -3,10 +3,10 @@ package keeper import ( "context" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) diff --git a/x/meshsecurity/keeper/msg_server_test.go b/x/meshsecurity/keeper/msg_server_test.go index 53b35c98..99c8bfe6 100644 --- a/x/meshsecurity/keeper/msg_server_test.go +++ b/x/meshsecurity/keeper/msg_server_test.go @@ -4,10 +4,11 @@ import ( "testing" "github.com/cometbft/cometbft/libs/rand" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) diff --git a/x/meshsecurity/keeper/querier.go b/x/meshsecurity/keeper/querier.go index 875886f0..c70f0b48 100644 --- a/x/meshsecurity/keeper/querier.go +++ b/x/meshsecurity/keeper/querier.go @@ -5,6 +5,7 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/meshsecurity/keeper/querier_test.go b/x/meshsecurity/keeper/querier_test.go index 867183af..6b5b566f 100644 --- a/x/meshsecurity/keeper/querier_test.go +++ b/x/meshsecurity/keeper/querier_test.go @@ -5,10 +5,11 @@ import ( "testing" "github.com/cometbft/cometbft/libs/rand" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) diff --git a/x/meshsecurity/keeper/query_plugin.go b/x/meshsecurity/keeper/query_plugin.go index 36a3eb2e..347593ec 100644 --- a/x/meshsecurity/keeper/query_plugin.go +++ b/x/meshsecurity/keeper/query_plugin.go @@ -3,13 +3,13 @@ package keeper import ( "encoding/json" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" errorsmod "cosmossdk.io/errors" - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/contract" ) diff --git a/x/meshsecurity/keeper/query_plugin_test.go b/x/meshsecurity/keeper/query_plugin_test.go index 72a8d308..c8467422 100644 --- a/x/meshsecurity/keeper/query_plugin_test.go +++ b/x/meshsecurity/keeper/query_plugin_test.go @@ -4,12 +4,14 @@ import ( "fmt" "testing" - "cosmossdk.io/math" wasmvmtypes "github.com/CosmWasm/wasmvm/types" "github.com/cometbft/cometbft/libs/rand" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestChainedCustomQuerier(t *testing.T) { diff --git a/x/meshsecurity/keeper/scheduler_test.go b/x/meshsecurity/keeper/scheduler_test.go index 0e4a1e09..5b040c1e 100644 --- a/x/meshsecurity/keeper/scheduler_test.go +++ b/x/meshsecurity/keeper/scheduler_test.go @@ -4,11 +4,12 @@ import ( "testing" "github.com/cometbft/cometbft/libs/rand" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) diff --git a/x/meshsecurity/keeper/stake.go b/x/meshsecurity/keeper/stake.go index 9c800132..97c04d26 100644 --- a/x/meshsecurity/keeper/stake.go +++ b/x/meshsecurity/keeper/stake.go @@ -2,6 +2,7 @@ package keeper import ( "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/x/meshsecurity/keeper/stake_test.go b/x/meshsecurity/keeper/stake_test.go index 1f1b05b7..0add730c 100644 --- a/x/meshsecurity/keeper/stake_test.go +++ b/x/meshsecurity/keeper/stake_test.go @@ -3,19 +3,20 @@ package keeper import ( "testing" - "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" - - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cometbft/cometbft/libs/rand" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "cosmossdk.io/math" - "github.com/cometbft/cometbft/libs/rand" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtestutil "github.com/cosmos/cosmos-sdk/x/staking/testutil" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" + + "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/types" ) func TestDelegateVirtualStake(t *testing.T) { diff --git a/x/meshsecurity/module.go b/x/meshsecurity/module.go index c717c5d6..3c04b196 100644 --- a/x/meshsecurity/module.go +++ b/x/meshsecurity/module.go @@ -6,14 +6,14 @@ import ( "fmt" abci "github.com/cometbft/cometbft/abci/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/client/cli" "github.com/osmosis-labs/mesh-security-sdk/x/meshsecurity/keeper" diff --git a/x/meshsecurity/types/expected_keepers.go b/x/meshsecurity/types/expected_keepers.go index 1403ca66..4e8d0501 100644 --- a/x/meshsecurity/types/expected_keepers.go +++ b/x/meshsecurity/types/expected_keepers.go @@ -5,9 +5,8 @@ import ( "cosmossdk.io/math" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) diff --git a/x/meshsecurity/types/genesis_test.go b/x/meshsecurity/types/genesis_test.go index 6f2c3b00..72457177 100644 --- a/x/meshsecurity/types/genesis_test.go +++ b/x/meshsecurity/types/genesis_test.go @@ -1,10 +1,13 @@ package types import ( + "testing" + + "github.com/stretchr/testify/assert" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/assert" - "testing" ) func TestValidateGenesis(t *testing.T) { diff --git a/x/meshsecurity/types/params.go b/x/meshsecurity/types/params.go index aab35414..25c3a1a4 100644 --- a/x/meshsecurity/types/params.go +++ b/x/meshsecurity/types/params.go @@ -3,6 +3,7 @@ package types import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/meshsecurity/types/tx.go b/x/meshsecurity/types/tx.go index 5f4d7fc6..33b1056e 100644 --- a/x/meshsecurity/types/tx.go +++ b/x/meshsecurity/types/tx.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/meshsecurity/types/tx_test.go b/x/meshsecurity/types/tx_test.go index e11d931d..6184cfb1 100644 --- a/x/meshsecurity/types/tx_test.go +++ b/x/meshsecurity/types/tx_test.go @@ -3,11 +3,13 @@ package types import ( "testing" - "cosmossdk.io/math" "github.com/cometbft/cometbft/libs/rand" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestValidateMsgSetVirtualStakingMaxCap(t *testing.T) {