mirror of
https://github.com/embarklabs/embark-solc.git
synced 2025-02-28 14:30:36 +00:00
Changes based on code review
This commit is contained in:
parent
31b2cfc7f6
commit
3f69a5c2e4
@ -1,6 +1,7 @@
|
||||
const async = require('async');
|
||||
const shelljs = require('shelljs');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
function compileSolcContract(logger, filename, callback) {
|
||||
shelljs.exec(`solc --optimize --combined-json abi,bin,bin-runtime,compact-format,hashes,interface,metadata ${filename}`,
|
||||
@ -64,8 +65,6 @@ function compileSolc(embark, contractFiles, cb) {
|
||||
compiled_object[className].functionHashes = contract.hashes;
|
||||
compiled_object[className].abiDefinition = JSON.parse(contract.abi);
|
||||
compiled_object[className].filename = fileName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
fileCb();
|
||||
@ -73,20 +72,17 @@ function compileSolc(embark, contractFiles, cb) {
|
||||
},
|
||||
function (err) {
|
||||
cb(err, compiled_object);
|
||||
|
||||
embark.events.on("outputDone", function() {
|
||||
if(outputBinary){
|
||||
if(outputBinary){
|
||||
embark.events.on("outputDone", function() {
|
||||
Object.keys(compiled_object).map(function(className, index) {
|
||||
fs.writeFile(outputDir + className + ".bin", compiled_object[className].bin, (err) => {
|
||||
fs.writeFile(path.join(outputDir, className + ".bin"), compiled_object[className].bin, (err) => {
|
||||
if (err) {
|
||||
logger.error("Error writing binary file: " + JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user