Commit cda361b9 authored by yann300's avatar yann300 Committed by Aniket

fix error message

parent 4dc2e801
...@@ -319,7 +319,7 @@ class ContractDropdownUI { ...@@ -319,7 +319,7 @@ class ContractDropdownUI {
try { try {
contractMetadata = await this.runView.call('compilerMetadata', 'deployMetadataOf', selectedContract.name, selectedContract.contract.file) contractMetadata = await this.runView.call('compilerMetadata', 'deployMetadataOf', selectedContract.name, selectedContract.contract.file)
} catch (error) { } catch (error) {
return statusCb(`creation of ${selectedContract.name} errored: ` + (error.message ? error.message : error)) return statusCb(`creation of ${selectedContract.name} errored: ${error.message ? error.message : error}`)
} }
const compilerContracts = this.dropdownLogic.getCompilerContracts() const compilerContracts = this.dropdownLogic.getCompilerContracts()
......
...@@ -108,7 +108,7 @@ class Blockchain extends Plugin { ...@@ -108,7 +108,7 @@ class Blockchain extends Plugin {
const { continueCb, promptCb, statusCb, finalCb } = callbacks const { continueCb, promptCb, statusCb, finalCb } = callbacks
const constructor = selectedContract.getConstructorInterface() const constructor = selectedContract.getConstructorInterface()
txFormat.buildData(selectedContract.name, selectedContract.object, compilerContracts, true, constructor, args, (error, data) => { txFormat.buildData(selectedContract.name, selectedContract.object, compilerContracts, true, constructor, args, (error, data) => {
if (error) return statusCb(`creation of ${selectedContract.name} errored: ` + error) if (error) return statusCb(`creation of ${selectedContract.name} errored: ${error.message ? error.message : error}`)
statusCb(`creation of ${selectedContract.name} pending...`) statusCb(`creation of ${selectedContract.name} pending...`)
this.createContract(selectedContract, data, continueCb, promptCb, confirmationCb, finalCb) this.createContract(selectedContract, data, continueCb, promptCb, confirmationCb, finalCb)
...@@ -122,7 +122,7 @@ class Blockchain extends Plugin { ...@@ -122,7 +122,7 @@ class Blockchain extends Plugin {
const { continueCb, promptCb, statusCb, finalCb } = callbacks const { continueCb, promptCb, statusCb, finalCb } = callbacks
const constructor = selectedContract.getConstructorInterface() const constructor = selectedContract.getConstructorInterface()
txFormat.encodeConstructorCallAndLinkLibraries(selectedContract.object, args, constructor, contractMetadata.linkReferences, selectedContract.bytecodeLinkReferences, (error, data) => { txFormat.encodeConstructorCallAndLinkLibraries(selectedContract.object, args, constructor, contractMetadata.linkReferences, selectedContract.bytecodeLinkReferences, (error, data) => {
if (error) return statusCb(`creation of ${selectedContract.name} errored: ` + (error.message ? error.message : error)) if (error) return statusCb(`creation of ${selectedContract.name} errored: ${error.message ? error.message : error}`)
statusCb(`creation of ${selectedContract.name} pending...`) statusCb(`creation of ${selectedContract.name} pending...`)
this.createContract(selectedContract, data, continueCb, promptCb, confirmationCb, finalCb) this.createContract(selectedContract, data, continueCb, promptCb, confirmationCb, finalCb)
...@@ -139,7 +139,7 @@ class Blockchain extends Plugin { ...@@ -139,7 +139,7 @@ class Blockchain extends Plugin {
this.runTx({ data: data, useCall: false }, confirmationCb, continueCb, promptCb, this.runTx({ data: data, useCall: false }, confirmationCb, continueCb, promptCb,
(error, txResult, address) => { (error, txResult, address) => {
if (error) { if (error) {
return finalCb(`creation of ${selectedContract.name} errored: ${(error.message ? error.message : error)}`) return finalCb(`creation of ${selectedContract.name} errored: ${error.message ? error.message : error}`)
} }
if (txResult.receipt.status === false || txResult.receipt.status === '0x0') { if (txResult.receipt.status === false || txResult.receipt.status === '0x0') {
return finalCb(`creation of ${selectedContract.name} errored: transaction execution failed`) return finalCb(`creation of ${selectedContract.name} errored: transaction execution failed`)
...@@ -265,7 +265,7 @@ class Blockchain extends Plugin { ...@@ -265,7 +265,7 @@ class Blockchain extends Plugin {
// contractsDetails is used to resolve libraries // contractsDetails is used to resolve libraries
txFormat.buildData(contractName, contractAbi, {}, false, funABI, callType, (error, data) => { txFormat.buildData(contractName, contractAbi, {}, false, funABI, callType, (error, data) => {
if (error) { if (error) {
return logCallback(`${logMsg} errored: ${error} `) return logCallback(`${logMsg} errored: ${error.message ? error.message : error}`)
} }
if (!lookupOnly) { if (!lookupOnly) {
logCallback(`${logMsg} pending ... `) logCallback(`${logMsg} pending ... `)
...@@ -282,7 +282,7 @@ class Blockchain extends Plugin { ...@@ -282,7 +282,7 @@ class Blockchain extends Plugin {
const useCall = funABI.stateMutability === 'view' || funABI.stateMutability === 'pure' const useCall = funABI.stateMutability === 'view' || funABI.stateMutability === 'pure'
this.runTx({ to: address, data, useCall }, confirmationCb, continueCb, promptCb, (error, txResult, _address, returnValue) => { this.runTx({ to: address, data, useCall }, confirmationCb, continueCb, promptCb, (error, txResult, _address, returnValue) => {
if (error) { if (error) {
return logCallback(`${logMsg} errored: ${error} `) return logCallback(`${logMsg} errored: ${error.message ? error.message : error}`)
} }
if (lookupOnly) { if (lookupOnly) {
outputCb(returnValue) outputCb(returnValue)
......
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