add error for reference issues

This commit is contained in:
Iuri Matias 2017-12-15 16:39:13 -05:00
parent cfaccb307b
commit 68886d7095
1 changed files with 3 additions and 0 deletions

View File

@ -115,6 +115,9 @@ class Deploy {
deployedAddress = deployedAddress.substr(2);
}
let linkReference = '__' + filename + ":" + contractObj.className;
if (linkReference.length > 40) {
return callback(new Error(linkReference + " is too long, try reducing the path of the contract (" + filename + ") and/or its name " + contractObj.className));
}
let toReplace = linkReference + "_".repeat(40 - linkReference.length);
if (contractCode.indexOf(linkReference) >= 0 && deployedAddress === undefined) {
let libraryName = contractObj.className;