From e839a92f889e4a3755cced495e64a54971dbb1ea Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Mon, 26 Jun 2017 21:36:49 +0200 Subject: [PATCH] Updated RequireInit, latest light-client --- CHANGELOG.md | 8 ++++---- cmd/basecli/commands/cmds.go | 6 +----- cmd/basecli/commands/query.go | 6 +----- glide.lock | 6 +++--- glide.yaml | 2 +- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac2e8795e..b32a976b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Make lots of small cli fixes that arose when people were using the tools for the testnet. -ENHANCEMENTS: +IMPROVEMENTS: - basecoin - `basecoin start` supports all flags that `tendermint node` does, such as `--rpc.laddr`, `--p2p.seeds`, and `--p2p.skip_upnp` @@ -14,7 +14,7 @@ ENHANCEMENTS: - `basecli query account` accepts hex account address with or without `0x` prefix - `basecli init` is more intelligent and only complains if there really was - a connected chain + a connected chain, not just random files - support `localhost:46657` or `http://localhost:46657` format for nodes, not just `tcp://localhost:46657` - gives error message when running commands on an unitialized chain, rather @@ -54,7 +54,7 @@ BREAKING CHANGES: - app - Implements ABCI handshake by proxying merkleeyes.Info() -ENHANCEMENTS: +IMPROVEMENTS: - `basecoin init` support `--chain-id` - intergrates tendermint 0.10.0 (not the rc-2, but the real thing) - commands return error code (1) on failure for easier script testing @@ -83,7 +83,7 @@ BUG FIXES: BREAKING CHANGES: - only those related to the tendermint 0.9 -> 0.10 upgrade -ENHANCEMENTS: +IMPROVEMENTS: - basecoin cli - integrates tendermint 0.10.0 and unifies cli (init, unsafe_reset_all, ...) - integrate viper, all command line flags can also be defined in environmental variables or config.toml diff --git a/cmd/basecli/commands/cmds.go b/cmd/basecli/commands/cmds.go index ea5b814a6..d0e10e8aa 100644 --- a/cmd/basecli/commands/cmds.go +++ b/cmd/basecli/commands/cmds.go @@ -24,7 +24,7 @@ import ( var SendTxCmd = &cobra.Command{ Use: "send", Short: "send tokens from one account to another", - RunE: doSendTx, + RunE: commands.RequireInit(doSendTx), } //nolint @@ -47,10 +47,6 @@ func init() { // runDemo is an example of how to make a tx func doSendTx(cmd *cobra.Command, args []string) error { - if err := commands.RequireInit(cmd); err != nil { - return err - } - // load data from json or flags tx := new(btypes.SendTx) found, err := txcmd.LoadJSON(tx) diff --git a/cmd/basecli/commands/query.go b/cmd/basecli/commands/query.go index bae27a347..250078032 100644 --- a/cmd/basecli/commands/query.go +++ b/cmd/basecli/commands/query.go @@ -16,14 +16,10 @@ import ( var AccountQueryCmd = &cobra.Command{ Use: "account [address]", Short: "Get details of an account, with proof", - RunE: doAccountQuery, + RunE: lcmd.RequireInit(doAccountQuery), } func doAccountQuery(cmd *cobra.Command, args []string) error { - if err := lcmd.RequireInit(cmd); err != nil { - return err - } - addr, err := proofcmd.ParseHexKey(args, "address") if err != nil { return err diff --git a/glide.lock b/glide.lock index cc8a27e9c..b8eed3c06 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 4cef4b780c9acbedce588a7221903fa1c63c2ddef1237522bcf6b045c35f9c56 -updated: 2017-06-26T17:36:35.75642408+02:00 +hash: 0075efad18304d9958e655550e042eb4cbeaf78ba5fbebc5f2c5bf0b2a48910b +updated: 2017-06-26T21:33:20.786071254+02:00 imports: - name: github.com/bgentry/speakeasy version: 4aabc24848ce5fd31929f7d1e4ea74d3709c14cd @@ -132,7 +132,7 @@ imports: - data - data/base58 - name: github.com/tendermint/light-client - version: 3d9d9b1a9cde59c8b72f5955e3686a17efe7f6f2 + version: bf3063db6253fc2e9a837eda38de4a26da299bcb subpackages: - certifiers - certifiers/client diff --git a/glide.yaml b/glide.yaml index 1149764eb..233ff148a 100644 --- a/glide.yaml +++ b/glide.yaml @@ -22,7 +22,7 @@ import: subpackages: - data - package: github.com/tendermint/light-client - version: feature/35-cli-cleanup + version: develop subpackages: - commands - commands/proofs