diff --git a/client/config.go b/client/config.go index d785093a3..c49a6f9de 100644 --- a/client/config.go +++ b/client/config.go @@ -16,6 +16,9 @@ import ( const ( flagGet = "get" + + // DefaultKeyPass contains the default key password for genesis transactions + DefaultKeyPass = "12345678" ) var configDefaults = map[string]string{ diff --git a/client/config_test.go b/client/config_test.go index 6263a212a..1ff3b34f6 100644 --- a/client/config_test.go +++ b/client/config_test.go @@ -1,14 +1,15 @@ package client import ( - "github.com/spf13/viper" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/cli" "io/ioutil" "os" "path/filepath" "testing" + + "github.com/spf13/viper" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/cli" ) // For https://github.com/cosmos/cosmos-sdk/issues/3899 diff --git a/client/keys/add.go b/client/keys/add.go index 7ab5ecdb8..49a275bf6 100644 --- a/client/keys/add.go +++ b/client/keys/add.go @@ -7,7 +7,6 @@ import ( "sort" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/cmd/gaia/app" "github.com/cosmos/cosmos-sdk/crypto/keys" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,7 +15,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - bip39 "github.com/cosmos/go-bip39" + "github.com/cosmos/go-bip39" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/multisig" @@ -102,7 +101,7 @@ func runAddCmd(_ *cobra.Command, args []string) error { // we throw this away, so don't enforce args, // we want to get a new random seed phrase quickly kb = keys.NewInMemory() - encryptPassword = app.DefaultKeyPass + encryptPassword = client.DefaultKeyPass } else { kb, err = NewKeyBaseFromHomeFlag() if err != nil { diff --git a/client/keys/delete_test.go b/client/keys/delete_test.go index ad7b5367f..6fda75cbd 100644 --- a/client/keys/delete_test.go +++ b/client/keys/delete_test.go @@ -7,11 +7,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/tests" "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/libs/cli" + + "github.com/cosmos/cosmos-sdk/tests" ) func Test_runDeleteCmd(t *testing.T) { diff --git a/client/keys/list.go b/client/keys/list.go index 19873aabb..2e1ef1938 100644 --- a/client/keys/list.go +++ b/client/keys/list.go @@ -1,8 +1,9 @@ package keys import ( - "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" ) func listKeysCmd() *cobra.Command { diff --git a/client/keys/list_test.go b/client/keys/list_test.go index 9fdab6a75..fe0ac4634 100644 --- a/client/keys/list_test.go +++ b/client/keys/list_test.go @@ -3,9 +3,10 @@ package keys import ( "testing" - "github.com/cosmos/cosmos-sdk/tests" "github.com/stretchr/testify/assert" + "github.com/cosmos/cosmos-sdk/tests" + "github.com/spf13/viper" "github.com/tendermint/tendermint/libs/cli" diff --git a/client/keys/show.go b/client/keys/show.go index eaa800e11..131b45f5e 100644 --- a/client/keys/show.go +++ b/client/keys/show.go @@ -3,6 +3,7 @@ package keys import ( "errors" "fmt" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/crypto" diff --git a/client/keys/update_test.go b/client/keys/update_test.go index e1c6784f1..78f336345 100644 --- a/client/keys/update_test.go +++ b/client/keys/update_test.go @@ -7,10 +7,11 @@ import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/tests" "github.com/spf13/viper" "github.com/tendermint/tendermint/libs/cli" + "github.com/cosmos/cosmos-sdk/tests" + "github.com/stretchr/testify/assert" ) diff --git a/client/lcd/lcd_test.go b/client/lcd/lcd_test.go index 0ead2f363..580d6eaed 100644 --- a/client/lcd/lcd_test.go +++ b/client/lcd/lcd_test.go @@ -18,7 +18,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/keys" clienttx "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/cosmos/cosmos-sdk/cmd/gaia/app" "github.com/cosmos/cosmos-sdk/crypto/keys/mintkey" "github.com/cosmos/cosmos-sdk/tests" sdk "github.com/cosmos/cosmos-sdk/types" @@ -38,7 +37,7 @@ const ( name2 = "test2" name3 = "test3" memo = "LCD test tx" - pw = app.DefaultKeyPass + pw = client.DefaultKeyPass altPw = "12345678901" ) diff --git a/client/lcd/test_helpers.go b/client/lcd/test_helpers.go index 856efaf95..127e8992a 100644 --- a/client/lcd/test_helpers.go +++ b/client/lcd/test_helpers.go @@ -695,7 +695,7 @@ func doTransferWithGas( kb := crkeys.NewInMemory() receiveInfo, _, err := kb.CreateMnemonic( - "receive_address", crkeys.English, gapp.DefaultKeyPass, crkeys.SigningAlgo("secp256k1"), + "receive_address", crkeys.English, client.DefaultKeyPass, crkeys.SigningAlgo("secp256k1"), ) require.Nil(t, err) @@ -742,7 +742,7 @@ func doTransferWithGasAccAuto( acc := getAccount(t, port, addr) receiveInfo, _, err := kb.CreateMnemonic( - "receive_address", crkeys.English, gapp.DefaultKeyPass, crkeys.SigningAlgo("secp256k1"), + "receive_address", crkeys.English, client.DefaultKeyPass, crkeys.SigningAlgo("secp256k1"), ) require.Nil(t, err) diff --git a/client/tx/utils.go b/client/tx/utils.go index 41dfd72e8..b15ac43f8 100644 --- a/client/tx/utils.go +++ b/client/tx/utils.go @@ -6,11 +6,12 @@ import ( "strings" "time" + ctypes "github.com/tendermint/tendermint/rpc/core/types" + "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" - ctypes "github.com/tendermint/tendermint/rpc/core/types" ) // SearchTxs performs a search for transactions for a given set of tags via diff --git a/cmd/gaia/app/app.go b/cmd/gaia/app/app.go index fa64c48d5..24d24ee87 100644 --- a/cmd/gaia/app/app.go +++ b/cmd/gaia/app/app.go @@ -27,8 +27,6 @@ import ( const ( appName = "GaiaApp" - // DefaultKeyPass contains the default key password for genesis transactions - DefaultKeyPass = "12345678" ) // default home directories for expected binaries diff --git a/cmd/gaia/cli_test/test_helpers.go b/cmd/gaia/cli_test/test_helpers.go index aac07abb2..010fd05d5 100644 --- a/cmd/gaia/cli_test/test_helpers.go +++ b/cmd/gaia/cli_test/test_helpers.go @@ -10,6 +10,8 @@ import ( "testing" "time" + "github.com/cosmos/cosmos-sdk/client" + "github.com/stretchr/testify/require" cmn "github.com/tendermint/tendermint/libs/common" @@ -177,7 +179,7 @@ func (f *Fixtures) UnsafeResetAll(flags ...string) { // NOTE: GDInit sets the ChainID for the Fixtures instance func (f *Fixtures) GDInit(moniker string, flags ...string) { cmd := fmt.Sprintf("../../../build/gaiad init -o --home=%s %s", f.GDHome, moniker) - _, stderr := tests.ExecuteT(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + _, stderr := tests.ExecuteT(f.T, addFlags(cmd, flags), client.DefaultKeyPass) var chainID string var initRes map[string]json.RawMessage @@ -200,13 +202,13 @@ func (f *Fixtures) AddGenesisAccount(address sdk.AccAddress, coins sdk.Coins, fl // GenTx is gaiad gentx func (f *Fixtures) GenTx(name string, flags ...string) { cmd := fmt.Sprintf("../../../build/gaiad gentx --name=%s --home=%s --home-client=%s", name, f.GDHome, f.GCLIHome) - executeWriteCheckErr(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } // CollectGenTxs is gaiad collect-gentxs func (f *Fixtures) CollectGenTxs(flags ...string) { cmd := fmt.Sprintf("../../../build/gaiad collect-gentxs --home=%s", f.GDHome) - executeWriteCheckErr(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } // GDStart runs gaiad start with the appropriate flags and returns a process @@ -245,19 +247,19 @@ func (f *Fixtures) KeysDelete(name string, flags ...string) { // KeysAdd is gaiacli keys add func (f *Fixtures) KeysAdd(name string, flags ...string) { cmd := fmt.Sprintf("../../../build/gaiacli keys add --home=%s %s", f.GCLIHome, name) - executeWriteCheckErr(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } // KeysAddRecover prepares gaiacli keys add --recover func (f *Fixtures) KeysAddRecover(name, mnemonic string, flags ...string) { cmd := fmt.Sprintf("../../../build/gaiacli keys add --home=%s --recover %s", f.GCLIHome, name) - executeWriteCheckErr(f.T, addFlags(cmd, flags), app.DefaultKeyPass, mnemonic) + executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass, mnemonic) } // KeysAddRecoverHDPath prepares gaiacli keys add --recover --account --index func (f *Fixtures) KeysAddRecoverHDPath(name, mnemonic string, account uint32, index uint32, flags ...string) { cmd := fmt.Sprintf("../../../build/gaiacli keys add --home=%s --recover %s --account %d --index %d", f.GCLIHome, name, account, index) - executeWriteCheckErr(f.T, addFlags(cmd, flags), app.DefaultKeyPass, mnemonic) + executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass, mnemonic) } // KeysShow is gaiacli keys show @@ -293,7 +295,7 @@ func (f *Fixtures) CLIConfig(key, value string, flags ...string) { // TxSend is gaiacli tx send func (f *Fixtures) TxSend(from string, to sdk.AccAddress, amount sdk.Coin, flags ...string) (bool, string, string) { cmd := fmt.Sprintf("../../../build/gaiacli tx send %s %s %v --from=%s", to, amount, f.Flags(), from) - return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } func (f *Fixtures) txSendWithConfirm( @@ -301,25 +303,25 @@ func (f *Fixtures) txSendWithConfirm( ) (bool, string, string) { cmd := fmt.Sprintf("../../../build/gaiacli tx send %s %s %v --from=%s", to, amount, f.Flags(), from) - return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), confirm, app.DefaultKeyPass) + return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), confirm, client.DefaultKeyPass) } // TxSign is gaiacli tx sign func (f *Fixtures) TxSign(signer, fileName string, flags ...string) (bool, string, string) { cmd := fmt.Sprintf("../../../build/gaiacli tx sign %v --from=%s %v", f.Flags(), signer, fileName) - return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } // TxBroadcast is gaiacli tx broadcast func (f *Fixtures) TxBroadcast(fileName string, flags ...string) (bool, string, string) { cmd := fmt.Sprintf("../../../build/gaiacli tx broadcast %v %v", f.Flags(), fileName) - return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } // TxEncode is gaiacli tx encode func (f *Fixtures) TxEncode(fileName string, flags ...string) (bool, string, string) { cmd := fmt.Sprintf("../../../build/gaiacli tx encode %v %v", f.Flags(), fileName) - return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } // TxMultisign is gaiacli tx multisign @@ -341,13 +343,13 @@ func (f *Fixtures) TxStakingCreateValidator(from, consPubKey string, amount sdk. cmd += fmt.Sprintf(" --amount=%v --moniker=%v --commission-rate=%v", amount, from, "0.05") cmd += fmt.Sprintf(" --commission-max-rate=%v --commission-max-change-rate=%v", "0.20", "0.10") cmd += fmt.Sprintf(" --min-self-delegation=%v", "1") - return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } // TxStakingUnbond is gaiacli tx staking unbond func (f *Fixtures) TxStakingUnbond(from, shares string, validator sdk.ValAddress, flags ...string) bool { cmd := fmt.Sprintf("../../../build/gaiacli tx staking unbond %s %v --from=%s %v", validator, shares, from, f.Flags()) - return executeWrite(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + return executeWrite(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } //___________________________________________________________________________________ @@ -357,19 +359,19 @@ func (f *Fixtures) TxStakingUnbond(from, shares string, validator sdk.ValAddress func (f *Fixtures) TxGovSubmitProposal(from, typ, title, description string, deposit sdk.Coin, flags ...string) (bool, string, string) { cmd := fmt.Sprintf("../../../build/gaiacli tx gov submit-proposal %v --from=%s --type=%s", f.Flags(), from, typ) cmd += fmt.Sprintf(" --title=%s --description=%s --deposit=%s", title, description, deposit) - return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } // TxGovDeposit is gaiacli tx gov deposit func (f *Fixtures) TxGovDeposit(proposalID int, from string, amount sdk.Coin, flags ...string) (bool, string, string) { cmd := fmt.Sprintf("../../../build/gaiacli tx gov deposit %d %s --from=%s %v", proposalID, amount, from, f.Flags()) - return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } // TxGovVote is gaiacli tx gov vote func (f *Fixtures) TxGovVote(proposalID int, option gov.VoteOption, from string, flags ...string) (bool, string, string) { cmd := fmt.Sprintf("../../../build/gaiacli tx gov vote %d %s --from=%s %v", proposalID, option, from, f.Flags()) - return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), app.DefaultKeyPass) + return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } //___________________________________________________________________________________ diff --git a/cmd/gaia/cmd/gaiakeyutil/main.go b/cmd/gaia/cmd/gaiakeyutil/main.go index 46eefc69c..30aebed3b 100644 --- a/cmd/gaia/cmd/gaiakeyutil/main.go +++ b/cmd/gaia/cmd/gaiakeyutil/main.go @@ -5,8 +5,9 @@ import ( "fmt" "os" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/tendermint/libs/bech32" + + sdk "github.com/cosmos/cosmos-sdk/types" ) var bech32Prefixes = []string{ diff --git a/cmd/gaia/init/gentx_test.go b/cmd/gaia/init/gentx_test.go index d99a562fc..b83088b14 100644 --- a/cmd/gaia/init/gentx_test.go +++ b/cmd/gaia/init/gentx_test.go @@ -3,15 +3,16 @@ package init import ( "testing" - "github.com/cosmos/cosmos-sdk/server" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/client/cli" "github.com/spf13/viper" "github.com/stretchr/testify/require" tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" cfg "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/libs/log" + + "github.com/cosmos/cosmos-sdk/server" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/staking/client/cli" ) func Test_prepareFlagsForTxCreateValidator(t *testing.T) { diff --git a/cmd/gaia/init/init_test.go b/cmd/gaia/init/init_test.go index 39975bb29..abfc343d1 100644 --- a/cmd/gaia/init/init_test.go +++ b/cmd/gaia/init/init_test.go @@ -8,16 +8,17 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/cmd/gaia/app" - "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/server/mock" "github.com/spf13/viper" "github.com/stretchr/testify/require" abciServer "github.com/tendermint/tendermint/abci/server" tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" "github.com/tendermint/tendermint/libs/cli" "github.com/tendermint/tendermint/libs/log" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/cmd/gaia/app" + "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/server/mock" ) func TestInitCmd(t *testing.T) { diff --git a/cmd/gaia/init/testnet.go b/cmd/gaia/init/testnet.go index fc59827a6..334286335 100644 --- a/cmd/gaia/init/testnet.go +++ b/cmd/gaia/init/testnet.go @@ -157,7 +157,7 @@ func initTestnet(config *tmconfig.Config, cdc *codec.Codec) error { buf := client.BufferStdin() prompt := fmt.Sprintf( - "Password for account '%s' (default %s):", nodeDirName, app.DefaultKeyPass, + "Password for account '%s' (default %s):", nodeDirName, client.DefaultKeyPass, ) keyPass, err := client.GetPassword(prompt, buf) @@ -169,7 +169,7 @@ func initTestnet(config *tmconfig.Config, cdc *codec.Codec) error { } if keyPass == "" { - keyPass = app.DefaultKeyPass + keyPass = client.DefaultKeyPass } addr, secret, err := server.GenerateSaveCoinKey(clientDir, nodeDirName, keyPass, true) @@ -217,7 +217,7 @@ func initTestnet(config *tmconfig.Config, cdc *codec.Codec) error { tx := auth.NewStdTx([]sdk.Msg{msg}, auth.StdFee{}, []auth.StdSignature{}, memo) txBldr := authtx.NewTxBuilderFromCLI().WithChainID(chainID).WithMemo(memo).WithKeybase(kb) - signedTx, err := txBldr.SignStdTx(nodeDirName, app.DefaultKeyPass, tx, false) + signedTx, err := txBldr.SignStdTx(nodeDirName, client.DefaultKeyPass, tx, false) if err != nil { _ = os.RemoveAll(outDir) return err diff --git a/cmd/gaia/init/validate_genesis.go b/cmd/gaia/init/validate_genesis.go index eb0eaa3a2..e98fdbeda 100644 --- a/cmd/gaia/init/validate_genesis.go +++ b/cmd/gaia/init/validate_genesis.go @@ -4,11 +4,12 @@ import ( "fmt" "os" + "github.com/spf13/cobra" + "github.com/tendermint/tendermint/types" + "github.com/cosmos/cosmos-sdk/cmd/gaia/app" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/server" - "github.com/spf13/cobra" - "github.com/tendermint/tendermint/types" ) // Validate genesis command takes diff --git a/cmd/sdkch/main.go b/cmd/sdkch/main.go index df3a78145..d199bc454 100644 --- a/cmd/sdkch/main.go +++ b/cmd/sdkch/main.go @@ -198,8 +198,8 @@ func generateChangelog(version string) { } func pruneEmptyDirectories() { - for sectionDir, _ := range sections { - for stanzaDir, _ := range stanzas { + for sectionDir := range sections { + for stanzaDir := range stanzas { mustPruneDirIfEmpty(filepath.Join(entriesDir, sectionDir, stanzaDir)) } mustPruneDirIfEmpty(filepath.Join(entriesDir, sectionDir)) diff --git a/codec/codec.go b/codec/codec.go index 175eb89c1..21e0b6977 100644 --- a/codec/codec.go +++ b/codec/codec.go @@ -5,7 +5,7 @@ import ( "encoding/json" amino "github.com/tendermint/go-amino" - "github.com/tendermint/tendermint/crypto/encoding/amino" + cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" ) // amino codec to marshal/unmarshal diff --git a/crypto/amino.go b/crypto/amino.go index 3a12c9681..327f8090d 100644 --- a/crypto/amino.go +++ b/crypto/amino.go @@ -2,7 +2,7 @@ package crypto import ( "github.com/tendermint/go-amino" - "github.com/tendermint/tendermint/crypto/encoding/amino" + cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" ) var cdc = amino.NewCodec() diff --git a/crypto/keys/keybase_test.go b/crypto/keys/keybase_test.go index 09829e1dd..e5613e302 100644 --- a/crypto/keys/keybase_test.go +++ b/crypto/keys/keybase_test.go @@ -7,11 +7,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto/ed25519" + "github.com/cosmos/cosmos-sdk/crypto/keys/hd" "github.com/cosmos/cosmos-sdk/crypto/keys/mintkey" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/crypto" - "github.com/tendermint/tendermint/crypto/ed25519" ) func init() { diff --git a/crypto/keys/mintkey/mintkey.go b/crypto/keys/mintkey/mintkey.go index 11743013a..4806bcc4d 100644 --- a/crypto/keys/mintkey/mintkey.go +++ b/crypto/keys/mintkey/mintkey.go @@ -8,7 +8,7 @@ import ( "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/armor" - "github.com/tendermint/tendermint/crypto/encoding/amino" + cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" "github.com/tendermint/tendermint/crypto/xsalsa20symmetric" cmn "github.com/tendermint/tendermint/libs/common" diff --git a/crypto/keys/mintkey/mintkey_test.go b/crypto/keys/mintkey/mintkey_test.go index 86df52366..b4ce4d6a0 100644 --- a/crypto/keys/mintkey/mintkey_test.go +++ b/crypto/keys/mintkey/mintkey_test.go @@ -3,11 +3,12 @@ package mintkey_test import ( "testing" - "github.com/cosmos/cosmos-sdk/crypto/keys" - "github.com/cosmos/cosmos-sdk/crypto/keys/mintkey" "github.com/stretchr/testify/require" cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" "github.com/tendermint/tendermint/crypto/secp256k1" + + "github.com/cosmos/cosmos-sdk/crypto/keys" + "github.com/cosmos/cosmos-sdk/crypto/keys/mintkey" ) func TestArmorUnarmorPrivKey(t *testing.T) { diff --git a/crypto/ledger_mock.go b/crypto/ledger_mock.go index 75e6941da..b9f1048cf 100644 --- a/crypto/ledger_mock.go +++ b/crypto/ledger_mock.go @@ -6,12 +6,13 @@ import ( "fmt" "github.com/btcsuite/btcd/btcec" - "github.com/cosmos/cosmos-sdk/crypto/keys/hd" - "github.com/cosmos/cosmos-sdk/tests" bip39 "github.com/cosmos/go-bip39" "github.com/pkg/errors" secp256k1 "github.com/tendermint/btcd/btcec" "github.com/tendermint/tendermint/crypto" + + "github.com/cosmos/cosmos-sdk/crypto/keys/hd" + "github.com/cosmos/cosmos-sdk/tests" ) // If ledger support (build tag) has been enabled, which implies a CGO dependency, diff --git a/crypto/ledger_secp256k1.go b/crypto/ledger_secp256k1.go index fae0c1569..84ddf4657 100644 --- a/crypto/ledger_secp256k1.go +++ b/crypto/ledger_secp256k1.go @@ -5,6 +5,7 @@ import ( "os" "github.com/btcsuite/btcd/btcec" + "github.com/cosmos/cosmos-sdk/crypto/keys/hd" "github.com/cosmos/cosmos-sdk/types" diff --git a/crypto/ledger_test.go b/crypto/ledger_test.go index ea2bc9681..faa3fd679 100644 --- a/crypto/ledger_test.go +++ b/crypto/ledger_test.go @@ -7,11 +7,12 @@ import ( "github.com/cosmos/cosmos-sdk/tests" tmcrypto "github.com/tendermint/tendermint/crypto" - "github.com/tendermint/tendermint/crypto/encoding/amino" + cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" + + "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/hd" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) func TestLedgerErrorHandling(t *testing.T) { diff --git a/go.sum b/go.sum index fea25091b..0c92764b3 100644 --- a/go.sum +++ b/go.sum @@ -24,6 +24,7 @@ github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVa github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8 h1:Iwin12wRQtyZhH6FV3ykFcdGNlYEzoeR0jN8Vn+JWsI= github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= diff --git a/server/constructors.go b/server/constructors.go index ac087d657..939bba954 100644 --- a/server/constructors.go +++ b/server/constructors.go @@ -6,11 +6,12 @@ import ( "os" "path/filepath" - sdk "github.com/cosmos/cosmos-sdk/types" abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tendermint/libs/db" "github.com/tendermint/tendermint/libs/log" tmtypes "github.com/tendermint/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) type ( diff --git a/types/address.go b/types/address.go index 05a18ecab..d62f947af 100644 --- a/types/address.go +++ b/types/address.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/tendermint/tendermint/crypto" - "github.com/tendermint/tendermint/crypto/encoding/amino" + cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" "github.com/tendermint/tendermint/libs/bech32" ) diff --git a/types/address_test.go b/types/address_test.go index 129f002a1..754d3e754 100644 --- a/types/address_test.go +++ b/types/address_test.go @@ -7,9 +7,10 @@ import ( "strings" - "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto/ed25519" + + "github.com/cosmos/cosmos-sdk/types" ) var invalidStrs = []string{ diff --git a/types/rest/rest.go b/types/rest/rest.go index 20fcef3fc..71549584d 100644 --- a/types/rest/rest.go +++ b/types/rest/rest.go @@ -5,13 +5,14 @@ package rest import ( "errors" "fmt" - "github.com/tendermint/tendermint/types" "io/ioutil" "net/http" "net/url" "strconv" "strings" + "github.com/tendermint/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/crisis/handler_test.go b/x/crisis/handler_test.go index 1f0aa6d14..84c3d5c45 100644 --- a/x/crisis/handler_test.go +++ b/x/crisis/handler_test.go @@ -5,10 +5,11 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" distr "github.com/cosmos/cosmos-sdk/x/distribution" - "github.com/stretchr/testify/require" ) var ( diff --git a/x/mint/client/cli/query.go b/x/mint/client/cli/query.go index 498024073..65bde6ade 100644 --- a/x/mint/client/cli/query.go +++ b/x/mint/client/cli/query.go @@ -3,11 +3,12 @@ package cli import ( "fmt" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/mint" - "github.com/spf13/cobra" ) // GetCmdQueryParams implements a command to return the current minting diff --git a/x/mint/client/module_client.go b/x/mint/client/module_client.go index 96f6c00fd..0b023f792 100644 --- a/x/mint/client/module_client.go +++ b/x/mint/client/module_client.go @@ -1,11 +1,12 @@ package clientpackage import ( + "github.com/spf13/cobra" + "github.com/tendermint/go-amino" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/x/mint" "github.com/cosmos/cosmos-sdk/x/mint/client/cli" - "github.com/spf13/cobra" - "github.com/tendermint/go-amino" ) // ModuleClient exports all CLI client functionality from the minting module. diff --git a/x/mint/client/rest/query.go b/x/mint/client/rest/query.go index 9bc436a6d..2d3cd4a0f 100644 --- a/x/mint/client/rest/query.go +++ b/x/mint/client/rest/query.go @@ -4,11 +4,12 @@ import ( "fmt" "net/http" + "github.com/gorilla/mux" + "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/rest" "github.com/cosmos/cosmos-sdk/x/mint" - "github.com/gorilla/mux" ) func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec) { diff --git a/x/mint/client/rest/rest.go b/x/mint/client/rest/rest.go index cedfa72c7..82a1afdd1 100644 --- a/x/mint/client/rest/rest.go +++ b/x/mint/client/rest/rest.go @@ -1,9 +1,10 @@ package rest import ( + "github.com/gorilla/mux" + "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/codec" - "github.com/gorilla/mux" ) // RegisterRoutes registers minting module REST handlers on the provided router. diff --git a/x/mint/querier.go b/x/mint/querier.go index c6ab9ef4d..e70142cac 100644 --- a/x/mint/querier.go +++ b/x/mint/querier.go @@ -3,9 +3,10 @@ package mint import ( "fmt" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" ) // Query endpoints supported by the minting querier diff --git a/x/mint/querier_test.go b/x/mint/querier_test.go index 9bc963e5f..f0478c61b 100644 --- a/x/mint/querier_test.go +++ b/x/mint/querier_test.go @@ -3,9 +3,10 @@ package mint import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + abci "github.com/tendermint/tendermint/abci/types" ) diff --git a/x/mint/test_common.go b/x/mint/test_common.go index 7f83a0862..768391755 100644 --- a/x/mint/test_common.go +++ b/x/mint/test_common.go @@ -10,6 +10,8 @@ import ( "github.com/stretchr/testify/require" + dbm "github.com/tendermint/tendermint/libs/db" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,7 +19,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/params" "github.com/cosmos/cosmos-sdk/x/staking" - dbm "github.com/tendermint/tendermint/libs/db" ) type testInput struct { diff --git a/x/simulation/util.go b/x/simulation/util.go index 14df0f6c6..3dc75c439 100644 --- a/x/simulation/util.go +++ b/x/simulation/util.go @@ -5,9 +5,10 @@ import ( "math/rand" "testing" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" ) // assertAll asserts the all invariants against application state diff --git a/x/slashing/client/rest/query.go b/x/slashing/client/rest/query.go index 3c4afdd00..1785770d9 100644 --- a/x/slashing/client/rest/query.go +++ b/x/slashing/client/rest/query.go @@ -2,14 +2,16 @@ package rest import ( "fmt" + "net/http" + + "github.com/gorilla/mux" + "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" "github.com/cosmos/cosmos-sdk/x/slashing" - "github.com/gorilla/mux" - "net/http" ) func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec) { diff --git a/x/slashing/client/rest/query_test.go b/x/slashing/client/rest/query_test.go index ad177c23b..62afaef0d 100644 --- a/x/slashing/client/rest/query_test.go +++ b/x/slashing/client/rest/query_test.go @@ -1,8 +1,9 @@ package rest import ( - "github.com/stretchr/testify/require" "testing" + + "github.com/stretchr/testify/require" ) func TestAdjustPagination(t *testing.T) {