From 01e6f63e98636e7200b626185b85dfa254ce2834 Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 17 Jun 2014 11:40:23 +0200 Subject: A handful of GUI fixes --- ethpub/types.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ethpub') diff --git a/ethpub/types.go b/ethpub/types.go index a76421007..31b92f6ed 100644 --- a/ethpub/types.go +++ b/ethpub/types.go @@ -104,16 +104,17 @@ type PTx struct { func NewPTx(tx *ethchain.Transaction) *PTx { hash := hex.EncodeToString(tx.Hash()) receiver := hex.EncodeToString(tx.Recipient) - - if receiver == "" { + if receiver == "0000000000000000000000000000000000000000" { receiver = hex.EncodeToString(tx.CreationAddress()) } sender := hex.EncodeToString(tx.Sender()) createsContract := tx.CreatesContract() - data := string(tx.Data) + var data string if tx.CreatesContract() { data = strings.Join(ethchain.Disassemble(tx.Data), "\n") + } else { + data = hex.EncodeToString(tx.Data) } return &PTx{ref: tx, Hash: hash, Value: ethutil.CurrencyToString(tx.Value), Address: receiver, Contract: tx.CreatesContract(), Gas: tx.Gas.String(), GasPrice: tx.GasPrice.String(), Data: data, Sender: sender, CreatesContract: createsContract, RawData: hex.EncodeToString(tx.Data)} -- cgit v1.2.3 From 2fbcfd88249de8f55b7f06619d9003fadcc8e1e3 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 18 Jun 2014 11:55:05 +0200 Subject: Proper checks for multiple data items. Fixes #80 --- ethpub/pub.go | 5 ----- 1 file changed, 5 deletions(-) (limited to 'ethpub') diff --git a/ethpub/pub.go b/ethpub/pub.go index 20ba79d0b..b475453af 100644 --- a/ethpub/pub.go +++ b/ethpub/pub.go @@ -170,11 +170,6 @@ func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, sc tx = ethchain.NewContractCreationTx(value, gas, gasPrice, script) } else { - // Just in case it was submitted as a 0x prefixed string - if len(scriptStr) > 0 && scriptStr[0:2] == "0x" { - scriptStr = scriptStr[2:len(scriptStr)] - } - data := ethutil.StringToByteFunc(scriptStr, func(s string) (ret []byte) { slice := strings.Split(s, "\n") for _, dataItem := range slice { -- cgit v1.2.3