mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-10 22:05:55 +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,
|
||||
"ropsten": 3,
|
||||
"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": {
|
||||
"init": "init",
|
||||
@ -62,4 +64,4 @@
|
||||
"explicit": "explicit"
|
||||
},
|
||||
"embarkResourceOrigin": "http://embark"
|
||||
}
|
||||
}
|
||||
|
@ -124,8 +124,8 @@ class ContractsManager {
|
||||
res.send({result});
|
||||
});
|
||||
} catch (e) {
|
||||
if (funcCall === 'call' && e.message === 'Returned error: gas required exceeds allowance or always failing transaction') {
|
||||
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.'});
|
||||
if (funcCall === 'call' && e.message === constants.blockchain.gasAllowanceError) {
|
||||
return res.send({result: constants.blockchain.gasAllowanceErrorMessage});
|
||||
}
|
||||
res.send({result: e.message});
|
||||
}
|
||||
@ -421,8 +421,7 @@ class ContractsManager {
|
||||
if (Array.isArray(contract.args)) {
|
||||
ref = contract.args;
|
||||
} else {
|
||||
let keys = Object.keys(contract.args);
|
||||
ref = keys.map((k) => contract.args[k]).filter((x) => !x);
|
||||
ref = Object.values(contract.args);
|
||||
}
|
||||
|
||||
for (let j = 0; j < ref.length; j++) {
|
||||
|
@ -2,6 +2,7 @@ let async = require('async');
|
||||
|
||||
const ContractDeployer = require('./contract_deployer.js');
|
||||
const cloneDeep = require('clone-deep');
|
||||
const constants = require('../../constants');
|
||||
|
||||
class DeployManager {
|
||||
constructor(embark, options) {
|
||||
@ -66,6 +67,9 @@ class DeployManager {
|
||||
if (err) {
|
||||
contract.error = 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);
|
||||
}
|
||||
callback();
|
||||
|
Loading…
x
Reference in New Issue
Block a user