aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorzsfelfoldi <zsfelfoldi@gmail.com>2015-04-08 19:22:31 +0800
committerzelig <viktor.tron@gmail.com>2015-04-20 03:57:49 +0800
commitc4b7d4d3f77160fba1ab3d8366cb2657a90e2282 (patch)
tree34f15cad05c00f2ab60f8e0084a1a869030b9a13 /cmd
parentb46e15217131e4ebe64e1ee55594c3ab0620395c (diff)
downloadgo-tangerine-c4b7d4d3f77160fba1ab3d8366cb2657a90e2282.tar.gz
go-tangerine-c4b7d4d3f77160fba1ab3d8366cb2657a90e2282.tar.zst
go-tangerine-c4b7d4d3f77160fba1ab3d8366cb2657a90e2282.zip
NatSpec cli option, resolver tests passing
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/js.go12
-rw-r--r--cmd/geth/main.go1
-rw-r--r--cmd/utils/flags.go43
3 files changed, 32 insertions, 24 deletions
diff --git a/cmd/geth/js.go b/cmd/geth/js.go
index d5deea93f..6e5a6f1c7 100644
--- a/cmd/geth/js.go
+++ b/cmd/geth/js.go
@@ -143,10 +143,14 @@ var net = web3.net;
var ds, _ = docserver.New(utils.JSpathFlag.String())
func (self *jsre) ConfirmTransaction(tx string) bool {
- 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")
+ 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 dab167bbb..5b523da3e 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,
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index a1d9eedda..974fabbdc 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -93,6 +93,10 @@ var (
Name: "identity",
Usage: "node name",
}
+ NatspecEnabledFlag = cli.BoolFlag{
+ Name: "natspec",
+ Usage: "Enable NatSpec confirmation notice",
+ }
// miner settings
MinerThreadsFlag = cli.IntFlag{
@@ -252,26 +256,25 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
}
return &eth.Config{
- Name: common.MakeName(clientID, version),
- DataDir: ctx.GlobalString(DataDirFlag.Name),
- ProtocolVersion: ctx.GlobalInt(ProtocolVersionFlag.Name),
- BlockChainVersion: ctx.GlobalInt(BlockchainVersionFlag.Name),
- SkipBcVersionCheck: false,
- NetworkId: ctx.GlobalInt(NetworkIdFlag.Name),
- LogFile: ctx.GlobalString(LogFileFlag.Name),
- LogLevel: ctx.GlobalInt(LogLevelFlag.Name),
- LogJSON: ctx.GlobalString(LogJSONFlag.Name),
- Etherbase: ctx.GlobalString(EtherbaseFlag.Name),
- MinerThreads: ctx.GlobalInt(MinerThreadsFlag.Name),
- AccountManager: GetAccountManager(ctx),
- VmDebug: ctx.GlobalBool(VMDebugFlag.Name),
- MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name),
- Port: ctx.GlobalString(ListenPortFlag.Name),
- NAT: GetNAT(ctx),
- NodeKey: GetNodeKey(ctx),
- Shh: true,
- Dial: true,
- BootNodes: ctx.GlobalString(BootnodesFlag.Name),
+ Name: common.MakeName(clientID, version),
+ DataDir: ctx.GlobalString(DataDirFlag.Name),
+ ProtocolVersion: ctx.GlobalInt(ProtocolVersionFlag.Name),
+ NetworkId: ctx.GlobalInt(NetworkIdFlag.Name),
+ LogFile: ctx.GlobalString(LogFileFlag.Name),
+ LogLevel: ctx.GlobalInt(LogLevelFlag.Name),
+ LogJSON: ctx.GlobalString(LogJSONFlag.Name),
+ Etherbase: ctx.GlobalString(EtherbaseFlag.Name),
+ MinerThreads: ctx.GlobalInt(MinerThreadsFlag.Name),
+ AccountManager: GetAccountManager(ctx),
+ VmDebug: ctx.GlobalBool(VMDebugFlag.Name),
+ MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name),
+ Port: ctx.GlobalString(ListenPortFlag.Name),
+ NAT: GetNAT(ctx),
+ NatSpec: ctx.GlobalBool(NatspecEnabledFlag.Name),
+ NodeKey: GetNodeKey(ctx),
+ Shh: true,
+ Dial: true,
+ BootNodes: ctx.GlobalString(BootnodesFlag.Name),
}
}