conversions. -compilable-

This commit is contained in:
obscuren
2015-03-18 13:00:01 +01:00
parent 942980609f
commit 0a1eeca41e
12 changed files with 139 additions and 130 deletions

View File

@ -142,9 +142,9 @@ func NewTx(tx *types.Transaction) *Transaction {
hash := tx.Hash().Hex()
receiver := tx.To().Hex()
if len(receiver) == 0 {
receiver = toHex(core.AddressFromMessage(tx))
receiver = core.AddressFromMessage(tx).Hex()
}
sender := toHex(tx.From())
sender, _ := tx.From()
createsContract := core.MessageCreatesContract(tx)
var data string
@ -154,7 +154,7 @@ func NewTx(tx *types.Transaction) *Transaction {
data = toHex(tx.Data())
}
return &Transaction{ref: tx, Hash: hash, Value: common.CurrencyToString(tx.Value()), Address: receiver, Contract: createsContract, Gas: tx.Gas().String(), GasPrice: tx.GasPrice().String(), Data: data, Sender: sender, CreatesContract: createsContract, RawData: toHex(tx.Data())}
return &Transaction{ref: tx, Hash: hash, Value: common.CurrencyToString(tx.Value()), Address: receiver, Contract: createsContract, Gas: tx.Gas().String(), GasPrice: tx.GasPrice().String(), Data: data, Sender: sender.Hex(), CreatesContract: createsContract, RawData: toHex(tx.Data())}
}
func (self *Transaction) ToString() string {