From 47eca7b3a2f4695e1b31c1c2fa765045fdb90604 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Thu, 12 Dec 2019 02:10:39 +0000 Subject: [PATCH] Bump SDK master version (#212) Use new --keyring-backend flag. See cosmos/cosmos-sdk#5355 for more information. --- CHANGELOG.md | 6 +++++ Makefile | 3 +-- cli_test/cli_test.go | 10 +++++---- cli_test/test_helpers.go | 48 ++++++++++++++++++++++++++-------------- cmd/gaiad/genaccounts.go | 2 ++ cmd/gaiad/testnet.go | 1 + go.mod | 2 +- go.sum | 16 +++++++++----- lcd_test/helpers.go | 16 +++++++------- lcd_test/helpers_test.go | 3 ++- lcd_test/lcd_test.go | 7 +++--- 11 files changed, 72 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c30eec6e279..f4eef1f3f13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,12 @@ Base64 encoded transactions. * (gaiacli) [\#191](https://github.com/cosmos/gaia/pull/191) Add cmd `decode-tx`, decodes a tx from hex or base64 * (modules) [\#196](https://github.com/cosmos/gaia/pull/196) Integrate the `x/upgrade` module. +### Client Breaking Changes + +* [\#164](https://github.com/cosmos/gaia/pull/164) [\#212](https://github.com/cosmos/gaia/pull/212) The LevelDB-based +keybase implementation has been replaced with a 99 designs Keyring library-backed implementation. Keys created and stored +with previous `gaia` releases need to be migrated through the `gaiacli keys migrate` command. + ## [v2.0.3] - 2019-11-04 ### Improvements diff --git a/Makefile b/Makefile index e5932206199..ec96b62cf5a 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,6 @@ LEDGER_ENABLED ?= true SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') export GO111MODULE = on -export COSMOS_SDK_TEST_KEYRING = y # process build tags @@ -155,7 +154,7 @@ build-docker-gaiadnode: # Run a 4-node testnet locally localnet-start: build-linux localnet-stop - @if ! [ -f build/node0/gaiad/config/genesis.json ]; then docker run -e COSMOS_SDK_TEST_KEYRING=y --rm -v $(CURDIR)/build:/gaiad:Z tendermint/gaiadnode testnet --v 4 -o . --starting-ip-address 192.168.10.2 ; fi + @if ! [ -f build/node0/gaiad/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/gaiad:Z tendermint/gaiadnode testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi docker-compose up -d # Stop testnet diff --git a/cli_test/cli_test.go b/cli_test/cli_test.go index 9ef156a145e..4fb67b9db04 100644 --- a/cli_test/cli_test.go +++ b/cli_test/cli_test.go @@ -419,12 +419,12 @@ func TestGaiaCLIQueryRewards(t *testing.T) { cdc := app.MakeCodec() genesisState := f.GenesisState() - inflationMin := sdk.MustNewDecFromStr("10000.0") + inflationMin := sdk.MustNewDecFromStr("1.0") var mintData mint.GenesisState cdc.UnmarshalJSON(genesisState[mint.ModuleName], &mintData) mintData.Minter.Inflation = inflationMin mintData.Params.InflationMin = inflationMin - mintData.Params.InflationMax = sdk.MustNewDecFromStr("15000.0") + mintData.Params.InflationMax = sdk.MustNewDecFromStr("1.0") mintDataBz, err := cdc.MarshalJSON(mintData) require.NoError(t, err) genesisState[mint.ModuleName] = mintDataBz @@ -679,12 +679,12 @@ func TestGaiaCLISubmitCommunityPoolSpendProposal(t *testing.T) { // create some inflation cdc := app.MakeCodec() genesisState := f.GenesisState() - inflationMin := sdk.MustNewDecFromStr("10000.0") + inflationMin := sdk.MustNewDecFromStr("1.0") var mintData mint.GenesisState cdc.UnmarshalJSON(genesisState[mint.ModuleName], &mintData) mintData.Minter.Inflation = inflationMin mintData.Params.InflationMin = inflationMin - mintData.Params.InflationMax = sdk.MustNewDecFromStr("15000.0") + mintData.Params.InflationMax = sdk.MustNewDecFromStr("1.0") mintDataBz, err := cdc.MarshalJSON(mintData) require.NoError(t, err) genesisState[mint.ModuleName] = mintDataBz @@ -1174,12 +1174,14 @@ func TestGaiaCLIConfig(t *testing.T) { f.CLIConfig("chain-id", f.ChainID) f.CLIConfig("trace", "false") f.CLIConfig("indent", "true") + f.CLIConfig("keyring-backend", "test") config, err := ioutil.ReadFile(path.Join(f.GaiacliHome, "config", "config.toml")) require.NoError(t, err) expectedConfig := fmt.Sprintf(`broadcast-mode = "block" chain-id = "%s" indent = true +keyring-backend = "test" node = "%s" output = "text" trace = false diff --git a/cli_test/test_helpers.go b/cli_test/test_helpers.go index 411c6e93323..8331fbaed9c 100644 --- a/cli_test/test_helpers.go +++ b/cli_test/test_helpers.go @@ -138,6 +138,8 @@ func InitFixtures(t *testing.T) (f *Fixtures) { // reset test state f.UnsafeResetAll() + f.CLIConfig("keyring-backend", "test") + // ensure keystore has foo and bar keys f.KeysDelete(keyFoo) f.KeysDelete(keyBar) @@ -219,13 +221,13 @@ func (f *Fixtures) GDInit(moniker string, flags ...string) { // AddGenesisAccount is gaiad add-genesis-account func (f *Fixtures) AddGenesisAccount(address sdk.AccAddress, coins sdk.Coins, flags ...string) { - cmd := fmt.Sprintf("%s add-genesis-account %s %s --home=%s", f.GaiadBinary, address, coins, f.GaiadHome) + cmd := fmt.Sprintf("%s add-genesis-account %s %s --home=%s --keyring-backend=test", f.GaiadBinary, address, coins, f.GaiadHome) executeWriteCheckErr(f.T, addFlags(cmd, flags)) } // GenTx is gaiad gentx func (f *Fixtures) GenTx(name string, flags ...string) { - cmd := fmt.Sprintf("%s gentx --name=%s --home=%s --home-client=%s", f.GaiadBinary, name, f.GaiadHome, f.GaiacliHome) + cmd := fmt.Sprintf("%s gentx --name=%s --home=%s --home-client=%s --keyring-backend=test", f.GaiadBinary, name, f.GaiadHome, f.GaiacliHome) executeWriteCheckErr(f.T, addFlags(cmd, flags)) } @@ -264,31 +266,36 @@ func (f *Fixtures) ValidateGenesis() { // KeysDelete is gaiacli keys delete func (f *Fixtures) KeysDelete(name string, flags ...string) { - cmd := fmt.Sprintf("%s keys delete --home=%s %s", f.GaiacliBinary, f.GaiacliHome, name) + cmd := fmt.Sprintf("%s keys delete --keyring-backend=test --home=%s %s", f.GaiacliBinary, + f.GaiacliHome, name) executeWrite(f.T, addFlags(cmd, append(append(flags, "-y"), "-f"))) } // KeysAdd is gaiacli keys add func (f *Fixtures) KeysAdd(name string, flags ...string) { - cmd := fmt.Sprintf("%s keys add --home=%s %s", f.GaiacliBinary, f.GaiacliHome, name) + cmd := fmt.Sprintf("%s keys add --keyring-backend=test --home=%s %s", f.GaiacliBinary, + f.GaiacliHome, name) executeWriteCheckErr(f.T, addFlags(cmd, flags)) } // KeysAddRecover prepares gaiacli keys add --recover func (f *Fixtures) KeysAddRecover(name, mnemonic string, flags ...string) (exitSuccess bool, stdout, stderr string) { - cmd := fmt.Sprintf("%s keys add --home=%s --recover %s", f.GaiacliBinary, f.GaiacliHome, name) + cmd := fmt.Sprintf("%s keys add --keyring-backend=test --home=%s --recover %s", + f.GaiacliBinary, f.GaiacliHome, name) return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), 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("%s keys add --home=%s --recover %s --account %d --index %d", f.GaiacliBinary, f.GaiacliHome, name, account, index) + cmd := fmt.Sprintf("%s keys add --keyring-backend=test --home=%s --recover %s --account %d"+ + " --index %d", f.GaiacliBinary, f.GaiacliHome, name, account, index) executeWriteCheckErr(f.T, addFlags(cmd, flags), mnemonic) } // KeysShow is gaiacli keys show func (f *Fixtures) KeysShow(name string, flags ...string) keys.KeyOutput { - cmd := fmt.Sprintf("%s keys show --home=%s %s", f.GaiacliBinary, f.GaiacliHome, name) + cmd := fmt.Sprintf("%s keys show --keyring-backend=test --home=%s %s", f.GaiacliBinary, + f.GaiacliHome, name) out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "") var ko keys.KeyOutput err := clientkeys.UnmarshalJSON([]byte(out), &ko) @@ -318,13 +325,15 @@ 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("%s tx send %s %s %s %v", f.GaiacliBinary, from, to, amount, f.Flags()) + cmd := fmt.Sprintf("%s tx send --keyring-backend=test %s %s %s %v", f.GaiacliBinary, from, + to, amount, f.Flags()) return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } // TxSign is gaiacli tx sign func (f *Fixtures) TxSign(signer, fileName string, flags ...string) (bool, string, string) { - cmd := fmt.Sprintf("%s tx sign %v --from=%s %v", f.GaiacliBinary, f.Flags(), signer, fileName) + cmd := fmt.Sprintf("%s tx sign %v --keyring-backend=test --from=%s %v", f.GaiacliBinary, + f.Flags(), signer, fileName) return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } @@ -344,7 +353,7 @@ func (f *Fixtures) TxEncode(fileName string, flags ...string) (bool, string, str func (f *Fixtures) TxMultisign(fileName, name string, signaturesFiles []string, flags ...string) (bool, string, string) { - cmd := fmt.Sprintf("%s tx multisign %v %s %s %s", f.GaiacliBinary, f.Flags(), + cmd := fmt.Sprintf("%s tx multisign --keyring-backend=test %v %s %s %s", f.GaiacliBinary, f.Flags(), fileName, name, strings.Join(signaturesFiles, " "), ) return executeWriteRetStdStreams(f.T, cmd) @@ -355,7 +364,8 @@ func (f *Fixtures) TxMultisign(fileName, name string, signaturesFiles []string, // TxStakingCreateValidator is gaiacli tx staking create-validator func (f *Fixtures) TxStakingCreateValidator(from, consPubKey string, amount sdk.Coin, flags ...string) (bool, string, string) { - cmd := fmt.Sprintf("%s tx staking create-validator %v --from=%s --pubkey=%s", f.GaiacliBinary, f.Flags(), from, consPubKey) + cmd := fmt.Sprintf("%s tx staking create-validator %v --keyring-backend=test --from=%s"+ + " --pubkey=%s", f.GaiacliBinary, f.Flags(), from, consPubKey) 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") @@ -364,7 +374,8 @@ func (f *Fixtures) TxStakingCreateValidator(from, consPubKey string, amount sdk. // TxStakingUnbond is gaiacli tx staking unbond func (f *Fixtures) TxStakingUnbond(from, shares string, validator sdk.ValAddress, flags ...string) bool { - cmd := fmt.Sprintf("%s tx staking unbond %s %v --from=%s %v", f.GaiacliBinary, validator, shares, from, f.Flags()) + cmd := fmt.Sprintf("%s tx staking unbond --keyring-backend=test %s %v --from=%s %v", + f.GaiacliBinary, validator, shares, from, f.Flags()) return executeWrite(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } @@ -373,20 +384,23 @@ func (f *Fixtures) TxStakingUnbond(from, shares string, validator sdk.ValAddress // TxGovSubmitProposal is gaiacli tx gov submit-proposal func (f *Fixtures) TxGovSubmitProposal(from, typ, title, description string, deposit sdk.Coin, flags ...string) (bool, string, string) { - cmd := fmt.Sprintf("%s tx gov submit-proposal %v --from=%s --type=%s", f.GaiacliBinary, f.Flags(), from, typ) + cmd := fmt.Sprintf("%s tx gov submit-proposal %v --keyring-backend=test --from=%s --type=%s", + f.GaiacliBinary, f.Flags(), from, typ) cmd += fmt.Sprintf(" --title=%s --description=%s --deposit=%s", title, description, deposit) 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("%s tx gov deposit %d %s --from=%s %v", f.GaiacliBinary, proposalID, amount, from, f.Flags()) + cmd := fmt.Sprintf("%s tx gov deposit %d %s --keyring-backend=test --from=%s %v", + f.GaiacliBinary, proposalID, amount, from, f.Flags()) 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("%s tx gov vote %d %s --from=%s %v", f.GaiacliBinary, proposalID, option, from, f.Flags()) + cmd := fmt.Sprintf("%s tx gov vote %d %s --keyring-backend=test --from=%s %v", + f.GaiacliBinary, proposalID, option, from, f.Flags()) return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass) } @@ -397,7 +411,7 @@ func (f *Fixtures) TxGovSubmitParamChangeProposal( ) (bool, string, string) { cmd := fmt.Sprintf( - "%s tx gov submit-proposal param-change %s --from=%s %v", + "%s tx gov submit-proposal param-change %s --keyring-backend=test --from=%s %v", f.GaiacliBinary, proposalPath, from, f.Flags(), ) @@ -411,7 +425,7 @@ func (f *Fixtures) TxGovSubmitCommunityPoolSpendProposal( ) (bool, string, string) { cmd := fmt.Sprintf( - "%s tx gov submit-proposal community-pool-spend %s --from=%s %v", + "%s tx gov submit-proposal community-pool-spend %s --keyring-backend=test --from=%s %v", f.GaiacliBinary, proposalPath, from, f.Flags(), ) diff --git a/cmd/gaiad/genaccounts.go b/cmd/gaiad/genaccounts.go index 92c5c3b8f68..24a278f8bc6 100644 --- a/cmd/gaiad/genaccounts.go +++ b/cmd/gaiad/genaccounts.go @@ -10,6 +10,7 @@ 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/server" @@ -137,6 +138,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa } cmd.Flags().String(cli.HomeFlag, defaultNodeHome, "node's home directory") + cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") cmd.Flags().String(flagClientHome, defaultClientHome, "client's home directory") cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") cmd.Flags().Uint64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") diff --git a/cmd/gaiad/testnet.go b/cmd/gaiad/testnet.go index ab6c4261f2e..f58a1def93a 100644 --- a/cmd/gaiad/testnet.go +++ b/cmd/gaiad/testnet.go @@ -91,6 +91,7 @@ Example: cmd.Flags().String( server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") + cmd.Flags().String(client.FlagKeyringBackend, client.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") return cmd } diff --git a/go.mod b/go.mod index da94ae6aebb..284f97deb97 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +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.20191205150729-0300a6f6d7a7 + github.com/cosmos/cosmos-sdk v0.34.4-0.20191211094526-394860068db0 github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d // indirect github.com/golang/mock v1.3.1 // indirect github.com/onsi/ginkgo v1.8.0 // indirect diff --git a/go.sum b/go.sum index 7824443684b..b30f469fac8 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/cosmos-sdk v0.34.4-0.20191205150729-0300a6f6d7a7 h1:W2WVv1zwI34A0XsPdUXf+k1etTSftA5cNHXizaJ4xbw= -github.com/cosmos/cosmos-sdk v0.34.4-0.20191205150729-0300a6f6d7a7/go.mod h1:JWuSAxZmMgNmNsZBCTuFfMHeeAAJZDxTnAKrQeSJOdk= +github.com/cosmos/cosmos-sdk v0.34.4-0.20191211094526-394860068db0 h1:ayZ6F3usAqdkE8rIhS5V5U+xzPY9+3tXhZX/uTDdS7c= +github.com/cosmos/cosmos-sdk v0.34.4-0.20191211094526-394860068db0/go.mod h1:hasIdlU9b3FEFCWpoStvNQQPg1ZpAKnpmlFklAk1W1o= github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= @@ -113,6 +113,7 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -140,6 +141,7 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22 github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= @@ -161,8 +163,8 @@ github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoR github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -231,7 +233,9 @@ github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa h1:YJfZp12Z3AFhSBeXOlv4BO55RMwPn2NoQeDsrdWnBtY= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= @@ -343,8 +347,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= diff --git a/lcd_test/helpers.go b/lcd_test/helpers.go index 80c18a53121..0749180ad15 100644 --- a/lcd_test/helpers.go +++ b/lcd_test/helpers.go @@ -259,8 +259,8 @@ func defaultGenesis(config *tmcfg.Config, nValidators int, initAddrs []sdk.AccAd mintData := mint.DefaultGenesisState() inflationMin := sdk.ZeroDec() if minting { - inflationMin = sdk.MustNewDecFromStr("10000.0") - mintData.Params.InflationMax = sdk.MustNewDecFromStr("15000.0") + inflationMin = sdk.MustNewDecFromStr("0.9") + mintData.Params.InflationMax = sdk.MustNewDecFromStr("1.0") } else { mintData.Params.InflationMax = inflationMin } @@ -279,9 +279,9 @@ func defaultGenesis(config *tmcfg.Config, nValidators int, initAddrs []sdk.AccAd //// double check inflation is set according to the minting boolean flag if minting { - if !(mintData.Params.InflationMax.Equal(sdk.MustNewDecFromStr("15000.0")) && - mintData.Minter.Inflation.Equal(sdk.MustNewDecFromStr("10000.0")) && - mintData.Params.InflationMin.Equal(sdk.MustNewDecFromStr("10000.0"))) { + if !(mintData.Params.InflationMax.Equal(sdk.MustNewDecFromStr("1.0")) && + mintData.Minter.Inflation.Equal(sdk.MustNewDecFromStr("0.9")) && + mintData.Params.InflationMin.Equal(sdk.MustNewDecFromStr("0.9"))) { err = errors.New("mint parameters does not correspond to their defaults") return } @@ -417,9 +417,9 @@ func CreateAddrs(kb crkeys.Keybase, numAddrs int) (addrs []sdk.AccAddress, seeds // AddrSeed combines an Address with the mnemonic of the private key to that address type AddrSeed struct { - Address sdk.AccAddress - Seed string - Name string + Address sdk.AccAddress + Seed string + Name string } // AddrSeedSlice implements `Interface` in sort package. diff --git a/lcd_test/helpers_test.go b/lcd_test/helpers_test.go index 2d36445bf80..271d9bb3cbc 100644 --- a/lcd_test/helpers_test.go +++ b/lcd_test/helpers_test.go @@ -3,6 +3,7 @@ package lcdtest import ( "bytes" + "encoding/json" "fmt" "io/ioutil" "net/http" @@ -728,7 +729,7 @@ func doSubmitParamChangeProposal( Proposer: proposerAddr, Deposit: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, amount)}, Changes: paramscutils.ParamChangesJSON{ - paramscutils.NewParamChangeJSON("staking", "MaxValidators", "", []byte(`105`)), + paramscutils.NewParamChangeJSON("staking", "MaxValidators", json.RawMessage(`105`)), }, } diff --git a/lcd_test/lcd_test.go b/lcd_test/lcd_test.go index 3d6f92b8286..507d8b2307e 100644 --- a/lcd_test/lcd_test.go +++ b/lcd_test/lcd_test.go @@ -12,8 +12,7 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/x/mint" - + "github.com/spf13/viper" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" @@ -29,6 +28,7 @@ import ( distrrest "github.com/cosmos/cosmos-sdk/x/distribution/client/rest" disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/gov" + "github.com/cosmos/cosmos-sdk/x/mint" "github.com/cosmos/cosmos-sdk/x/slashing" ) @@ -44,8 +44,9 @@ func init() { version.Version = os.Getenv("VERSION") } +// nolint: errcheck func TestMain(m *testing.M) { - os.Setenv("COSMOS_SDK_TEST_KEYRING", "y") + viper.Set(client.FlagKeyringBackend, "test") os.Exit(m.Run()) }