Skip to content

Commit bcbe85a

Browse files
committed
Move check for multiple files to the correct place within standardCompileWrapper
1 parent fb1daa5 commit bcbe85a

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

test/compiler.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -654,11 +654,3 @@ for (var version in versions) {
654654
const newSolc = require('../wrapper.js')(require(`/tmp/${version}.js`));
655655
runTests(newSolc, version);
656656
}
657-
658-
659-
// add tests:
660-
// - multiple sources with very old version (error)
661-
// - compiler warnings/errors
662-
// - no bytecode output (gas estimation) from compiler
663-
664-

wrapper.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ function setupMethods (soljson) {
163163
return formatFatalError('No input sources specified.');
164164
}
165165

166-
// Bail out early
167-
if ((input['sources'].length > 1) && (compileJSONMulti === null)) {
168-
return formatFatalError('Multiple sources provided, but compiler only supports single input.');
169-
}
170-
171166
function isOptimizerEnabled (input) {
172167
return input['settings'] && input['settings']['optimizer'] && input['settings']['optimizer']['enabled'];
173168
}
@@ -223,6 +218,9 @@ function setupMethods (soljson) {
223218

224219
// Try our luck with an ancient compiler
225220
if (compileJSON !== null) {
221+
if (Object.keys(sources).length !== 1) {
222+
return formatFatalError('Multiple sources provided, but compiler only supports single input.');
223+
}
226224
return translateOutput(compileJSON(sources[Object.keys(sources)[0]], isOptimizerEnabled(input)), libraries);
227225
}
228226

0 commit comments

Comments
 (0)