Fix up flag handling
This commit is contained in:
parent
8dd2371cc5
commit
4652779a3d
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@ import (
|
|||
|
||||
// nolint
|
||||
const (
|
||||
FlagHeight = "height"
|
||||
FlagTrustNode = "trust-node"
|
||||
FlagHeight = "height"
|
||||
)
|
||||
|
||||
// RootCmd represents the base command when called without any subcommands
|
||||
|
@ -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")
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue