From 1d0967c32a76f33574748355541d8c7238d09983 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 20 Mar 2020 18:14:14 +0100 Subject: [PATCH] run go mod tidy && make format (#5847) --- go.sum | 2 -- server/pruning.go | 3 ++- store/transient/store_test.go | 3 ++- tests/mocks/account_retriever.go | 3 ++- tests/mocks/tendermint_tm_db_DB.go | 3 ++- tests/mocks/types_handler.go | 6 ++++-- tests/mocks/types_invariant.go | 6 ++++-- tests/mocks/types_module_module.go | 10 ++++++---- tests/mocks/types_router.go | 6 ++++-- x/distribution/keeper/delegation_test.go | 3 ++- x/distribution/keeper/querier_test.go | 5 +++-- x/distribution/module_test.go | 5 +++-- x/distribution/proposal_handler_test.go | 3 ++- x/slashing/abci_test.go | 5 +++-- x/slashing/keeper/test_common.go | 3 ++- x/staking/keeper/keeper_test.go | 3 ++- x/staking/keeper/slash_test.go | 3 ++- 17 files changed, 45 insertions(+), 27 deletions(-) diff --git a/go.sum b/go.sum index 27c01d225f..620da8f539 100644 --- a/go.sum +++ b/go.sum @@ -414,8 +414,6 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= github.com/tendermint/go-amino v0.15.1 h1:D2uk35eT4iTsvJd9jWIetzthE5C0/k2QmMFkCN+4JgQ= github.com/tendermint/go-amino v0.15.1/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/iavl v0.13.1 h1:KWg3NVqOZLJFCLKpUJjUprdWAgIYdC9GDJLN8PBmKbI= -github.com/tendermint/iavl v0.13.1/go.mod h1:vE1u0XAGXYjHykd4BLp8p/yivrw2PF1TuoljBcsQoGA= github.com/tendermint/iavl v0.13.2 h1:O1m08/Ciy53l9IYmf75uIRVvrNsfjEbre8u/yCu/oqk= github.com/tendermint/iavl v0.13.2/go.mod h1:vE1u0XAGXYjHykd4BLp8p/yivrw2PF1TuoljBcsQoGA= github.com/tendermint/tendermint v0.33.2 h1:NzvRMTuXJxqSsFed2J7uHmMU5N1CVzSpfi3nCc882KY= diff --git a/server/pruning.go b/server/pruning.go index 07730f36ad..712ed2a34c 100644 --- a/server/pruning.go +++ b/server/pruning.go @@ -1,8 +1,9 @@ package server import ( - "github.com/cosmos/cosmos-sdk/store" "github.com/spf13/viper" + + "github.com/cosmos/cosmos-sdk/store" ) // GetPruningOptionsFromFlags parses start command flags and returns the correct PruningOptions. diff --git a/store/transient/store_test.go b/store/transient/store_test.go index 113d95be86..632b561b61 100644 --- a/store/transient/store_test.go +++ b/store/transient/store_test.go @@ -4,9 +4,10 @@ import ( "bytes" "testing" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/store/transient" "github.com/cosmos/cosmos-sdk/store/types" - "github.com/stretchr/testify/require" ) var k, v = []byte("hello"), []byte("world") diff --git a/tests/mocks/account_retriever.go b/tests/mocks/account_retriever.go index a3086c77bd..5fa7807c8f 100644 --- a/tests/mocks/account_retriever.go +++ b/tests/mocks/account_retriever.go @@ -5,8 +5,9 @@ package mocks import ( - gomock "github.com/golang/mock/gomock" reflect "reflect" + + gomock "github.com/golang/mock/gomock" ) // MockNodeQuerier is a mock of NodeQuerier interface diff --git a/tests/mocks/tendermint_tm_db_DB.go b/tests/mocks/tendermint_tm_db_DB.go index bed59a498d..ccfc26909b 100644 --- a/tests/mocks/tendermint_tm_db_DB.go +++ b/tests/mocks/tendermint_tm_db_DB.go @@ -5,9 +5,10 @@ package mocks import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" tm_db "github.com/tendermint/tm-db" - reflect "reflect" ) // MockDB is a mock of DB interface diff --git a/tests/mocks/types_handler.go b/tests/mocks/types_handler.go index da80614ae8..c16f5d5953 100644 --- a/tests/mocks/types_handler.go +++ b/tests/mocks/types_handler.go @@ -5,9 +5,11 @@ package mocks import ( - types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" reflect "reflect" + + gomock "github.com/golang/mock/gomock" + + types "github.com/cosmos/cosmos-sdk/types" ) // MockAnteDecorator is a mock of AnteDecorator interface diff --git a/tests/mocks/types_invariant.go b/tests/mocks/types_invariant.go index 325b108b20..974099c52b 100644 --- a/tests/mocks/types_invariant.go +++ b/tests/mocks/types_invariant.go @@ -5,9 +5,11 @@ package mocks import ( - types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" reflect "reflect" + + gomock "github.com/golang/mock/gomock" + + types "github.com/cosmos/cosmos-sdk/types" ) // MockInvariantRegistry is a mock of InvariantRegistry interface diff --git a/tests/mocks/types_module_module.go b/tests/mocks/types_module_module.go index 274ac5c063..94fcc2384e 100644 --- a/tests/mocks/types_module_module.go +++ b/tests/mocks/types_module_module.go @@ -6,14 +6,16 @@ package mocks import ( json "encoding/json" - context "github.com/cosmos/cosmos-sdk/client/context" - codec "github.com/cosmos/cosmos-sdk/codec" - types "github.com/cosmos/cosmos-sdk/types" + reflect "reflect" + gomock "github.com/golang/mock/gomock" mux "github.com/gorilla/mux" cobra "github.com/spf13/cobra" types0 "github.com/tendermint/tendermint/abci/types" - reflect "reflect" + + context "github.com/cosmos/cosmos-sdk/client/context" + codec "github.com/cosmos/cosmos-sdk/codec" + types "github.com/cosmos/cosmos-sdk/types" ) // MockAppModuleBasic is a mock of AppModuleBasic interface diff --git a/tests/mocks/types_router.go b/tests/mocks/types_router.go index 924d95146e..5a73d5c909 100644 --- a/tests/mocks/types_router.go +++ b/tests/mocks/types_router.go @@ -5,9 +5,11 @@ package mocks import ( - types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" reflect "reflect" + + gomock "github.com/golang/mock/gomock" + + types "github.com/cosmos/cosmos-sdk/types" ) // MockRouter is a mock of Router interface diff --git a/x/distribution/keeper/delegation_test.go b/x/distribution/keeper/delegation_test.go index 149a149132..44b2bf71f9 100644 --- a/x/distribution/keeper/delegation_test.go +++ b/x/distribution/keeper/delegation_test.go @@ -5,10 +5,11 @@ import ( abci "github.com/tendermint/tendermint/abci/types" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" - "github.com/stretchr/testify/require" ) func TestCalculateRewardsBasic(t *testing.T) { diff --git a/x/distribution/keeper/querier_test.go b/x/distribution/keeper/querier_test.go index 307084b28d..c07a6b29e4 100644 --- a/x/distribution/keeper/querier_test.go +++ b/x/distribution/keeper/querier_test.go @@ -4,6 +4,9 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" @@ -11,8 +14,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/supply" - "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" ) const custom = "custom" diff --git a/x/distribution/module_test.go b/x/distribution/module_test.go index 83bf1b0ef6..2fe6cb58a8 100644 --- a/x/distribution/module_test.go +++ b/x/distribution/module_test.go @@ -5,10 +5,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/distribution" - "github.com/cosmos/cosmos-sdk/simapp" - "github.com/cosmos/cosmos-sdk/x/supply" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/abci/types" + + "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/x/supply" ) func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { diff --git a/x/distribution/proposal_handler_test.go b/x/distribution/proposal_handler_test.go index 158c275a99..0fcb9c843e 100644 --- a/x/distribution/proposal_handler_test.go +++ b/x/distribution/proposal_handler_test.go @@ -5,9 +5,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/distribution" - "github.com/cosmos/cosmos-sdk/simapp" abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/simapp" + "github.com/tendermint/tendermint/crypto/ed25519" "github.com/stretchr/testify/require" diff --git a/x/slashing/abci_test.go b/x/slashing/abci_test.go index cd9efc5537..fcff517deb 100644 --- a/x/slashing/abci_test.go +++ b/x/slashing/abci_test.go @@ -4,13 +4,14 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" "github.com/cosmos/cosmos-sdk/x/staking" - "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" ) func TestBeginBlocker(t *testing.T) { diff --git a/x/slashing/keeper/test_common.go b/x/slashing/keeper/test_common.go index 20eb8eda64..d65fda6bc6 100644 --- a/x/slashing/keeper/test_common.go +++ b/x/slashing/keeper/test_common.go @@ -5,10 +5,11 @@ package keeper // noalias import ( + "github.com/tendermint/tendermint/crypto" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" - "github.com/tendermint/tendermint/crypto" ) // TODO remove dependencies on staking (should only refer to validator set type from sdk) diff --git a/x/staking/keeper/keeper_test.go b/x/staking/keeper/keeper_test.go index 8b59555e65..10fd2253b7 100644 --- a/x/staking/keeper/keeper_test.go +++ b/x/staking/keeper/keeper_test.go @@ -5,9 +5,10 @@ import ( "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/x/staking/types" - abci "github.com/tendermint/tendermint/abci/types" ) func TestParams(t *testing.T) { diff --git a/x/staking/keeper/slash_test.go b/x/staking/keeper/slash_test.go index e333967a8c..b5ea1b8195 100644 --- a/x/staking/keeper/slash_test.go +++ b/x/staking/keeper/slash_test.go @@ -10,11 +10,12 @@ import ( abci "github.com/tendermint/tendermint/abci/types" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" ) // bootstrapSlashTest creates 3 validators and bootstrap the app.