Hooked up the Block Explorer to the Debugger so we can instantly debug made transactions

This commit is contained in:
Maran 2014-05-28 15:48:23 +02:00
parent a98e35d7a0
commit 8601604a09

View File

@ -63,8 +63,10 @@ type PTx struct {
Hash string `json:"hash"` Hash string `json:"hash"`
Address string `json:"address"` Address string `json:"address"`
Sender string `json:"sender"` Sender string `json:"sender"`
RawData string `json:"rawData"`
Data string `json:"data"` Data string `json:"data"`
Contract bool `json:"isContract"` Contract bool `json:"isContract"`
CreatesContract bool `json:"createsContract"`
} }
func NewPTx(tx *ethchain.Transaction) *PTx { func NewPTx(tx *ethchain.Transaction) *PTx {
@ -75,11 +77,13 @@ func NewPTx(tx *ethchain.Transaction) *PTx {
receiver = hex.EncodeToString(tx.CreationAddress()) receiver = hex.EncodeToString(tx.CreationAddress())
} }
sender := hex.EncodeToString(tx.Sender()) sender := hex.EncodeToString(tx.Sender())
createsContract := tx.CreatesContract()
data := strings.Join(ethchain.Disassemble(tx.Data), "\n") data := strings.Join(ethchain.Disassemble(tx.Data), "\n")
isContract := len(tx.Data) > 0 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 { func (self *PTx) ToString() string {