Merge pull request #13 from expanse-project/rebase-1.4.4

fix jeth.go
This commit is contained in:
Christopher Franko 2016-05-22 13:42:38 -04:00
commit 58e149906c

View file

@ -57,7 +57,7 @@ func (self *Jeth) err(call otto.FunctionCall, code int, msg string, id interface
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.
// 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).
@ -96,8 +96,8 @@ func (self *Jeth) UnlockAccount(call otto.FunctionCall) (response otto.Value) {
duration = call.Argument(2)
}
// jexp.unlockAccount will send the request to the backend.
if val, err := call.Otto.Call("jexp.unlockAccount", nil, account, passwd, duration); err == nil {
// jeth.unlockAccount will send the request to the backend.
if val, err := call.Otto.Call("jeth.unlockAccount", nil, account, passwd, duration); err == nil {
return val
} else {
throwJSExeception(err.Error())
@ -106,7 +106,7 @@ func (self *Jeth) UnlockAccount(call otto.FunctionCall) (response otto.Value) {
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) {
var passwd string
if len(call.ArgumentList) == 0 {
@ -131,7 +131,7 @@ func (self *Jeth) NewAccount(call otto.FunctionCall) (response otto.Value) {
return otto.FalseValue()
}
ret, err := call.Otto.Call("jexp.newAccount", nil, passwd)
ret, err := call.Otto.Call("jeth.newAccount", nil, passwd)
if err == nil {
return ret
}