diff --git a/lib/modules/vyper/index.js b/lib/modules/vyper/index.js index 6e11d0b33..f8ca1760e 100644 --- a/lib/modules/vyper/index.js +++ b/lib/modules/vyper/index.js @@ -14,13 +14,15 @@ class Vyper { embark.registerCompiler(".vy", this.compile_vyper.bind(this)); } - static compileVyperContract(filename, compileABI, callback) { - const params = compileABI ? '-f json ' : ''; + compileVyperContract(filename, compileABI, callback) { + const self = this; + const params = compileABI ? '-f=json ' : ''; shelljs.exec(`vyper ${params}${filename}`, {silent: true}, (code, stdout, stderr) => { if (stderr) { return callback(stderr); } if (code !== 0) { + self.logger.error(stdout); return callback(__('Vyper exited with error code ') + code); } if (!stdout) { @@ -31,7 +33,7 @@ class Vyper { } compile_vyper(contractFiles, cb) { - let self = this; + const self = this; if (!contractFiles || !contractFiles.length) { return cb(); } @@ -51,7 +53,7 @@ class Vyper { compiled_object[className] = {}; async.parallel([ function getByteCode(paraCb) { - Vyper.compileVyperContract(file.filename, false, (err, byteCode) => { + self.compileVyperContract(file.filename, false, (err, byteCode) => { if (err) { return paraCb(err); } @@ -62,7 +64,7 @@ class Vyper { }); }, function getABI(paraCb) { - Vyper.compileVyperContract(file.filename, true, (err, ABIString) => { + self.compileVyperContract(file.filename, true, (err, ABIString) => { if (err) { return paraCb(err); }