diff options
author | zelig <viktor.tron@gmail.com> | 2015-03-16 23:46:29 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-03-16 23:46:29 +0800 |
commit | 5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb (patch) | |
tree | d5ba6197a8c0c8e36bb92ee9fc8aad717cb2d178 /cmd/mist/bindings.go | |
parent | 8393dab470c40678caf36ada82e312d29c4cf5c4 (diff) | |
parent | 22893b7ac925c49168c119f293ea8befc3aff5cc (diff) | |
download | dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.gz dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.bz2 dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.lz dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.xz dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.zst dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.zip |
Merge remote-tracking branch 'upstream/develop' into frontier/js
Conflicts:
cmd/ethereum/js.go
javascript/types.go
Diffstat (limited to 'cmd/mist/bindings.go')
-rw-r--r-- | cmd/mist/bindings.go | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/cmd/mist/bindings.go b/cmd/mist/bindings.go index b56c0dddf..5d08e7dd7 100644 --- a/cmd/mist/bindings.go +++ b/cmd/mist/bindings.go @@ -26,8 +26,8 @@ import ( "strconv" "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/state" ) @@ -37,32 +37,23 @@ type plugin struct { } func (gui *Gui) Transact(from, recipient, value, gas, gasPrice, d string) (string, error) { - var data string - if len(recipient) == 0 { - code, err := ethutil.Compile(d, false) - if err != nil { - return "", err - } - data = ethutil.Bytes2Hex(code) - } else { - data = ethutil.Bytes2Hex(utils.FormatTransactionData(d)) - } + d = common.Bytes2Hex(utils.FormatTransactionData(d)) - return gui.xeth.Transact(from, recipient, value, gas, gasPrice, data) + return gui.xeth.Transact(from, recipient, value, gas, gasPrice, d) } func (self *Gui) AddPlugin(pluginPath string) { self.plugins[pluginPath] = plugin{Name: pluginPath, Path: pluginPath} json, _ := json.MarshalIndent(self.plugins, "", " ") - ethutil.WriteFile(self.eth.DataDir+"/plugins.json", json) + common.WriteFile(self.eth.DataDir+"/plugins.json", json) } func (self *Gui) RemovePlugin(pluginPath string) { delete(self.plugins, pluginPath) json, _ := json.MarshalIndent(self.plugins, "", " ") - ethutil.WriteFile(self.eth.DataDir+"/plugins.json", json) + common.WriteFile(self.eth.DataDir+"/plugins.json", json) } func (self *Gui) DumpState(hash, path string) { @@ -76,7 +67,7 @@ func (self *Gui) DumpState(hash, path string) { i, _ := strconv.Atoi(hash[1:]) block = self.eth.ChainManager().GetBlockByNumber(uint64(i)) } else { - block = self.eth.ChainManager().GetBlock(ethutil.Hex2Bytes(hash)) + block = self.eth.ChainManager().GetBlock(common.Hex2Bytes(hash)) } if block == nil { |