From 3ec1fdb6d9bde0eff8c145d64aa003511b2bb794 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 9 Feb 2016 14:44:40 -0500 Subject: [PATCH] add filename to compiler hash --- lib/compiler.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/compiler.js b/lib/compiler.js index 49c5dcfd..6dfb01ae 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -15,13 +15,15 @@ Compiler.prototype.init = function(env) { Compiler.prototype.compile_solidity = function(contractFiles) { var input = {} - + for (var i = 0; i < contractFiles.length; i++){ - input[contractFiles[i].substring(14)] = fs.readFileSync(contractFiles[i]).toString(); + //console.log(contractFiles[i]); + //input[contractFiles[i].substring(14)] = fs.readFileSync(contractFiles[i]).toString(); + input[contractFiles[i].split('/')[3]] = fs.readFileSync(contractFiles[i]).toString(); } var output = solc.compile({sources: input}, 1); - + if (output.errors) throw new Error ("Solidity errors: " + output.errors)