aboutsummaryrefslogtreecommitdiffstats
path: root/console/console.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-14 23:52:40 +0800
committerGitHub <noreply@github.com>2017-08-14 23:52:40 +0800
commitef0edc6e32d98d2fca54076f38cb317f43704900 (patch)
tree3c110e3aa936721d90537074ea187cbfb5f5991c /console/console.go
parent6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f (diff)
parent02656f9f614374b3f30b0cc57562e31c570cdf3d (diff)
downloaddexon-ef0edc6e32d98d2fca54076f38cb317f43704900.tar
dexon-ef0edc6e32d98d2fca54076f38cb317f43704900.tar.gz
dexon-ef0edc6e32d98d2fca54076f38cb317f43704900.tar.bz2
dexon-ef0edc6e32d98d2fca54076f38cb317f43704900.tar.lz
dexon-ef0edc6e32d98d2fca54076f38cb317f43704900.tar.xz
dexon-ef0edc6e32d98d2fca54076f38cb317f43704900.tar.zst
dexon-ef0edc6e32d98d2fca54076f38cb317f43704900.zip
Merge pull request #14885 from karalabe/trezor-boom
accounts, console, internal: support trezor hardware wallet
Diffstat (limited to 'console/console.go')
-rw-r--r--console/console.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/console/console.go b/console/console.go
index 389d52858..3cd2ad34b 100644
--- a/console/console.go
+++ b/console/console.go
@@ -160,10 +160,15 @@ func (c *Console) init(preload []string) error {
if err != nil {
return err
}
- // Override the unlockAccount, newAccount and sign methods since these require user interaction.
- // Assign these method in the Console the original web3 callbacks. These will be called by the jeth.*
- // methods after they got the password from the user and send the original web3 request to the backend.
+ // Override the openWallet, unlockAccount, newAccount and sign methods since
+ // these require user interaction. Assign these method in the Console the
+ // original web3 callbacks. These will be called by the jeth.* methods after
+ // they got the password from the user and send the original web3 request to
+ // the backend.
if obj := personal.Object(); obj != nil { // make sure the personal api is enabled over the interface
+ if _, err = c.jsre.Run(`jeth.openWallet = personal.openWallet;`); err != nil {
+ return fmt.Errorf("personal.openWallet: %v", err)
+ }
if _, err = c.jsre.Run(`jeth.unlockAccount = personal.unlockAccount;`); err != nil {
return fmt.Errorf("personal.unlockAccount: %v", err)
}
@@ -173,6 +178,7 @@ func (c *Console) init(preload []string) error {
if _, err = c.jsre.Run(`jeth.sign = personal.sign;`); err != nil {
return fmt.Errorf("personal.sign: %v", err)
}
+ obj.Set("openWallet", bridge.OpenWallet)
obj.Set("unlockAccount", bridge.UnlockAccount)
obj.Set("newAccount", bridge.NewAccount)
obj.Set("sign", bridge.Sign)