aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/ui/library.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-04-01 16:40:34 +0800
committerobscuren <geffobscura@gmail.com>2014-04-01 16:40:34 +0800
commit5660d598df3d86f892975fcf9628133529598221 (patch)
tree6c48acd1594c9e8aae2e62b505ca232ae4c15363 /ethereal/ui/library.go
parente403b28eea6959c1d0ed003d955df3dee586083b (diff)
downloadgo-tangerine-5660d598df3d86f892975fcf9628133529598221.tar
go-tangerine-5660d598df3d86f892975fcf9628133529598221.tar.gz
go-tangerine-5660d598df3d86f892975fcf9628133529598221.tar.bz2
go-tangerine-5660d598df3d86f892975fcf9628133529598221.tar.lz
go-tangerine-5660d598df3d86f892975fcf9628133529598221.tar.xz
go-tangerine-5660d598df3d86f892975fcf9628133529598221.tar.zst
go-tangerine-5660d598df3d86f892975fcf9628133529598221.zip
Added tx output
Diffstat (limited to 'ethereal/ui/library.go')
-rw-r--r--ethereal/ui/library.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/ethereal/ui/library.go b/ethereal/ui/library.go
index 6f8cb6f65..7a8939bf1 100644
--- a/ethereal/ui/library.go
+++ b/ethereal/ui/library.go
@@ -15,7 +15,7 @@ type EthLib struct {
txPool *ethchain.TxPool
}
-func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data string) string {
+func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data string) (string, error) {
var hash []byte
var contractCreation bool
if len(recipient) == 0 {
@@ -24,7 +24,7 @@ func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data strin
var err error
hash, err = hex.DecodeString(recipient)
if err != nil {
- return err.Error()
+ return "", err
}
}
@@ -37,7 +37,7 @@ func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data strin
if contractCreation {
asm, err := mutan.Compile(strings.NewReader(data), false)
if err != nil {
- return err.Error()
+ return "", err
}
code := ethutil.Assemble(asm...)
@@ -55,7 +55,7 @@ func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data strin
ethutil.Config.Log.Infof("Tx hash %x", tx.Hash())
}
- return ethutil.Hex(tx.Hash())
+ return ethutil.Hex(tx.Hash()), nil
}
/*