Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump SDK master commit #259

Merged
merged 7 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"

abci "github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

bam "github.com/cosmos/cosmos-sdk/baseapp"
Expand Down Expand Up @@ -284,7 +284,7 @@ func NewGaiaApp(
if loadLatest {
err := app.LoadLatestVersion(app.keys[bam.MainStoreKey])
if err != nil {
cmn.Exit(err.Error())
tmos.Exit(err.Error())
}
}

Expand Down
9 changes: 7 additions & 2 deletions cmd/gaiad/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/tendermint/tendermint/libs/cli"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys"
"github.com/cosmos/cosmos-sdk/server"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
Expand Down Expand Up @@ -50,7 +50,12 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
inBuf := bufio.NewReader(cmd.InOrStdin())
if err != nil {
// attempt to lookup address from Keybase if no address was provided
kb, err := keys.NewKeyringFromDir(viper.GetString(flagClientHome), inBuf)
kb, err := keys.NewKeyring(
sdk.GetConfig().GetKeyringServiceName(),
viper.GetString(flags.FlagKeyringBackend),
viper.GetString(flagClientHome),
inBuf,
)
if err != nil {
return err
}
Expand Down
8 changes: 5 additions & 3 deletions cmd/gaiad/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/spf13/cobra"

abci "github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
tmos "github.com/tendermint/tendermint/libs/os"
"github.com/tendermint/tendermint/proxy"
tmsm "github.com/tendermint/tendermint/state"
tmstore "github.com/tendermint/tendermint/store"
Expand Down Expand Up @@ -42,10 +42,12 @@ func replayTxs(rootDir string) error {
// Copy the rootDir to a new directory, to preserve the old one.
fmt.Fprintln(os.Stderr, "Copying rootdir over")
oldRootDir := rootDir

rootDir = oldRootDir + "_replay"
if cmn.FileExists(rootDir) {
cmn.Exit(fmt.Sprintf("temporary copy dir %v already exists", rootDir))
if tmos.FileExists(rootDir) {
tmos.Exit(fmt.Sprintf("temporary copy dir %v already exists", rootDir))
}

if err := cpm.Copy(oldRootDir, rootDir); err != nil {
return err
}
Expand Down
23 changes: 15 additions & 8 deletions cmd/gaiad/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ import (
"github.com/spf13/viper"
tmconfig "github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/crypto"
cmn "github.com/tendermint/tendermint/libs/common"
tmos "github.com/tendermint/tendermint/libs/os"
tmrand "github.com/tendermint/tendermint/libs/rand"
"github.com/tendermint/tendermint/types"
tmtime "github.com/tendermint/tendermint/types/time"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
clientkeys "github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys"
"github.com/cosmos/cosmos-sdk/server"
srvconfig "github.com/cosmos/cosmos-sdk/server/config"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -104,7 +106,7 @@ func InitTestnet(cmd *cobra.Command, config *tmconfig.Config, cdc *codec.Codec,
nodeCLIHome, startingIPAddress string, numValidators int) error {

if chainID == "" {
chainID = "chain-" + cmn.RandStr(6)
chainID = "chain-" + tmrand.NewRand().Str(6)
}

monikers := make([]string, numValidators)
Expand Down Expand Up @@ -159,12 +161,17 @@ func InitTestnet(cmd *cobra.Command, config *tmconfig.Config, cdc *codec.Codec,
memo := fmt.Sprintf("%s@%s:26656", nodeIDs[i], ip)
genFiles = append(genFiles, config.GenesisFile())

kb, err := keys.NewKeyringFromDir(clientDir, inBuf)
kb, err := keys.NewKeyring(
sdk.GetConfig().GetKeyringServiceName(),
viper.GetString(flags.FlagKeyringBackend),
clientDir,
inBuf,
)
if err != nil {
return err
}

keyPass := keys.DefaultKeyPass
keyPass := clientkeys.DefaultKeyPass
addr, secret, err := server.GenerateSaveCoinKey(kb, nodeDirName, keyPass, true)
if err != nil {
_ = os.RemoveAll(outputDir)
Expand Down Expand Up @@ -204,7 +211,7 @@ func InitTestnet(cmd *cobra.Command, config *tmconfig.Config, cdc *codec.Codec,
tx := auth.NewStdTx([]sdk.Msg{msg}, auth.StdFee{}, []auth.StdSignature{}, memo)
txBldr := auth.NewTxBuilderFromCLI(inBuf).WithChainID(chainID).WithMemo(memo).WithKeybase(kb)

signedTx, err := txBldr.SignStdTx(nodeDirName, keys.DefaultKeyPass, tx, false)
signedTx, err := txBldr.SignStdTx(nodeDirName, clientkeys.DefaultKeyPass, tx, false)
if err != nil {
_ = os.RemoveAll(outputDir)
return err
Expand Down Expand Up @@ -353,12 +360,12 @@ func writeFile(name string, dir string, contents []byte) error {
writePath := filepath.Join(dir)
file := filepath.Join(writePath, name)

err := cmn.EnsureDir(writePath, 0700)
err := tmos.EnsureDir(writePath, 0700)
if err != nil {
return err
}

err = cmn.WriteFile(file, contents, 0600)
err = tmos.WriteFile(file, contents, 0600)
if err != nil {
return err
}
Expand Down
8 changes: 3 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ go 1.13

require (
github.com/btcsuite/btcd v0.0.0-20190807005414-4063feeff79a // indirect
github.com/cosmos/cosmos-sdk v0.34.4-0.20200110211037-214024431fbd
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d // indirect
github.com/cosmos/cosmos-sdk v0.34.4-0.20200122195256-f18005d2f18b
github.com/golang/mock v1.3.1 // indirect
github.com/onsi/ginkgo v1.8.0 // indirect
github.com/onsi/gomega v1.5.0 // indirect
Expand All @@ -20,9 +19,8 @@ require (
github.com/spf13/viper v1.6.2
github.com/stretchr/testify v1.4.0
github.com/tendermint/go-amino v0.15.1
github.com/tendermint/tendermint v0.32.8
github.com/tendermint/tm-db v0.2.0
golang.org/x/crypto v0.0.0-20190909091759-094676da4a83 // indirect
github.com/tendermint/tendermint v0.33.0
github.com/tendermint/tm-db v0.4.0
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect
golang.org/x/text v0.3.2 // indirect
)
Expand Down
Loading