aboutsummaryrefslogtreecommitdiffstats
path: root/ethpub/types.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-05-27 16:38:31 +0800
committerMaran <maran.hidskes@gmail.com>2014-05-27 16:38:31 +0800
commitc1b09d639cc922c7aa322ac56cc4f400d76431b4 (patch)
tree6e569a52edd7f5278b1c132a721939daa62eb7e3 /ethpub/types.go
parent817def000ba6488b3999fa9b8eac9fce43984f19 (diff)
downloaddexon-c1b09d639cc922c7aa322ac56cc4f400d76431b4.tar.gz
dexon-c1b09d639cc922c7aa322ac56cc4f400d76431b4.tar.zst
dexon-c1b09d639cc922c7aa322ac56cc4f400d76431b4.zip
Disamble tx data before adding it to PTx object
Diffstat (limited to 'ethpub/types.go')
-rw-r--r--ethpub/types.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/ethpub/types.go b/ethpub/types.go
index af3cfe2cd..348ae3f25 100644
--- a/ethpub/types.go
+++ b/ethpub/types.go
@@ -71,9 +71,11 @@ func NewPTx(tx *ethchain.Transaction) *PTx {
hash := hex.EncodeToString(tx.Hash())
receiver := hex.EncodeToString(tx.Recipient)
sender := hex.EncodeToString(tx.Sender())
+ data := strings.Join(ethchain.Disassemble(tx.Data), "\n")
+
isContract := len(tx.Data) > 0
- return &PTx{ref: tx, Hash: hash, Value: ethutil.CurrencyToString(tx.Value), Address: receiver, Contract: isContract, Gas: tx.Gas.String(), GasPrice: tx.GasPrice.String(), Data: hex.EncodeToString(tx.Data), Sender: sender}
+ return &PTx{ref: tx, Hash: hash, Value: ethutil.CurrencyToString(tx.Value), Address: receiver, Contract: isContract, Gas: tx.Gas.String(), GasPrice: tx.GasPrice.String(), Data: data, Sender: sender}
}
func (self *PTx) ToString() string {