Skip to content

Commit

Permalink
Merge branch 'audit'
Browse files Browse the repository at this point in the history
  • Loading branch information
ggq89 committed Jul 18, 2019
2 parents c293206 + 0addf1c commit 93e1bbc
Show file tree
Hide file tree
Showing 22 changed files with 12,508 additions and 13,847 deletions.
10 changes: 0 additions & 10 deletions cmd/console/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,16 +469,6 @@ func (b *bridge) TransferPtn(call otto.FunctionCall) (response otto.Value) {
return val
}

func (b *bridge) LlistAccounts(call otto.FunctionCall) (response otto.Value) {
// Send the request to the backend and return
val, err := call.Otto.Call("jptn.llistAccounts", nil)
if err != nil {
throwJSException(err.Error())
}

return val
}

// Sign is a wrapper around the personal.sign RPC method that uses a non-echoing password
// prompt to acquire the passphrase and executes the original RPC method (saved in
// jptn.sign) with it to actually execute the RPC call.
Expand Down
14 changes: 6 additions & 8 deletions cmd/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,13 @@ func (c *Console) init(preload []string) error {
if _, err = c.jsre.Run(`jptn.transferPtn = personal.transferPtn;`); err != nil {
return fmt.Errorf("personal.transferPtn: %v", err)
}
if _, err = c.jsre.Run(`jptn.llistAccounts = personal.llistAccounts;`); err != nil {
return fmt.Errorf("personal.llistAccounts: %v", err)
}

obj.Set("openWallet", bridge.OpenWallet)
obj.Set("unlockAccount", bridge.UnlockAccount)
obj.Set("newAccount", bridge.NewAccount)
obj.Set("sign", bridge.Sign)
obj.Set("transferPtn", bridge.TransferPtn)
obj.Set("llistAccounts", bridge.LlistAccounts)

}
ptn, errr := c.jsre.Get("ptn")
if errr != nil {
Expand All @@ -203,7 +201,7 @@ func (c *Console) init(preload []string) error {
if _, err = c.jsre.Run(`jptn.signRawTransaction = ptn.signRawTransaction;`); err != nil {
return fmt.Errorf("ptn.signRawTransaction: %v", err)
}
obj.Set("signRawTransaction", bridge.SignRawTransaction)
//obj.Set("signRawTransaction", bridge.SignRawTransaction)
//if _, err = c.jsre.Run(`jptn.getPtnTestCoin = wallet.getPtnTestCoin;`); err != nil {
// return fmt.Errorf("ptn.getPtnTestCoin: %v", err)
//}
Expand Down Expand Up @@ -254,9 +252,9 @@ func (c *Console) init(preload []string) error {
return err
}
if obj := admin.Object(); obj != nil { // make sure the admin api is enabled over the interface
obj.Set("sleepBlocks", bridge.SleepBlocks)
obj.Set("sleep", bridge.Sleep)
obj.Set("clearHistory", c.clearHistory)
//obj.Set("sleepBlocks", bridge.SleepBlocks)
//obj.Set("sleep", bridge.Sleep)
//obj.Set("clearHistory", c.clearHistory)
}
//Add by wzhyuan
// Preload any JavaScript files before starting the console
Expand Down
Loading

0 comments on commit 93e1bbc

Please sign in to comment.