diff options
Diffstat (limited to 'xeth/js_types.go')
-rw-r--r-- | xeth/js_types.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xeth/js_types.go b/xeth/js_types.go index 1d9faa190..987edce37 100644 --- a/xeth/js_types.go +++ b/xeth/js_types.go @@ -96,21 +96,21 @@ type JSTransaction struct { func NewJSTx(tx *types.Transaction, state *state.StateDB) *JSTransaction { hash := ethutil.Bytes2Hex(tx.Hash()) - receiver := ethutil.Bytes2Hex(tx.Recipient) + receiver := ethutil.Bytes2Hex(tx.To()) if receiver == "0000000000000000000000000000000000000000" { - receiver = ethutil.Bytes2Hex(tx.CreationAddress(state)) + receiver = ethutil.Bytes2Hex(core.AddressFromMessage(tx)) } sender := ethutil.Bytes2Hex(tx.Sender()) - createsContract := tx.CreatesContract() + createsContract := core.MessageCreatesContract(tx) var data string - if tx.CreatesContract() { - data = strings.Join(core.Disassemble(tx.Data), "\n") + if createsContract { + data = strings.Join(core.Disassemble(tx.Data()), "\n") } else { - data = ethutil.Bytes2Hex(tx.Data) + data = ethutil.Bytes2Hex(tx.Data()) } - return &JSTransaction{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: ethutil.Bytes2Hex(tx.Data)} + return &JSTransaction{ref: tx, Hash: hash, Value: ethutil.CurrencyToString(tx.Value()), Address: receiver, Contract: createsContract, Gas: tx.Gas().String(), GasPrice: tx.GasPrice().String(), Data: data, Sender: sender, CreatesContract: createsContract, RawData: ethutil.Bytes2Hex(tx.Data())} } func (self *JSTransaction) ToString() string { |