|
|
@ -42,8 +42,7 @@ function runTab (localRegistry) { |
|
|
|
udappUI: self._components.registry.get('udappUI').api, |
|
|
|
udappUI: self._components.registry.get('udappUI').api, |
|
|
|
config: self._components.registry.get('config').api, |
|
|
|
config: self._components.registry.get('config').api, |
|
|
|
fileManager: self._components.registry.get('filemanager').api, |
|
|
|
fileManager: self._components.registry.get('filemanager').api, |
|
|
|
editorPanel: self._components.registry.get('editorpanel').api, |
|
|
|
logCallback: self._components.registry.get('logCallback').api |
|
|
|
editor: self._components.registry.get('editor').api |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
self._view.recorderCount = yo`<span>0</span>` |
|
|
|
self._view.recorderCount = yo`<span>0</span>` |
|
|
|
self._view.instanceContainer = yo`<div class="${css.instanceContainer}"></div>` |
|
|
|
self._view.instanceContainer = yo`<div class="${css.instanceContainer}"></div>` |
|
|
@ -198,9 +197,7 @@ function updateAccountBalances (container, self) { |
|
|
|
RECORDER |
|
|
|
RECORDER |
|
|
|
------------------------------------------------ */ |
|
|
|
------------------------------------------------ */ |
|
|
|
function makeRecorder (registry, runTabEvent, self) { |
|
|
|
function makeRecorder (registry, runTabEvent, self) { |
|
|
|
var recorder = new Recorder(self._deps.compiler, self._deps.udapp, (msg) => { |
|
|
|
var recorder = new Recorder(self._deps.compiler, self._deps.udapp, self._deps.logCallback) |
|
|
|
self._deps.editorPanel.logMessage(msg) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
recorder.event.register('newTxRecorded', (count) => { |
|
|
|
recorder.event.register('newTxRecorded', (count) => { |
|
|
|
self.data.count = count |
|
|
|
self.data.count = count |
|
|
@ -370,21 +367,21 @@ function contractDropdown (events, self) { |
|
|
|
var constructor = txHelper.getConstructorInterface(selectedContract.contract.object.abi) |
|
|
|
var constructor = txHelper.getConstructorInterface(selectedContract.contract.object.abi) |
|
|
|
txFormat.buildData(selectedContract.name, selectedContract.contract.object, self._deps.compiler.getContracts(), true, constructor, args, (error, data) => { |
|
|
|
txFormat.buildData(selectedContract.name, selectedContract.contract.object, self._deps.compiler.getContracts(), true, constructor, args, (error, data) => { |
|
|
|
if (!error) { |
|
|
|
if (!error) { |
|
|
|
self._deps.editorPanel.logMessage(`creation of ${selectedContract.name} pending...`) |
|
|
|
self._deps.logCallback(`creation of ${selectedContract.name} pending...`) |
|
|
|
self._deps.udapp.createContract(data, (error, txResult) => { |
|
|
|
self._deps.udapp.createContract(data, (error, txResult) => { |
|
|
|
if (error) { |
|
|
|
if (error) { |
|
|
|
self._deps.editorPanel.logMessage(`creation of ${selectedContract.name} errored: ` + error) |
|
|
|
self._deps.logCallback(`creation of ${selectedContract.name} errored: ` + error) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var isVM = executionContext.isVM() |
|
|
|
var isVM = executionContext.isVM() |
|
|
|
if (isVM) { |
|
|
|
if (isVM) { |
|
|
|
var vmError = txExecution.checkVMError(txResult) |
|
|
|
var vmError = txExecution.checkVMError(txResult) |
|
|
|
if (vmError.error) { |
|
|
|
if (vmError.error) { |
|
|
|
self._deps.editorPanel.logMessage(vmError.message) |
|
|
|
self._deps.logCallback(vmError.message) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (txResult.result.status && txResult.result.status === '0x0') { |
|
|
|
if (txResult.result.status && txResult.result.status === '0x0') { |
|
|
|
self._deps.editorPanel.logMessage(`creation of ${selectedContract.name} errored: transaction execution failed`) |
|
|
|
self._deps.logCallback(`creation of ${selectedContract.name} errored: transaction execution failed`) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
var noInstancesText = self._view.noInstancesText |
|
|
|
var noInstancesText = self._view.noInstancesText |
|
|
@ -394,10 +391,10 @@ function contractDropdown (events, self) { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
self._deps.editorPanel.logMessage(`creation of ${selectedContract.name} errored: ` + error) |
|
|
|
self._deps.logCallback(`creation of ${selectedContract.name} errored: ` + error) |
|
|
|
} |
|
|
|
} |
|
|
|
}, (msg) => { |
|
|
|
}, (msg) => { |
|
|
|
self._deps.editorPanel.logMessage(msg) |
|
|
|
self._deps.logCallback(msg) |
|
|
|
}, (data, runTxCallback) => { |
|
|
|
}, (data, runTxCallback) => { |
|
|
|
// called for libraries deployment
|
|
|
|
// called for libraries deployment
|
|
|
|
self._deps.udapp.runTx(data, runTxCallback) |
|
|
|
self._deps.udapp.runTx(data, runTxCallback) |
|
|
|