diff --git a/src/app/execution/txLogger.js b/src/app/execution/txLogger.js index da2387b136..5d10eba2d5 100644 --- a/src/app/execution/txLogger.js +++ b/src/app/execution/txLogger.js @@ -117,10 +117,8 @@ function renderKnownTransaction (self, data) { if (data.tx.blockHash) { to = data.tx.to } else if (data.tx.hash) { // call (constructor of function call) - var name = data.resolvedData.contractName + '.' + data.resolvedData.fn - var logs = ', ' + data.logs.length + ' logs' if (data.resolvedData.fn === '(constructor)') { - to = name + logs + to = data.resolvedData.contractName + '.' + data.resolvedData.fn } else { to = data.resolvedData.to } @@ -147,7 +145,15 @@ function renderKnownTransaction (self, data) { tx.removeChild(table) } else { table = createTable({ - from, to, val: data.tx.value, input: data.tx.input, hash: data.tx.hash, gas: data.tx.gas, logs: data.logs + contractAddress: data.tx.contractAddress, + data: data.tx.data, + from, + to, + gas: data.tx.gas, + hash: data.tx.has, + input: data.tx.input, + logs: JSON.stringify(data.tx.logs) || '0', + val: data.tx.value }) tx.appendChild(table) } @@ -179,7 +185,7 @@ function renderUnknownTransaction (self, data) { tx.removeChild(table) } else { table = createTable({ - from, to, val: data.tx.value, input: data.tx.input, hash: data.tx.hash, gas: data.tx.gas + from, to, val: data.tx.value, input: data.tx.input, hash: data.tx.hash, gas: data.tx.gas, logs: JSON.stringify(data.tx.logs) || '0' }) tx.appendChild(table) } @@ -196,9 +202,9 @@ function context (self, data) { var to = '' if (executionContext.getProvider() === 'vm') { if (data.resolvedData.to) { - to = `${data.resolvedData.contractName}.${data.resolvedData.fn}, ${data.resolvedData.to}, ${data.logs.length} logs` + to = `${data.resolvedData.contractName}.${data.resolvedData.fn}, ${helper.shortenHexData(data.resolvedData.to)}` } else { - to = `${data.resolvedData.contractName}.${data.resolvedData.fn}, ${data.logs.length} logs` + to = `${data.resolvedData.contractName}.${data.resolvedData.fn}` } return yo`[vm] from: ${from}, to:${to}, value:${data.tx.value} wei` } else { @@ -228,49 +234,72 @@ module.exports = TxLogger // helpers function createTable (opts) { - var from = opts.from - var to = opts.to - var val = opts.val - var input = opts.input - var hash = opts.hash - var gas = opts.gas - var table = yo` - + var table = yo`
` + var contractAddress = yo` + + contractAddress + ${opts.contractAddress} + + ` + if (opts.contractAddress) table.appendChild(contractAddress) + var data = helper.shortenHexData(opts.input) + data = yo` + + data + ${data} + + ` + if (opts.data) table.appendChild(data) + var from = yo` from - ${from} + ${opts.from} + ` + if (opts.from) table.appendChild(from) + var to = yo` to - ${to} + ${opts.to} + ` + if (opts.to) table.appendChild(to) + var gas = yo` - value - ${value(val)} wei + gas + ${opts.gas} + ` + if (opts.gas) table.appendChild(gas) + var hash = yo` - input - ${helper.shortenHexData(input)} + hash + ${opts.hash} + ` + if (opts.hash) table.appendChild(hash) + var input = helper.shortenHexData(opts.input) + input = yo` - hash - ${hash} + input + ${input} + ` + if (opts.input) table.appendChild(input) + var logs = yo` - gas - ${gas} + logs + ${opts.logs || '0'} - ` - if (opts.logs) { - var logs = opts.logs - logs = yo` + if (opts.logs) table.appendChild(logs) + var val = value(opts.val) + val = yo` - logs - ${logs} + value + ${val} wei - ` - table.appendChild(logs) - } + ` + if (opts.val) table.appendChild(val) return table } diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 0cf97bb140..9e09bb03c5 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -300,7 +300,7 @@ function contractDropdown (appAPI, appEvents, instanceContainer) { var args = createButtonInput.value txFormat.buildData(contract, contracts, true, constructor, args, appAPI.udapp(), (error, data) => { if (!error) { - appAPI.logMessage('transaction added ...') + appAPI.logMessage('[WEB3] transaction added ...') txExecution.createContract(data, appAPI.udapp(), (error, txResult) => { if (!error) { var isVM = executionContext.isVM() diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 06feb38cb1..51618438aa 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -309,7 +309,7 @@ UniversalDApp.prototype.getCallButton = function (args) { if (!error) { txExecution.callFunction(args.address, data, args.funABI, self, (error, txResult) => { if (!error) { - self._api.logMessage('UDApp transaction added ...') + self._api.logMessage('[WEB3] UDApp transaction added ...') var isVM = executionContext.isVM() if (isVM) { var vmError = txExecution.checkVMError(txResult)