aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-22 23:35:26 +0800
committerobscuren <geffobscura@gmail.com>2014-05-22 23:35:26 +0800
commit230aafbf66ba747fb3796810adf3b1680f368e73 (patch)
tree66aff77b70bf083cc1a7ce32ab108d39d82ac95d /ethutil
parent14787ac148274a84478aa06fd985407b9241cd50 (diff)
downloaddexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar
dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar.gz
dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar.bz2
dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar.lz
dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar.xz
dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar.zst
dexon-230aafbf66ba747fb3796810adf3b1680f368e73.zip
Working on interop
* Receipts after each transaction * Fee structure * Applying fees to miners
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/config.go10
-rw-r--r--ethutil/value.go2
2 files changed, 9 insertions, 3 deletions
diff --git a/ethutil/config.go b/ethutil/config.go
index 1b41c4634..e6cbde4b6 100644
--- a/ethutil/config.go
+++ b/ethutil/config.go
@@ -19,6 +19,7 @@ type config struct {
Ver string
ClientString string
Pubkey []byte
+ Identifier string
}
var Config *config
@@ -26,7 +27,7 @@ var Config *config
// Read config
//
// Initialize the global Config variable with default settings
-func ReadConfig(base string, logTypes LoggerType) *config {
+func ReadConfig(base string, logTypes LoggerType, id string) *config {
if Config == nil {
usr, _ := user.Current()
path := path.Join(usr.HomeDir, base)
@@ -43,6 +44,7 @@ func ReadConfig(base string, logTypes LoggerType) *config {
}
Config = &config{ExecPath: path, Debug: true, Ver: "0.5.0 RC8"}
+ Config.Identifier = id
Config.Log = NewLogger(logTypes, LogLevelDebug)
Config.SetClientString("/Ethereum(G)")
}
@@ -53,7 +55,11 @@ func ReadConfig(base string, logTypes LoggerType) *config {
// Set client string
//
func (c *config) SetClientString(str string) {
- Config.ClientString = fmt.Sprintf("%s nv%s/%s", str, c.Ver, runtime.GOOS)
+ id := runtime.GOOS
+ if len(c.Identifier) > 0 {
+ id = c.Identifier
+ }
+ Config.ClientString = fmt.Sprintf("%s nv%s/%s", str, c.Ver, id)
}
type LoggerType byte
diff --git a/ethutil/value.go b/ethutil/value.go
index b7756f9b1..83600abc2 100644
--- a/ethutil/value.go
+++ b/ethutil/value.go
@@ -16,7 +16,7 @@ type Value struct {
}
func (val *Value) String() string {
- return fmt.Sprintf("%q", val.Val)
+ return fmt.Sprintf("%x", val.Val)
}
func NewValue(val interface{}) *Value {