aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-14 17:21:40 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-08-14 17:21:40 +0800
commit02656f9f614374b3f30b0cc57562e31c570cdf3d (patch)
treeabb546cfb44302752d05de7693cb9912700a6d17
parent5d9ac49c7e6027c60998a56287dbb3e407011c9b (diff)
downloadgo-tangerine-02656f9f614374b3f30b0cc57562e31c570cdf3d.tar.gz
go-tangerine-02656f9f614374b3f30b0cc57562e31c570cdf3d.tar.zst
go-tangerine-02656f9f614374b3f30b0cc57562e31c570cdf3d.zip
console: use keypad based pinpad (Trezor request)
-rw-r--r--console/bridge.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/console/bridge.go b/console/bridge.go
index b2d4e0974..b28cc438e 100644
--- a/console/bridge.go
+++ b/console/bridge.go
@@ -110,20 +110,15 @@ func (b *bridge) OpenWallet(call otto.FunctionCall) (response otto.Value) {
}
// Trezor PIN matrix input requested, display the matrix to the user and fetch the data
fmt.Fprintf(b.printer, "Look at the device for number positions\n\n")
- fmt.Fprintf(b.printer, "a | b | c\n")
+ fmt.Fprintf(b.printer, "7 | 8 | 9\n")
fmt.Fprintf(b.printer, "--+---+--\n")
- fmt.Fprintf(b.printer, "d | e | f\n")
+ fmt.Fprintf(b.printer, "4 | 5 | 6\n")
fmt.Fprintf(b.printer, "--+---+--\n")
- fmt.Fprintf(b.printer, "g | h | i\n\n")
+ fmt.Fprintf(b.printer, "1 | 2 | 3\n\n")
if input, err := b.prompter.PromptPassword("Please enter current PIN: "); err != nil {
throwJSException(err.Error())
} else {
- // Transform the alphabetical input to numbers
- mapping := map[string]string{"a": "7", "b": "8", "c": "9", "d": "4", "e": "5", "f": "6", "g": "1", "h": "2", "i": "3"}
- for from, to := range mapping {
- input = strings.Replace(input, from, to, -1)
- }
passwd, _ = otto.ToValue(input)
}
if val, err = call.Otto.Call("jeth.openWallet", nil, wallet, passwd); err != nil {