Merge PR #3050: Add generate-only option to withdraw-rewards

This commit is contained in:
dongsamb 2018-12-11 00:29:10 +09:00 committed by Christopher Goes
parent 7d55bd1a36
commit da7f459d44
1 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package cli
import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@ -88,6 +89,10 @@ func GetCmdWithdrawRewards(cdc *codec.Codec) *cobra.Command {
msg = types.NewMsgWithdrawDelegatorRewardsAll(delAddr)
}
if cliCtx.GenerateOnly {
return utils.PrintUnsignedStdTx(os.Stdout, txBldr, cliCtx, []sdk.Msg{msg}, false)
}
// build and sign the transaction, then broadcast to Tendermint
return utils.CompleteAndBroadcastTxCli(txBldr, cliCtx, []sdk.Msg{msg})
},