fix data structure

pull/1/head
yann300 7 years ago
parent 2d10e7fdcf
commit 48c72d349f
  1. 3
      src/app/execution/txFormat.js
  2. 4
      src/recorder.js
  3. 8
      src/universal-dapp.js

@ -143,7 +143,8 @@ module.exports = {
}, callbackStep) }, callbackStep)
} else { } else {
callbackStep(`creation of library ${libraryName} pending...`) callbackStep(`creation of library ${libraryName} pending...`)
udapp.runTx({ data: bytecode, useCall: false }, (err, txResult) => { var data = {dataHex: bytecode}
udapp.runTx({ data: data, useCall: false }, (err, txResult) => {
if (err) { if (err) {
return callback(err) return callback(err)
} }

@ -195,7 +195,7 @@ class Recorder {
cb(data.error) cb(data.error)
return return
} else { } else {
record.data = data.data record.data = { dataHex: data.data, funArgs: tx.record.parameters, funAbi: fnABI, contractBytecode: tx.record.bytecode }
} }
self._api.udapp().runTx(record, function (err, txResult) { self._api.udapp().runTx(record, function (err, txResult) {
if (err) { if (err) {
@ -211,7 +211,7 @@ class Recorder {
newContractFn(abi, address, record.contractName) newContractFn(abi, address, record.contractName)
} }
} }
cb() cb(err)
}) })
}, () => { self.setListen(true) }) }, () => { self.setListen(true) })
} }

@ -527,14 +527,14 @@ function queryAddress (env, next) {
} }
function runTransaction (env, next) { function runTransaction (env, next) {
var { self, args, tx, payLoad } = env var { self, tx, payLoad } = env
var timestamp = Date.now() var timestamp = Date.now()
self.event.trigger('initiatingTransaction', [timestamp, tx, payLoad]) self.event.trigger('initiatingTransaction', [timestamp, tx, payLoad])
self.txRunner.rawRun(tx, function (error, result) { self.txRunner.rawRun(tx, function (error, result) {
if (!args.useCall) { if (!tx.useCall) {
self.event.trigger('transactionExecuted', [error, args.from, args.to, args.data, false, result, timestamp, payLoad]) self.event.trigger('transactionExecuted', [error, tx.from, tx.to, tx.data, false, result, timestamp, payLoad])
} else { } else {
self.event.trigger('callExecuted', [error, args.from, args.to, args.data, true, result, timestamp, payLoad]) self.event.trigger('callExecuted', [error, tx.from, tx.to, tx.data, true, result, timestamp, payLoad])
} }
if (error) { if (error) {
if (typeof (error) !== 'string') { if (typeof (error) !== 'string') {

Loading…
Cancel
Save