Commit b7d50ce5 authored by yann300's avatar yann300

use the callbackDeploylibrairies instead of passing udapp

parent d3d44ee5
...@@ -281,7 +281,7 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) { ...@@ -281,7 +281,7 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) {
var constructor = txHelper.getConstructorInterface(selectedContract.contract.object.abi) var constructor = txHelper.getConstructorInterface(selectedContract.contract.object.abi)
var args = createButtonInput.value var args = createButtonInput.value
txFormat.buildData(selectedContract.name, selectedContract.contract.object, appAPI.getContracts(), true, constructor, args, appAPI.udapp(), (error, data) => { txFormat.buildData(selectedContract.name, selectedContract.contract.object, appAPI.getContracts(), true, constructor, args, (error, data) => {
if (!error) { if (!error) {
appAPI.logMessage(`creation of ${selectedContract.name} pending...`) appAPI.logMessage(`creation of ${selectedContract.name} pending...`)
txExecution.createContract(data, appAPI.udapp(), (error, txResult) => { txExecution.createContract(data, appAPI.udapp(), (error, txResult) => {
...@@ -306,6 +306,9 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) { ...@@ -306,6 +306,9 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) {
} }
}, (msg) => { }, (msg) => {
appAPI.logMessage(msg) appAPI.logMessage(msg)
}, (data, runTxCallback) => {
// called for libraries deployment
appAPI.udapp().runTx(data, runTxCallback)
}) })
} }
......
...@@ -162,7 +162,7 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly, ...@@ -162,7 +162,7 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
logMsg = `call to ${args.contractName}.${(args.funABI.name) ? args.funABI.name : '(fallback)'}` logMsg = `call to ${args.contractName}.${(args.funABI.name) ? args.funABI.name : '(fallback)'}`
} }
} }
txFormat.buildData(args.contractName, args.contractAbi, self.contracts, false, args.funABI, value, self, (error, data) => { txFormat.buildData(args.contractName, args.contractAbi, self.contracts, false, args.funABI, value, (error, data) => {
if (!error) { if (!error) {
if (isUserAction) { if (isUserAction) {
if (!args.funABI.constant) { if (!args.funABI.constant) {
...@@ -194,6 +194,12 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly, ...@@ -194,6 +194,12 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
} }
}, (msg) => { }, (msg) => {
self._api.logMessage(msg) self._api.logMessage(msg)
}, (data, runTxCallback) => {
// called for libraries deployment
self.runTx(data, runTxCallback)
})
}
}) })
} }
......
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