From fc0825aecac80b739eac2fa5d2b5f50749fde8d0 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 14 Sep 2018 11:50:24 -0400 Subject: [PATCH 1/2] set downloaded flag at the very end --- lib/core/file.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/file.js b/lib/core/file.js index c81d3281..689bd0bb 100644 --- a/lib/core/file.js +++ b/lib/core/file.js @@ -12,6 +12,7 @@ class File { this.path = options.path; this.basedir = options.basedir; this.resolver = options.resolver; + this.downloadedImports = false; } parseFileForImport(content, isHttpContract, callback) { @@ -52,12 +53,12 @@ class File { // We already parsed this file return callback(null, newContent); } - self.downloadedImports = true; async.each(filesToDownload, ((fileObj, eachCb) => { self.downloadFile(fileObj.fileRelativePath, fileObj.url, (_content) => { eachCb(); }); }), (err) => { + self.downloadedImports = true; callback(err, newContent); }); } @@ -98,7 +99,7 @@ class File { fs.readFile(filename, next); }, function parseForImports(content, next) { - self.parseFileForImport(content, true, (err) => { + self.parseFileForImport(content.toString(), true, (err) => { next(err, content); }); } From 600a1dfee81a9b45a73dca60c6a81f5f3258f6e3 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 14 Sep 2018 12:00:04 -0400 Subject: [PATCH 2/2] fix test --- test/config.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/config.js b/test/config.js index 94034501..9bd69d26 100644 --- a/test/config.js +++ b/test/config.js @@ -78,14 +78,16 @@ describe('embark.Config', function () { "type": "http", "path": "https://raw.githubusercontent.com/embark-framework/embark/master/test_app/app/contracts/simple_storage.sol", "basedir": "", - "resolver": undefined + "resolver": undefined, + "downloadedImports": false }, { "filename": ".embark/contracts/status-im/contracts/master/contracts/identity/ERC725.sol", "type": "http", "path": "https://raw.githubusercontent.com/status-im/contracts/master/contracts/identity/ERC725.sol", "basedir": "", - "resolver": undefined + "resolver": undefined, + "downloadedImports": false } ]; config.loadExternalContractsFiles();