Merge PR #3698: Prompt User Confirmation Prior to Signing & Broadcasting
* Prompt user confirmation prior to sign & broadcasting * Update confirmation message * Update and fix existing CLI integration tests * Implement CLI integration test for tx confirmation * Fix order of input into tx send
This commit is contained in:
committed by
Christopher Goes
parent
250dc9807b
commit
feb98bcd05
@@ -62,6 +62,22 @@ func CompleteAndBroadcastTxCLI(txBldr authtxb.TxBuilder, cliCtx context.CLIConte
|
||||
return nil
|
||||
}
|
||||
|
||||
if !cliCtx.SkipConfirm {
|
||||
stdSignMsg, err := txBldr.BuildSignMsg(msgs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Fprintf(os.Stderr, "%s\n\n", cliCtx.Codec.MustMarshalJSON(stdSignMsg))
|
||||
|
||||
buf := client.BufferStdin()
|
||||
ok, err := client.GetConfirmation("confirm transaction before signing and broadcasting", buf)
|
||||
if err != nil || !ok {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", "cancelled transaction")
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
passphrase, err := keys.GetPassphrase(fromName)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user