mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
fix jeth.go
This commit is contained in:
parent
5ba12acaa6
commit
990f6f38de
1 changed files with 5 additions and 5 deletions
|
|
@ -57,7 +57,7 @@ func (self *Jeth) err(call otto.FunctionCall, code int, msg string, id interface
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnlockAccount asks the user for the password and than executes the jexp.UnlockAccount callback in the jsre.
|
// UnlockAccount asks the user for the password and than executes the jeth.UnlockAccount callback in the jsre.
|
||||||
// It will need the public address for the account to unlock as first argument.
|
// It will need the public address for the account to unlock as first argument.
|
||||||
// The second argument is an optional string with the password. If not given the user is prompted for the password.
|
// The second argument is an optional string with the password. If not given the user is prompted for the password.
|
||||||
// The third argument is an optional integer which specifies for how long the account will be unlocked (in seconds).
|
// The third argument is an optional integer which specifies for how long the account will be unlocked (in seconds).
|
||||||
|
|
@ -96,8 +96,8 @@ func (self *Jeth) UnlockAccount(call otto.FunctionCall) (response otto.Value) {
|
||||||
duration = call.Argument(2)
|
duration = call.Argument(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// jexp.unlockAccount will send the request to the backend.
|
// jeth.unlockAccount will send the request to the backend.
|
||||||
if val, err := call.Otto.Call("jexp.unlockAccount", nil, account, passwd, duration); err == nil {
|
if val, err := call.Otto.Call("jeth.unlockAccount", nil, account, passwd, duration); err == nil {
|
||||||
return val
|
return val
|
||||||
} else {
|
} else {
|
||||||
throwJSExeception(err.Error())
|
throwJSExeception(err.Error())
|
||||||
|
|
@ -106,7 +106,7 @@ func (self *Jeth) UnlockAccount(call otto.FunctionCall) (response otto.Value) {
|
||||||
return otto.FalseValue()
|
return otto.FalseValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewAccount asks the user for the password and than executes the jexp.newAccount callback in the jsre
|
// NewAccount asks the user for the password and than executes the jeth.newAccount callback in the jsre
|
||||||
func (self *Jeth) NewAccount(call otto.FunctionCall) (response otto.Value) {
|
func (self *Jeth) NewAccount(call otto.FunctionCall) (response otto.Value) {
|
||||||
var passwd string
|
var passwd string
|
||||||
if len(call.ArgumentList) == 0 {
|
if len(call.ArgumentList) == 0 {
|
||||||
|
|
@ -131,7 +131,7 @@ func (self *Jeth) NewAccount(call otto.FunctionCall) (response otto.Value) {
|
||||||
return otto.FalseValue()
|
return otto.FalseValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
ret, err := call.Otto.Call("jexp.newAccount", nil, passwd)
|
ret, err := call.Otto.Call("jeth.newAccount", nil, passwd)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue