Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
02656f9f
Unverified
Commit
02656f9f
authored
Aug 14, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
console: use keypad based pinpad (Trezor request)
parent
5d9ac49c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
bridge.go
console/bridge.go
+3
-8
No files found.
console/bridge.go
View file @
02656f9f
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment