From 92dde71f859b7ad99d1982740434d1016d9a8bf7 Mon Sep 17 00:00:00 2001 From: Hleb Albau Date: Fri, 25 Jan 2019 12:35:49 +0700 Subject: [PATCH] Update to cosmos-sdk v0.30.0 --- cli/main.go | 55 ++++++++++++++++++++----------------------- docs/run_validator.md | 2 +- go.mod | 7 +++--- go.sum | 10 ++++---- 4 files changed, 33 insertions(+), 41 deletions(-) diff --git a/cli/main.go b/cli/main.go index d3249c8b..31f40665 100644 --- a/cli/main.go +++ b/cli/main.go @@ -1,35 +1,30 @@ package main import ( - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/cybercongress/cyberd/cli/commands/keys" - "github.com/spf13/viper" - "github.com/tendermint/go-amino" - "os" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - "github.com/cybercongress/cyberd/app" - cyberdcmd "github.com/cybercongress/cyberd/cli/commands" - "github.com/spf13/cobra" - "github.com/tendermint/tendermint/libs/cli" - + at "github.com/cosmos/cosmos-sdk/x/auth" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" bankcmd "github.com/cosmos/cosmos-sdk/x/bank/client/cli" + dist "github.com/cosmos/cosmos-sdk/x/distribution" distClient "github.com/cosmos/cosmos-sdk/x/distribution/client" + gv "github.com/cosmos/cosmos-sdk/x/gov" govClient "github.com/cosmos/cosmos-sdk/x/gov/client" + sl "github.com/cosmos/cosmos-sdk/x/slashing" slashingClient "github.com/cosmos/cosmos-sdk/x/slashing/client" + st "github.com/cosmos/cosmos-sdk/x/staking" stakingClient "github.com/cosmos/cosmos-sdk/x/staking/client" -) - -const ( - storeAcc = "acc" - storeGov = "gov" - storeSlashing = "slashing" - storeStake = "stake" - storeDist = "distr" + "github.com/cybercongress/cyberd/app" + cyberdcmd "github.com/cybercongress/cyberd/cli/commands" + "github.com/cybercongress/cyberd/cli/commands/keys" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "github.com/tendermint/go-amino" + "github.com/tendermint/tendermint/libs/cli" + "os" ) func main() { @@ -46,21 +41,25 @@ func main() { } mc := []sdk.ModuleClients{ - govClient.NewModuleClient(storeGov, cdc), - distClient.NewModuleClient(storeDist, cdc), - stakingClient.NewModuleClient(storeStake, cdc), - slashingClient.NewModuleClient(storeSlashing, cdc), + govClient.NewModuleClient(gv.StoreKey, cdc), + distClient.NewModuleClient(dist.StoreKey, cdc), + stakingClient.NewModuleClient(st.StoreKey, cdc), + slashingClient.NewModuleClient(sl.StoreKey, cdc), } + // todo: hack till we don't handle with all merkle proofs + viper.SetDefault(client.FlagTrustNode, true) + cyberdcli.PersistentFlags().String(client.FlagChainID, "", "Chain Id of cyberd node") + // Construct Root Command cyberdcli.AddCommand( rpc.StatusCommand(), - client.ConfigCmd(), queryCmd(cdc, mc), txCmd(cdc, mc), keys.Commands(), client.LineBreak, version.VersionCmd, + client.NewCompletionCmd(cyberdcli, true), ) cyberdcli.AddCommand( @@ -68,11 +67,6 @@ func main() { cyberdcmd.LinkTxCmd(cdc), )...) - // todo: hack till we don't handle with all merkle proofs - viper.SetDefault(client.FlagTrustNode, true) - - cyberdcli.PersistentFlags().String(client.FlagChainID, "", "Chain ID of cyberd node") - executor := cli.PrepareMainCmd(cyberdcli, "CBD", os.ExpandEnv("$HOME/.cyberdcli")) err := executor.Execute() if err != nil { @@ -94,7 +88,7 @@ func queryCmd(cdc *amino.Codec, mc []sdk.ModuleClients) *cobra.Command { tx.SearchTxCmd(cdc), tx.QueryTxCmd(cdc), client.LineBreak, - authcmd.GetAccountCmd(storeAcc, cdc), + authcmd.GetAccountCmd(at.StoreKey, cdc), ) for _, m := range mc { @@ -114,6 +108,7 @@ func txCmd(cdc *amino.Codec, mc []sdk.ModuleClients) *cobra.Command { bankcmd.SendTxCmd(cdc), client.LineBreak, authcmd.GetSignCommand(cdc), + authcmd.GetMultiSignCommand(cdc), bankcmd.GetBroadcastCommand(cdc), client.LineBreak, ) diff --git a/docs/run_validator.md b/docs/run_validator.md index 7123f626..574f4117 100644 --- a/docs/run_validator.md +++ b/docs/run_validator.md @@ -140,7 +140,7 @@ So the validator candidate is an account this time. To declare a validator candidate, run the following command adjusting stake amount and other fields. ```bash -docker exec -ti cyberd cyberdcli tx stake create-validator \ +docker exec -ti cyberd cyberdcli tx staking create-validator \ --amount=100CBD \ --pubkey= \ --moniker= \ diff --git a/go.mod b/go.mod index 612e311b..e7015dea 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/btcsuite/btcd v0.0.0-20180903232927-cff30e1d23fc // indirect github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a // indirect - github.com/cosmos/cosmos-sdk v0.28.2-0.20190123020839-b2ae4ed57319 + github.com/cosmos/cosmos-sdk v0.30.0 github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8 github.com/fortytw2/leaktest v1.2.0 // indirect github.com/go-kit/kit v0.7.0 // indirect @@ -32,11 +32,10 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect github.com/minio/sha256-simd v0.0.0-20181005183134-51976451ce19 // indirect - github.com/mitchellh/go-homedir v1.0.0 github.com/mitchellh/mapstructure v1.0.0 // indirect github.com/mr-tron/base58 v1.1.0 // indirect github.com/multiformats/go-multibase v0.3.0 // indirect - github.com/multiformats/go-multihash v1.0.8 + github.com/multiformats/go-multihash v1.0.8 // indirect github.com/onsi/gomega v1.4.2 // indirect github.com/pelletier/go-toml v1.2.0 // indirect github.com/pkg/errors v0.8.0 @@ -59,7 +58,7 @@ require ( github.com/tendermint/btcd v0.0.0-20180816174608-e5840949ff4f github.com/tendermint/go-amino v0.14.1 github.com/tendermint/iavl v0.12.0 // indirect - github.com/tendermint/tendermint v0.29.0 + github.com/tendermint/tendermint v0.29.1 github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect github.com/zondax/ledger-cosmos-go v0.1.0 // indirect golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e // indirect diff --git a/go.sum b/go.sum index d1d627df..93dc8b5b 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,8 @@ github.com/btcsuite/btcd v0.0.0-20180903232927-cff30e1d23fc/go.mod h1:Dmm/EzmjnC github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a h1:RQMUrEILyYJEoAT34XS/kLu40vC0+po/UfxrBBA4qZE= github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cosmos/cosmos-sdk v0.28.2-0.20190123020839-b2ae4ed57319 h1:T2U3Z5ftqqECTF6y8lHiWS5ld4ZXon2/tYSnc+flWUo= -github.com/cosmos/cosmos-sdk v0.28.2-0.20190123020839-b2ae4ed57319/go.mod h1:JrX/JpJunJQXBI5PEX2zELHMFzQr/159jDjIhesOh2c= +github.com/cosmos/cosmos-sdk v0.30.0 h1:DUpcAqHalX2IEvum2wjPIos6sRcOYVd1wNSfiQ+wdfo= +github.com/cosmos/cosmos-sdk v0.30.0/go.mod h1:JrX/JpJunJQXBI5PEX2zELHMFzQr/159jDjIhesOh2c= 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= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -75,8 +75,6 @@ github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0 github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/sha256-simd v0.0.0-20181005183134-51976451ce19 h1:d9VfRe71OW+ZtutCBgQ54kXBwFy5Tz5hR0OBIE6qlFo= github.com/minio/sha256-simd v0.0.0-20181005183134-51976451ce19/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= -github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.0.0 h1:vVpGvMXJPqSDh2VYHF7gsfQj8Ncx+Xw5Y1KHeTRY+7I= github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mr-tron/base58 v1.1.0 h1:Y51FGVJ91WBqCEabAi5OPUz38eAx8DakuAm5svLcsfQ= @@ -133,8 +131,8 @@ github.com/tendermint/go-amino v0.14.1 h1:o2WudxNfdLNBwMyl2dqOJxiro5rfrEaU0Ugs6o github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= github.com/tendermint/iavl v0.12.0 h1:xcaFAr+ycqCj7WN1RzL2EfcBioRDOHcU1oWcg83K028= github.com/tendermint/iavl v0.12.0/go.mod h1:EoKMMv++tDOL5qKKVnoIqtVPshRrEPeJ0WsgDOLAauM= -github.com/tendermint/tendermint v0.29.0 h1:zaJwtaAQVUC4QxqImtpPlCpMGroVvPU0g75ZTlvmFg8= -github.com/tendermint/tendermint v0.29.0/go.mod h1:ymcPyWblXCplCPQjbOYbrF1fWnpslATMVqiGgWbZrlc= +github.com/tendermint/tendermint v0.29.1 h1:9QwXNxtxgfekONjEBvnZp2g3mQH/fS5QiUyEXo7QOGs= +github.com/tendermint/tendermint v0.29.1/go.mod h1:ymcPyWblXCplCPQjbOYbrF1fWnpslATMVqiGgWbZrlc= github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4= github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM= github.com/zondax/ledger-cosmos-go v0.1.0 h1:Qf4OrBXabhUrDqTtq47QSBLqWV4QYQDQwJQ2qZCbzT8=