From c8b8f4967546644062c1f8385aaeb5ad3a837191 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Thu, 2 Jul 2020 17:19:48 +0200 Subject: [PATCH] run make format (#351) * run make format * fix yaml * fixes --- app/ethermint.go | 2 +- app/ethermint_test.go | 4 ++-- app/simulation_test.go | 1 + cmd/emintcli/main.go | 6 +++--- cmd/emintd/genaccounts.go | 5 +++-- core/chain_test.go | 3 ++- crypto/secp256k1_test.go | 4 +++- importer/importer_test.go | 3 ++- rpc/apis.go | 4 +++- rpc/backend.go | 3 ++- rpc/config.go | 1 + rpc/net_api.go | 3 ++- rpc/personal_api.go | 1 + rpc/web3_api.go | 1 + types/account.go | 4 +++- types/account_test.go | 4 +++- x/evm/client/cli/tx.go | 5 +++-- x/evm/client/cli/utils_test.go | 6 ++++-- x/evm/genesis.go | 1 + x/evm/handler.go | 5 +++-- x/evm/keeper/statedb.go | 3 ++- x/evm/types/key.go | 1 + x/evm/types/msg.go | 3 ++- x/evm/types/state_object.go | 1 + x/evm/types/state_transition.go | 3 ++- x/evm/types/utils.go | 4 +++- x/evm/types/utils_test.go | 3 ++- x/faucet/client/cli/query.go | 3 ++- x/faucet/genesis.go | 4 +++- x/faucet/keeper/querier.go | 3 ++- 30 files changed, 64 insertions(+), 30 deletions(-) diff --git a/app/ethermint.go b/app/ethermint.go index 7fd81614..864b6e04 100644 --- a/app/ethermint.go +++ b/app/ethermint.go @@ -24,9 +24,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/supply" - ethermintcodec "github.com/cosmos/ethermint/codec" "github.com/cosmos/ethermint/app/ante" + ethermintcodec "github.com/cosmos/ethermint/codec" eminttypes "github.com/cosmos/ethermint/types" "github.com/cosmos/ethermint/x/evm" "github.com/cosmos/ethermint/x/faucet" diff --git a/app/ethermint_test.go b/app/ethermint_test.go index d5cbdb63..c421b36b 100644 --- a/app/ethermint_test.go +++ b/app/ethermint_test.go @@ -5,12 +5,12 @@ import ( "testing" "github.com/stretchr/testify/require" + + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" "github.com/cosmos/cosmos-sdk/codec" - - abci "github.com/tendermint/tendermint/abci/types" ) func TestEthermintAppExport(t *testing.T) { diff --git a/app/simulation_test.go b/app/simulation_test.go index 1e60f49e..57d85e28 100644 --- a/app/simulation_test.go +++ b/app/simulation_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" diff --git a/cmd/emintcli/main.go b/cmd/emintcli/main.go index 99abe9a1..6e4a9a8b 100644 --- a/cmd/emintcli/main.go +++ b/cmd/emintcli/main.go @@ -13,7 +13,6 @@ import ( emintcrypto "github.com/cosmos/ethermint/crypto" "github.com/cosmos/ethermint/rpc" - "github.com/tendermint/go-amino" tmamino "github.com/tendermint/tendermint/crypto/encoding/amino" "github.com/tendermint/tendermint/libs/cli" @@ -21,6 +20,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" clientkeys "github.com/cosmos/cosmos-sdk/client/keys" clientrpc "github.com/cosmos/cosmos-sdk/client/rpc" + sdkcodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" @@ -85,7 +85,7 @@ func main() { } } -func queryCmd(cdc *amino.Codec) *cobra.Command { +func queryCmd(cdc *sdkcodec.Codec) *cobra.Command { queryCmd := &cobra.Command{ Use: "query", Aliases: []string{"q"}, @@ -106,7 +106,7 @@ func queryCmd(cdc *amino.Codec) *cobra.Command { return queryCmd } -func txCmd(cdc *amino.Codec) *cobra.Command { +func txCmd(cdc *sdkcodec.Codec) *cobra.Command { txCmd := &cobra.Command{ Use: "tx", Short: "Transactions subcommands", diff --git a/cmd/emintd/genaccounts.go b/cmd/emintd/genaccounts.go index 10551e70..94dc5d18 100644 --- a/cmd/emintd/genaccounts.go +++ b/cmd/emintd/genaccounts.go @@ -8,10 +8,10 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/tendermint/go-amino" "github.com/tendermint/tendermint/libs/cli" "github.com/cosmos/cosmos-sdk/client/flags" + sdkcodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" @@ -23,6 +23,7 @@ import ( "github.com/cosmos/ethermint/codec" ethermint "github.com/cosmos/ethermint/types" + ethcrypto "github.com/ethereum/go-ethereum/crypto" ) @@ -35,7 +36,7 @@ const ( // AddGenesisAccountCmd returns add-genesis-account cobra Command. func AddGenesisAccountCmd( - ctx *server.Context, depCdc *amino.Codec, cdc *codec.Codec, defaultNodeHome, defaultClientHome string, + ctx *server.Context, depCdc *sdkcodec.Codec, cdc *codec.Codec, defaultNodeHome, defaultClientHome string, ) *cobra.Command { cmd := &cobra.Command{ diff --git a/core/chain_test.go b/core/chain_test.go index 4d69e95a..aaa81a64 100644 --- a/core/chain_test.go +++ b/core/chain_test.go @@ -7,11 +7,12 @@ import ( "math/big" "testing" + "github.com/stretchr/testify/require" + ethcmn "github.com/ethereum/go-ethereum/common" ethcons "github.com/ethereum/go-ethereum/consensus" ethcore "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/stretchr/testify/require" ) func TestChainContextInterface(t *testing.T) { diff --git a/crypto/secp256k1_test.go b/crypto/secp256k1_test.go index a4f23505..0da4a5a0 100644 --- a/crypto/secp256k1_test.go +++ b/crypto/secp256k1_test.go @@ -3,9 +3,11 @@ package crypto import ( "testing" + "github.com/stretchr/testify/require" + ethcrypto "github.com/ethereum/go-ethereum/crypto" ethsecp256k1 "github.com/ethereum/go-ethereum/crypto/secp256k1" - "github.com/stretchr/testify/require" + tmcrypto "github.com/tendermint/tendermint/crypto" ) diff --git a/importer/importer_test.go b/importer/importer_test.go index 3fab25d5..3df01cac 100644 --- a/importer/importer_test.go +++ b/importer/importer_test.go @@ -13,6 +13,8 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + sdkcodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store" sdkstore "github.com/cosmos/cosmos-sdk/store/types" @@ -35,7 +37,6 @@ import ( ethcrypto "github.com/ethereum/go-ethereum/crypto" ethparams "github.com/ethereum/go-ethereum/params" ethrlp "github.com/ethereum/go-ethereum/rlp" - "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmlog "github.com/tendermint/tendermint/libs/log" diff --git a/rpc/apis.go b/rpc/apis.go index e6672dd9..24d5f95d 100644 --- a/rpc/apis.go +++ b/rpc/apis.go @@ -3,8 +3,10 @@ package rpc import ( - "github.com/cosmos/cosmos-sdk/client/context" emintcrypto "github.com/cosmos/ethermint/crypto" + + "github.com/cosmos/cosmos-sdk/client/context" + "github.com/ethereum/go-ethereum/rpc" ) diff --git a/rpc/backend.go b/rpc/backend.go index 4fae7496..21dae182 100644 --- a/rpc/backend.go +++ b/rpc/backend.go @@ -5,9 +5,10 @@ import ( "math/big" "strconv" - "github.com/cosmos/cosmos-sdk/client/context" evmtypes "github.com/cosmos/ethermint/x/evm/types" + "github.com/cosmos/cosmos-sdk/client/context" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" diff --git a/rpc/config.go b/rpc/config.go index b9670689..012a0243 100644 --- a/rpc/config.go +++ b/rpc/config.go @@ -16,6 +16,7 @@ import ( "github.com/cosmos/ethermint/app" emintcrypto "github.com/cosmos/ethermint/crypto" + "github.com/ethereum/go-ethereum/rpc" "github.com/spf13/cobra" diff --git a/rpc/net_api.go b/rpc/net_api.go index 83c6cab4..56582854 100644 --- a/rpc/net_api.go +++ b/rpc/net_api.go @@ -4,9 +4,10 @@ import ( "fmt" "strconv" + "github.com/spf13/viper" + "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/viper" ) // PublicNetAPI is the eth_ prefixed set of APIs in the Web3 JSON-RPC spec. diff --git a/rpc/personal_api.go b/rpc/personal_api.go index a97220b1..4b845b0b 100644 --- a/rpc/personal_api.go +++ b/rpc/personal_api.go @@ -4,6 +4,7 @@ import ( "context" sdkcontext "github.com/cosmos/cosmos-sdk/client/context" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ) diff --git a/rpc/web3_api.go b/rpc/web3_api.go index fd8dfde5..edff98fd 100644 --- a/rpc/web3_api.go +++ b/rpc/web3_api.go @@ -2,6 +2,7 @@ package rpc import ( "github.com/cosmos/ethermint/version" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" ) diff --git a/types/account.go b/types/account.go index 1963e565..cc22c2e4 100644 --- a/types/account.go +++ b/types/account.go @@ -3,12 +3,14 @@ package types import ( "encoding/json" + "gopkg.in/yaml.v2" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/exported" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + tmamino "github.com/tendermint/tendermint/crypto/encoding/amino" - "gopkg.in/yaml.v2" ethcmn "github.com/ethereum/go-ethereum/common" ethcrypto "github.com/ethereum/go-ethereum/crypto" diff --git a/types/account_test.go b/types/account_test.go index fe27778a..a4c7b2ad 100644 --- a/types/account_test.go +++ b/types/account_test.go @@ -4,9 +4,11 @@ import ( "encoding/json" "testing" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/stretchr/testify/require" + tmamino "github.com/tendermint/tendermint/crypto/encoding/amino" "github.com/tendermint/tendermint/crypto/secp256k1" diff --git a/x/evm/client/cli/tx.go b/x/evm/client/cli/tx.go index b412f670..0e145b5b 100644 --- a/x/evm/client/cli/tx.go +++ b/x/evm/client/cli/tx.go @@ -6,11 +6,12 @@ import ( "strconv" "strings" + "github.com/pkg/errors" + "github.com/spf13/cobra" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethcrypto "github.com/ethereum/go-ethereum/crypto" - "github.com/pkg/errors" - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/context" diff --git a/x/evm/client/cli/utils_test.go b/x/evm/client/cli/utils_test.go index 568bd44a..8ddb3102 100644 --- a/x/evm/client/cli/utils_test.go +++ b/x/evm/client/cli/utils_test.go @@ -3,9 +3,11 @@ package cli import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ethereum/go-ethereum/common" ) func TestAddressFormats(t *testing.T) { diff --git a/x/evm/genesis.go b/x/evm/genesis.go index 78c4d16e..a19f2e7d 100644 --- a/x/evm/genesis.go +++ b/x/evm/genesis.go @@ -7,6 +7,7 @@ import ( emint "github.com/cosmos/ethermint/types" "github.com/cosmos/ethermint/x/evm/types" + abci "github.com/tendermint/tendermint/abci/types" ) diff --git a/x/evm/handler.go b/x/evm/handler.go index a6bf33ae..0f0c421d 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -5,11 +5,12 @@ import ( "github.com/ethereum/go-ethereum/common" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" emint "github.com/cosmos/ethermint/types" "github.com/cosmos/ethermint/x/evm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + tmtypes "github.com/tendermint/tendermint/types" ) diff --git a/x/evm/keeper/statedb.go b/x/evm/keeper/statedb.go index d0f01742..f510f961 100644 --- a/x/evm/keeper/statedb.go +++ b/x/evm/keeper/statedb.go @@ -3,9 +3,10 @@ package keeper import ( "math/big" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/ethermint/x/evm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + ethcmn "github.com/ethereum/go-ethereum/common" ethstate "github.com/ethereum/go-ethereum/core/state" ethtypes "github.com/ethereum/go-ethereum/core/types" diff --git a/x/evm/types/key.go b/x/evm/types/key.go index 94bc804d..6e07641e 100644 --- a/x/evm/types/key.go +++ b/x/evm/types/key.go @@ -2,6 +2,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" + ethcmn "github.com/ethereum/go-ethereum/common" ) diff --git a/x/evm/types/msg.go b/x/evm/types/msg.go index 43fd0a6a..a5b88199 100644 --- a/x/evm/types/msg.go +++ b/x/evm/types/msg.go @@ -8,9 +8,10 @@ import ( "math/big" "sync/atomic" + "github.com/cosmos/ethermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/ethermint/types" ethcmn "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" diff --git a/x/evm/types/state_object.go b/x/evm/types/state_object.go index c07adcab..dbe15579 100644 --- a/x/evm/types/state_object.go +++ b/x/evm/types/state_object.go @@ -11,6 +11,7 @@ import ( authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/ethermint/types" + ethcmn "github.com/ethereum/go-ethereum/common" ethstate "github.com/ethereum/go-ethereum/core/state" ethcrypto "github.com/ethereum/go-ethereum/crypto" diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index 155fdf8b..beaa767a 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -10,9 +10,10 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" + emint "github.com/cosmos/ethermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - emint "github.com/cosmos/ethermint/types" ) // StateTransition defines data to transitionDB in evm diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 27e9b542..3b47535b 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -5,10 +5,12 @@ import ( "math/big" "strings" + "github.com/cosmos/ethermint/crypto" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/ethermint/crypto" + ethcmn "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" ethcrypto "github.com/ethereum/go-ethereum/crypto" diff --git a/x/evm/types/utils_test.go b/x/evm/types/utils_test.go index 7c2e7be2..32d9b8bb 100644 --- a/x/evm/types/utils_test.go +++ b/x/evm/types/utils_test.go @@ -3,9 +3,10 @@ package types import ( "testing" + "github.com/stretchr/testify/require" + ethcmn "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/stretchr/testify/require" ) func TestEvmDataEncoding(t *testing.T) { diff --git a/x/faucet/client/cli/query.go b/x/faucet/client/cli/query.go index 1b6f7238..0a928c7c 100644 --- a/x/faucet/client/cli/query.go +++ b/x/faucet/client/cli/query.go @@ -10,8 +10,9 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/ethermint/x/faucet/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // GetQueryCmd defines evm module queries through the cli diff --git a/x/faucet/genesis.go b/x/faucet/genesis.go index 3625b15e..6e3f7888 100644 --- a/x/faucet/genesis.go +++ b/x/faucet/genesis.go @@ -3,8 +3,10 @@ package faucet import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/ethermint/x/faucet/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + abci "github.com/tendermint/tendermint/abci/types" ) diff --git a/x/faucet/keeper/querier.go b/x/faucet/keeper/querier.go index fc732d4d..f63a928c 100644 --- a/x/faucet/keeper/querier.go +++ b/x/faucet/keeper/querier.go @@ -3,10 +3,11 @@ package keeper import ( abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/ethermint/x/faucet/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/ethermint/x/faucet/types" ) // NewQuerier is the module level router for state queries