Skip to content

Commit

Permalink
Fix up flag handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Jul 29, 2017
1 parent 8dd2371 commit 4652779
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/commands/proofs/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func GetProof(node client.Client, prover lc.Prover, key []byte, height int) (pro
}

// short-circuit with no proofs
if viper.GetBool(FlagTrustNode) {
if viper.GetBool(commands.FlagTrustNode) {
return proof, err
}

Expand Down
7 changes: 3 additions & 4 deletions client/commands/proofs/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (

// nolint
const (
FlagHeight = "height"
FlagTrustNode = "trust-node"
FlagHeight = "height"
)

// RootCmd represents the base command when called without any subcommands
Expand All @@ -24,7 +23,7 @@ data to other peers as needed.
}

func init() {
RootCmd.Flags().Int(FlagHeight, 0, "Height to query (skip to use latest block)")
RootCmd.Flags().Bool(commands.FlagTrustNode, false,
RootCmd.PersistentFlags().Int(FlagHeight, 0, "Height to query (skip to use latest block)")
RootCmd.PersistentFlags().Bool(commands.FlagTrustNode, false,
"DANGEROUS: blindly trust all results from the server")
}
8 changes: 4 additions & 4 deletions tests/cli/basictx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ test02SendTxWithFee() {
# make sure this works without trust also
OLD_BC_HOME=$BC_HOME
export BC_HOME=/foo
export BCTRUST_NODE=1
export BCNODE=localhost:46657
export BC_TRUST_NODE=1
export BC_NODE=localhost:46657
checkSendFeeTx $HASH $TX_HEIGHT $SENDER "90" "10"
checkAccount $SENDER "9007199254739900"
checkAccount $RECV "1082"
unset BCTRUST_NODE
unset BCNODE
unset BC_TRUST_NODE
unset BC_NODE
export BC_HOME=$OLD_BC_HOME
}

Expand Down

0 comments on commit 4652779

Please sign in to comment.