Commit f6fdab08 authored by yann300's avatar yann300

log message when a library is deploying

parent 4d83fe8b
...@@ -18,8 +18,9 @@ module.exports = { ...@@ -18,8 +18,9 @@ module.exports = {
* @param {Object} params - input paramater of the function to call * @param {Object} params - input paramater of the function to call
* @param {Object} udapp - udapp * @param {Object} udapp - udapp
* @param {Function} callback - callback * @param {Function} callback - callback
* @param {Function} callbackStep - callbackStep
*/ */
buildData: function (contract, contracts, isConstructor, funAbi, params, udapp, callback) { buildData: function (contract, contracts, isConstructor, funAbi, params, udapp, callback, callbackStep) {
var funArgs = '' var funArgs = ''
try { try {
funArgs = $.parseJSON('[' + params + ']') funArgs = $.parseJSON('[' + params + ']')
...@@ -54,7 +55,7 @@ module.exports = { ...@@ -54,7 +55,7 @@ module.exports = {
bytecodeToDeploy = bytecode + dataHex bytecodeToDeploy = bytecode + dataHex
return callback(null, bytecodeToDeploy) return callback(null, bytecodeToDeploy)
} }
}) }, callbackStep)
return return
} else { } else {
dataHex = bytecodeToDeploy + dataHex dataHex = bytecodeToDeploy + dataHex
...@@ -67,7 +68,7 @@ module.exports = { ...@@ -67,7 +68,7 @@ module.exports = {
atAddress: function () {}, atAddress: function () {},
linkBytecode: function (contract, contracts, udapp, callback) { linkBytecode: function (contract, contracts, udapp, callback, callbackStep) {
var bytecode = contract.bytecode var bytecode = contract.bytecode
if (bytecode.indexOf('_') < 0) { if (bytecode.indexOf('_') < 0) {
return callback(null, bytecode) return callback(null, bytecode)
...@@ -95,22 +96,23 @@ module.exports = { ...@@ -95,22 +96,23 @@ module.exports = {
bytecode = bytecode.replace(libLabel, hexAddress) bytecode = bytecode.replace(libLabel, hexAddress)
} }
contract.bytecode = bytecode contract.bytecode = bytecode
this.linkBytecode(contract, contracts, udapp, callback) this.linkBytecode(contract, contracts, udapp, callback, callbackStep)
}) }, callbackStep)
}, },
deployLibrary: function (libraryName, library, udapp, callback) { deployLibrary: function (libraryName, library, udapp, callback, callbackStep) {
var address = library.address var address = library.address
if (address) { if (address) {
return callback(null, address) return callback(null, address)
} }
var bytecode = library.bytecode var bytecode = library.bytecode
if (bytecode.indexOf('_') >= 0) { if (bytecode.indexOf('_') >= 0) {
this.linkBytecode(libraryName, (err, bytecode) => { this.linkBytecode(libraryName, library, udapp, (err, bytecode) => {
if (err) callback(err) if (err) callback(err)
else this.deployLibrary(libraryName, library, udapp, callback) else this.deployLibrary(libraryName, library, udapp, callback, callbackStep)
}) }, callbackStep)
} else { } else {
callbackStep(`creation of library ${libraryName} pending...`)
udapp.runTx({ data: bytecode, useCall: false }, (err, txResult) => { udapp.runTx({ data: bytecode, useCall: false }, (err, txResult) => {
if (err) { if (err) {
return callback(err) return callback(err)
......
...@@ -323,6 +323,8 @@ function contractDropdown (appAPI, appEvents, instanceContainer) { ...@@ -323,6 +323,8 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
} else { } else {
appAPI.logMessage(`creation of ${contractName} errored: ` + error) appAPI.logMessage(`creation of ${contractName} errored: ` + error)
} }
}, (msg) => {
appAPI.logMessage(msg)
}) })
} }
......
...@@ -417,6 +417,8 @@ UniversalDApp.prototype.getCallButton = function (args) { ...@@ -417,6 +417,8 @@ UniversalDApp.prototype.getCallButton = function (args) {
} else { } else {
self._api.logMessage(`${logMsg} errored: ${error} `) self._api.logMessage(`${logMsg} errored: ${error} `)
} }
}, (msg) => {
self._api.logMessage(msg)
}) })
} }
......
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