Commit 45676382 authored by zelig's avatar zelig

natspec integrated to console frontend confirmTransaction

parent d0b35365
...@@ -25,6 +25,7 @@ import ( ...@@ -25,6 +25,7 @@ import (
"strings" "strings"
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common/natspec"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth"
re "github.com/ethereum/go-ethereum/jsre" re "github.com/ethereum/go-ethereum/jsre"
...@@ -140,8 +141,16 @@ var net = web3.net; ...@@ -140,8 +141,16 @@ var net = web3.net;
} }
func (self *jsre) ConfirmTransaction(tx *types.Transaction) bool { func (self *jsre) ConfirmTransaction(tx *types.Transaction) bool {
p := fmt.Sprintf("Confirm Transaction %v\n[y/n] ", tx) var notice string
answer, _ := self.Prompt(p) nat, err := natspec.New()
if err == nil {
notice, err = nat.Notice(tx)
}
if err != nil {
notice = fmt.Sprintf("About to submit transaction: %v")
}
fmt.Println(notice)
answer, _ := self.Prompt("Confirm Transaction\n[y/n] ")
return strings.HasPrefix(strings.Trim(answer, " "), "y") return strings.HasPrefix(strings.Trim(answer, " "), "y")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment