From 18415eedaf2571c391260144ca85592c0c263cf2 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 16 Jun 2019 12:06:39 +0200 Subject: [PATCH] Take empty input as yes answer (#4565) Closes: #4564 --- .pending/improvements/sdk/4564-Allow-empty-ans | 1 + client/input/input.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .pending/improvements/sdk/4564-Allow-empty-ans diff --git a/.pending/improvements/sdk/4564-Allow-empty-ans b/.pending/improvements/sdk/4564-Allow-empty-ans new file mode 100644 index 000000000000..9d134996cff9 --- /dev/null +++ b/.pending/improvements/sdk/4564-Allow-empty-ans @@ -0,0 +1 @@ +#4564 Allow empty answer to evaluate as 'Y' on tx submission prompt. diff --git a/client/input/input.go b/client/input/input.go index def5d146c80a..4549493b26ec 100644 --- a/client/input/input.go +++ b/client/input/input.go @@ -98,7 +98,7 @@ func GetConfirmation(prompt string, buf *bufio.Reader) (bool, error) { } response = strings.ToLower(strings.TrimSpace(response)) - if response == "y" || response == "yes" { + if response == "y" || response == "yes" || response == "" { return true, nil } else if response == "n" || response == "no" { return false, nil