Commit 62e41049 authored by yann300's avatar yann300

address use toString

parent ad14033b
......@@ -439,7 +439,7 @@ class Blockchain {
function (error, result) {
if (error) return next(error)
const rawAddress = self.executionContext.isVM() ? result.result.createdAddress.buf : result.result.contractAddress
const rawAddress = self.executionContext.isVM() ? (result.result.createdAddress && result.result.createdAddress.toBuffer()) : result.result.contractAddress
const eventName = (tx.useCall ? 'callExecuted' : 'transactionExecuted')
self.event.trigger(eventName, [error, tx.from, tx.to, tx.data, tx.useCall, result, timestamp, payLoad, rawAddress])
......@@ -470,7 +470,7 @@ class Blockchain {
let address = null
let returnValue = null
if (txResult && txResult.result) {
address = isVM ? txResult.result.createdAddress.buf : txResult.result.contractAddress
address = isVM ? (txResult.result.createdAddress && txResult.result.createdAddress.toBuffer()) : txResult.result.contractAddress
// if it's not the VM, we don't have return value. We only have the transaction, and it does not contain the return value.
returnValue = (txResult.result.execResult && isVM) ? txResult.result.execResult.returnValue : txResult.result
}
......
......@@ -101,9 +101,9 @@ export class Web3VmProvider {
}
const tx = {}
tx['hash'] = this.processingHash
tx['from'] = toChecksumAddress(hexConvert(data.getSenderAddress().buf))
if (data.to && data.to.length) {
tx['to'] = toChecksumAddress(hexConvert(data.to.buf))
tx['from'] = toChecksumAddress(data.getSenderAddress().toString())
if (data.to) {
tx['to'] = toChecksumAddress(data.to.toString())
}
this.processingAddress = tx['to']
// tx['data'] = hexConvert(data.data)
......@@ -155,8 +155,8 @@ export class Web3VmProvider {
const status = data.execResult.exceptionError ? 0 : 1
this.txsReceipt[this.processingHash].status = `0x${status}`
if (data.createdAddress && data.createdAddress.buf) {
const address = hexConvert(data.createdAddress.buf)
if (data.createdAddress) {
const address = data.createdAddress.toString()
this.vmTraces[this.processingHash].return = toChecksumAddress(address)
this.txsReceipt[this.processingHash].contractAddress = toChecksumAddress(address)
} else if (data.execResult.returnValue) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment