aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2015-03-31 07:51:51 +0800
committerzelig <viktor.tron@gmail.com>2015-04-20 03:57:48 +0800
commit45676382b6cdf3720600647bdd76e4a89fa4495f (patch)
treee4faf2d214c9c07470272f2d9bcc6f84b71b33e3 /cmd
parentd0b3536593fafe19ad31225387d09a62cac6196c (diff)
downloadgo-tangerine-45676382b6cdf3720600647bdd76e4a89fa4495f.tar
go-tangerine-45676382b6cdf3720600647bdd76e4a89fa4495f.tar.gz
go-tangerine-45676382b6cdf3720600647bdd76e4a89fa4495f.tar.bz2
go-tangerine-45676382b6cdf3720600647bdd76e4a89fa4495f.tar.lz
go-tangerine-45676382b6cdf3720600647bdd76e4a89fa4495f.tar.xz
go-tangerine-45676382b6cdf3720600647bdd76e4a89fa4495f.tar.zst
go-tangerine-45676382b6cdf3720600647bdd76e4a89fa4495f.zip
natspec integrated to console frontend confirmTransaction
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/js.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd/geth/js.go b/cmd/geth/js.go
index 0061f20cf..0ac2e319e 100644
--- a/cmd/geth/js.go
+++ b/cmd/geth/js.go
@@ -25,6 +25,7 @@ import (
"strings"
"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/eth"
re "github.com/ethereum/go-ethereum/jsre"
@@ -140,8 +141,16 @@ var net = web3.net;
}
func (self *jsre) ConfirmTransaction(tx *types.Transaction) bool {
- p := fmt.Sprintf("Confirm Transaction %v\n[y/n] ", tx)
- answer, _ := self.Prompt(p)
+ var notice string
+ 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")
}