don't stop when getting a compiler warning but print it as a warning

This commit is contained in:
Iuri Matias 2017-07-15 11:35:29 -04:00
parent aa5efab6f9
commit b56b51cf6e
2 changed files with 9 additions and 1 deletions

View File

@ -83,7 +83,11 @@ class Compiler {
self.logger.info("compiling contracts...");
solcW.compile({sources: input}, 1, function (output) {
if (output.errors) {
return callback(new Error("Solidity errors: " + output.errors).message);
if (output.errors.length === 1 && output.errors[0].indexOf('Warning:') >= 0) {
self.logger.warn(output.errors[0]);
} else {
return callback(new Error("Solidity errors: " + output.errors).message);
}
}
callback(null, output);
});

View File

@ -12,6 +12,10 @@ contract SimpleStorage {
storedData = x;
}
function set2(uint x, uint y) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}