Merge PR #4181: Cherry pick 4135 v0.34.2

This commit is contained in:
Alexander Bezobchuk 2019-04-24 11:56:28 -04:00 committed by GitHub
parent c0e6b38394
commit 66a913c205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 2 deletions

View File

@ -6,6 +6,14 @@
#### SDK #### SDK
* [\#4135](https://github.com/cosmos/cosmos-sdk/pull/4135) Add further clarification
to generate only usage.
### Bug Fixes
#### SDK
* [\#4135](https://github.com/cosmos/cosmos-sdk/pull/4135) Fix `NewResponseFormatBroadcastTxCommit`
* [\#4053](https://github.com/cosmos/cosmos-sdk/issues/4053) Add `--inv-check-period` * [\#4053](https://github.com/cosmos/cosmos-sdk/issues/4053) Add `--inv-check-period`
flag to gaiad to set period at which invariants checks will run. flag to gaiad to set period at which invariants checks will run.

View File

@ -7,6 +7,8 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/pkg/errors"
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
@ -292,7 +294,7 @@ func GetFromFields(from string, genOnly bool) (sdk.AccAddress, string, error) {
if genOnly { if genOnly {
addr, err := sdk.AccAddressFromBech32(from) addr, err := sdk.AccAddressFromBech32(from)
if err != nil { if err != nil {
return nil, "", err return nil, "", errors.Wrap(err, "must provide a valid Bech32 address for generate-only")
} }
return addr, "", nil return addr, "", nil

View File

@ -93,7 +93,7 @@ func PostCommands(cmds ...*cobra.Command) []*cobra.Command {
c.Flags().Bool(FlagPrintResponse, true, "return tx response (only works with async = false)") c.Flags().Bool(FlagPrintResponse, true, "return tx response (only works with async = false)")
c.Flags().Bool(FlagTrustNode, true, "Trust connected full node (don't verify proofs for responses)") c.Flags().Bool(FlagTrustNode, true, "Trust connected full node (don't verify proofs for responses)")
c.Flags().Bool(FlagDryRun, false, "ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it") c.Flags().Bool(FlagDryRun, false, "ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it")
c.Flags().Bool(FlagGenerateOnly, false, "build an unsigned transaction and write it to STDOUT") c.Flags().Bool(FlagGenerateOnly, false, "Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible)")
c.Flags().BoolP(FlagSkipConfirmation, "y", false, "Skip tx broadcasting prompt confirmation") c.Flags().BoolP(FlagSkipConfirmation, "y", false, "Skip tx broadcasting prompt confirmation")
// --gas can accept integers and "simulate" // --gas can accept integers and "simulate"

View File

@ -242,6 +242,10 @@ gaiacli tx sign \
unsignedSendTx.json > signedSendTx.json unsignedSendTx.json > signedSendTx.json
``` ```
::: tip Note
The `--generate-only` flag prevents `gaiacli` from accessing the local keybase.
:::
You can validate the transaction's signatures by typing the following: You can validate the transaction's signatures by typing the following:
```bash ```bash

View File

@ -107,6 +107,10 @@ func NewResponseResultTx(res *ctypes.ResultTx, tx Tx, timestamp string) TxRespon
// NewResponseFormatBroadcastTxCommit returns a TxResponse given a // NewResponseFormatBroadcastTxCommit returns a TxResponse given a
// ResultBroadcastTxCommit from tendermint. // ResultBroadcastTxCommit from tendermint.
func NewResponseFormatBroadcastTxCommit(res *ctypes.ResultBroadcastTxCommit) TxResponse { func NewResponseFormatBroadcastTxCommit(res *ctypes.ResultBroadcastTxCommit) TxResponse {
if res == nil {
return TxResponse{}
}
if !res.CheckTx.IsOK() { if !res.CheckTx.IsOK() {
return newTxResponseCheckTx(res) return newTxResponseCheckTx(res)
} }