mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 06:16:01 +00:00
Merge pull request #1089 from embark-framework/bug_fix/deploy-error
Fix using an object as arguments
This commit is contained in:
commit
c85c3bc809
@ -41,7 +41,9 @@
|
|||||||
"testnet": 3,
|
"testnet": 3,
|
||||||
"ropsten": 3,
|
"ropsten": 3,
|
||||||
"rinkeby": 4
|
"rinkeby": 4
|
||||||
}
|
},
|
||||||
|
"gasAllowanceError": "Returned error: gas required exceeds allowance or always failing transaction",
|
||||||
|
"gasAllowanceErrorMessage": "Failing call, this could be because of invalid inputs or function guards that may have been triggered, or an unknown error."
|
||||||
},
|
},
|
||||||
"storage": {
|
"storage": {
|
||||||
"init": "init",
|
"init": "init",
|
||||||
@ -62,4 +64,4 @@
|
|||||||
"explicit": "explicit"
|
"explicit": "explicit"
|
||||||
},
|
},
|
||||||
"embarkResourceOrigin": "http://embark"
|
"embarkResourceOrigin": "http://embark"
|
||||||
}
|
}
|
||||||
|
@ -124,8 +124,8 @@ class ContractsManager {
|
|||||||
res.send({result});
|
res.send({result});
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (funcCall === 'call' && e.message === 'Returned error: gas required exceeds allowance or always failing transaction') {
|
if (funcCall === 'call' && e.message === constants.blockchain.gasAllowanceError) {
|
||||||
return res.send({result: 'Failing call, this could be because of invalid inputs or function guards that may have been triggered, or an unknown error.'});
|
return res.send({result: constants.blockchain.gasAllowanceErrorMessage});
|
||||||
}
|
}
|
||||||
res.send({result: e.message});
|
res.send({result: e.message});
|
||||||
}
|
}
|
||||||
@ -421,8 +421,7 @@ class ContractsManager {
|
|||||||
if (Array.isArray(contract.args)) {
|
if (Array.isArray(contract.args)) {
|
||||||
ref = contract.args;
|
ref = contract.args;
|
||||||
} else {
|
} else {
|
||||||
let keys = Object.keys(contract.args);
|
ref = Object.values(contract.args);
|
||||||
ref = keys.map((k) => contract.args[k]).filter((x) => !x);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let j = 0; j < ref.length; j++) {
|
for (let j = 0; j < ref.length; j++) {
|
||||||
|
@ -2,6 +2,7 @@ let async = require('async');
|
|||||||
|
|
||||||
const ContractDeployer = require('./contract_deployer.js');
|
const ContractDeployer = require('./contract_deployer.js');
|
||||||
const cloneDeep = require('clone-deep');
|
const cloneDeep = require('clone-deep');
|
||||||
|
const constants = require('../../constants');
|
||||||
|
|
||||||
class DeployManager {
|
class DeployManager {
|
||||||
constructor(embark, options) {
|
constructor(embark, options) {
|
||||||
@ -66,6 +67,9 @@ class DeployManager {
|
|||||||
if (err) {
|
if (err) {
|
||||||
contract.error = err.message || err;
|
contract.error = err.message || err;
|
||||||
self.logger.error(`[${contract.className}]: ${err.message || err}`);
|
self.logger.error(`[${contract.className}]: ${err.message || err}`);
|
||||||
|
if (contract.error === constants.blockchain.gasAllowanceError) {
|
||||||
|
self.logger.error(constants.blockchain.gasAllowanceErrorMessage);
|
||||||
|
}
|
||||||
errors.push(err);
|
errors.push(err);
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user