|
|
@ -26,8 +26,8 @@ import ( |
|
|
|
"strconv" |
|
|
|
"strconv" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/cmd/utils" |
|
|
|
"github.com/ethereum/go-ethereum/cmd/utils" |
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
|
"github.com/ethereum/go-ethereum/state" |
|
|
|
"github.com/ethereum/go-ethereum/state" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -37,18 +37,9 @@ type plugin struct { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (gui *Gui) Transact(from, recipient, value, gas, gasPrice, d string) (string, error) { |
|
|
|
func (gui *Gui) Transact(from, recipient, value, gas, gasPrice, d string) (string, error) { |
|
|
|
var data string |
|
|
|
d = common.Bytes2Hex(utils.FormatTransactionData(d)) |
|
|
|
if len(recipient) == 0 { |
|
|
|
|
|
|
|
code, err := common.Compile(d, false) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return "", err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
data = common.Bytes2Hex(code) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
data = 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) { |
|
|
|
func (self *Gui) AddPlugin(pluginPath string) { |
|
|
|