aboutsummaryrefslogtreecommitdiffstats
path: root/ethpub
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-05-28 21:48:23 +0800
committerMaran <maran.hidskes@gmail.com>2014-05-28 21:48:23 +0800
commit8601604a09a5995525ea5604bfbb1f15b0d09c59 (patch)
treeed1aa25d735e0ba36234f53c92b171c3e0d86e71 /ethpub
parenta98e35d7a048850fb77fad49fff7364cf77a9bae (diff)
downloadgo-tangerine-8601604a09a5995525ea5604bfbb1f15b0d09c59.tar
go-tangerine-8601604a09a5995525ea5604bfbb1f15b0d09c59.tar.gz
go-tangerine-8601604a09a5995525ea5604bfbb1f15b0d09c59.tar.bz2
go-tangerine-8601604a09a5995525ea5604bfbb1f15b0d09c59.tar.lz
go-tangerine-8601604a09a5995525ea5604bfbb1f15b0d09c59.tar.xz
go-tangerine-8601604a09a5995525ea5604bfbb1f15b0d09c59.tar.zst
go-tangerine-8601604a09a5995525ea5604bfbb1f15b0d09c59.zip
Hooked up the Block Explorer to the Debugger so we can instantly debug made transactions
Diffstat (limited to 'ethpub')
-rw-r--r--ethpub/types.go22
1 files changed, 13 insertions, 9 deletions
diff --git a/ethpub/types.go b/ethpub/types.go
index 87d4ef112..de1149a26 100644
--- a/ethpub/types.go
+++ b/ethpub/types.go
@@ -57,14 +57,16 @@ func (self *PBlock) GetTransaction(hash string) *PTx {
type PTx struct {
ref *ethchain.Transaction
- Value string `json:"value"`
- Gas string `json:"gas"`
- GasPrice string `json:"gasPrice"`
- Hash string `json:"hash"`
- Address string `json:"address"`
- Sender string `json:"sender"`
- Data string `json:"data"`
- Contract bool `json:"isContract"`
+ Value string `json:"value"`
+ Gas string `json:"gas"`
+ GasPrice string `json:"gasPrice"`
+ Hash string `json:"hash"`
+ Address string `json:"address"`
+ Sender string `json:"sender"`
+ RawData string `json:"rawData"`
+ Data string `json:"data"`
+ Contract bool `json:"isContract"`
+ CreatesContract bool `json:"createsContract"`
}
func NewPTx(tx *ethchain.Transaction) *PTx {
@@ -75,11 +77,13 @@ func NewPTx(tx *ethchain.Transaction) *PTx {
receiver = hex.EncodeToString(tx.CreationAddress())
}
sender := hex.EncodeToString(tx.Sender())
+ createsContract := tx.CreatesContract()
+
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: 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, CreatesContract: createsContract, RawData: hex.EncodeToString(tx.Data)}
}
func (self *PTx) ToString() string {