aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-21 00:09:10 +0800
committerobscuren <geffobscura@gmail.com>2015-04-21 00:09:10 +0800
commit3b45fedb81dade6fc65c663c76856a07261f30d0 (patch)
tree94c9d0a98b625ca5a8be59f5b780fd3bd54254c7 /cmd/geth
parent76025cc4245f0abc0749f4d1e433be865107bf24 (diff)
parent36ec42e50c9367e86621ff58b8e3d835abbbad79 (diff)
downloaddexon-3b45fedb81dade6fc65c663c76856a07261f30d0.tar
dexon-3b45fedb81dade6fc65c663c76856a07261f30d0.tar.gz
dexon-3b45fedb81dade6fc65c663c76856a07261f30d0.tar.bz2
dexon-3b45fedb81dade6fc65c663c76856a07261f30d0.tar.lz
dexon-3b45fedb81dade6fc65c663c76856a07261f30d0.tar.xz
dexon-3b45fedb81dade6fc65c663c76856a07261f30d0.tar.zst
dexon-3b45fedb81dade6fc65c663c76856a07261f30d0.zip
Merge branch 'ethersphere-frontier/natspec' into develop
Diffstat (limited to 'cmd/geth')
-rw-r--r--cmd/geth/js.go18
-rw-r--r--cmd/geth/main.go1
2 files changed, 14 insertions, 5 deletions
diff --git a/cmd/geth/js.go b/cmd/geth/js.go
index 0061f20cf..6e5a6f1c7 100644
--- a/cmd/geth/js.go
+++ b/cmd/geth/js.go
@@ -25,7 +25,8 @@ import (
"strings"
"github.com/ethereum/go-ethereum/cmd/utils"
- "github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/common/docserver"
+ "github.com/ethereum/go-ethereum/common/natspec"
"github.com/ethereum/go-ethereum/eth"
re "github.com/ethereum/go-ethereum/jsre"
"github.com/ethereum/go-ethereum/rpc"
@@ -139,10 +140,17 @@ var net = web3.net;
js.re.Eval(globalRegistrar + "registrar = new GlobalRegistrar(\"" + globalRegistrarAddr + "\");")
}
-func (self *jsre) ConfirmTransaction(tx *types.Transaction) bool {
- p := fmt.Sprintf("Confirm Transaction %v\n[y/n] ", tx)
- answer, _ := self.Prompt(p)
- return strings.HasPrefix(strings.Trim(answer, " "), "y")
+var ds, _ = docserver.New(utils.JSpathFlag.String())
+
+func (self *jsre) ConfirmTransaction(tx string) bool {
+ if self.ethereum.NatSpec {
+ notice := natspec.GetNotice(self.xeth, tx, ds)
+ fmt.Println(notice)
+ answer, _ := self.Prompt("Confirm Transaction\n[y/n] ")
+ return strings.HasPrefix(strings.Trim(answer, " "), "y")
+ } else {
+ return true
+ }
}
func (self *jsre) UnlockAccount(addr []byte) bool {
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index fa6a93b78..97d358407 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -231,6 +231,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.MinerThreadsFlag,
utils.MiningEnabledFlag,
utils.NATFlag,
+ utils.NatspecEnabledFlag,
utils.NodeKeyFileFlag,
utils.NodeKeyHexFlag,
utils.RPCEnabledFlag,