Skip to content

Commit aff4ed9

Browse files
committed
cleanup ugly code
1 parent b0a9e8f commit aff4ed9

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/compiler/utils.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ const fs = require('fs');
88

99
function readFileCallback(sourcePath, options) {
1010
options = options || {};
11-
if(sourcePath.startsWith("https://")){
12-
if(options.allowHttp){
13-
14-
}
11+
if(sourcePath.startsWith("https://") && options.allowHttp){
12+
//allow https! imports; not yet implemented
1513
}
1614
else {
1715
const prefixes = [options.basePath ? options.basePath : ""].concat(

src/handler.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,16 @@ contract ${this.settings.templateContractName} {
277277
}
278278
input.settings.outputSelection['*']['*'] = ['abi', 'evm.bytecode']
279279

280-
function readFileCallbackLambda(sourcePath) {
281-
return readFileCallback(sourcePath, {basePath: process.cwd(), includePath: [path.join(process.cwd(),"node_modules")]});
282-
}
283-
284-
const callbacks = { 'import': readFileCallbackLambda };
280+
const callbacks = {
281+
'import': (sourcePath) => readFileCallback(
282+
sourcePath, {
283+
basePath: process.cwd(),
284+
includePath: [
285+
path.join(process.cwd(), "node_modules")
286+
]
287+
}
288+
)
289+
};
285290

286291
let ret = JSON.parse(solcSelected.compile(JSON.stringify(input), callbacks))
287292
if (ret.errors) {

0 commit comments

Comments
 (0)