Skip to content

Commit d596325

Browse files
committed
compile() is an alias of compileStandardWrapper() now
Also remove all the other obsolete supporting methods.
1 parent 04ff205 commit d596325

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

test/package.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ tape('Compilation', function (t) {
386386
}
387387
};
388388

389-
var output = JSON.parse(solc.compileStandardWrapper(JSON.stringify(input)));
389+
var output = JSON.parse(solc.compile(JSON.stringify(input)));
390390
var x = getBytecodeStandard(output, 'cont.sol', 'x');
391391
st.ok(x);
392392
st.ok(x.length > 0);
@@ -428,7 +428,7 @@ tape('Compilation', function (t) {
428428
}
429429
};
430430

431-
var output = JSON.parse(solc.compileStandardWrapper(JSON.stringify(input)));
431+
var output = JSON.parse(solc.compile(JSON.stringify(input)));
432432
var x = getBytecodeStandard(output, 'cont.sol', 'x');
433433
st.ok(x);
434434
st.ok(x.length > 0);
@@ -508,7 +508,7 @@ tape('Loading Legacy Versions', function (t) {
508508
}
509509
}
510510
};
511-
var output = JSON.parse(solcSnapshot.compileStandardWrapper(JSON.stringify(input)));
511+
var output = JSON.parse(solcSnapshot.compile(JSON.stringify(input)));
512512
var x = getBytecodeStandard(output, 'cont.sol', 'x');
513513
st.ok(x);
514514
st.ok(x.length > 0);

wrapper.js

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,6 @@ function setupMethods (soljson) {
7979
};
8080
}
8181

82-
var compile = function (input, optimise, readCallback) {
83-
var result = '';
84-
if (readCallback !== undefined && compileJSONCallback !== null) {
85-
result = compileJSONCallback(JSON.stringify(input), optimise, readCallback);
86-
} else if (typeof input !== 'string' && compileJSONMulti !== null) {
87-
result = compileJSONMulti(JSON.stringify(input), optimise);
88-
} else if (compileJSON !== null) {
89-
result = compileJSON(input, optimise);
90-
} else {
91-
return { errors: 'No suitable compiler interface found.' };
92-
}
93-
return JSON.parse(result);
94-
};
95-
9682
// Expects a Standard JSON I/O but supports old compilers
9783
var compileStandardWrapper = function (input, readCallback) {
9884
if (compileStandard !== null) {
@@ -237,13 +223,7 @@ function setupMethods (soljson) {
237223
importCallback: compileJSONCallback !== null || compileStandard !== null,
238224
nativeStandardJSON: compileStandard !== null
239225
},
240-
compile: compile,
241-
compileStandard: compileStandard,
242-
compileStandardWrapper: compileStandardWrapper,
243-
supportsSingle: compileJSON !== null,
244-
supportsMulti: compileJSONMulti !== null,
245-
supportsImportCallback: compileJSONCallback !== null,
246-
supportsStandard: compileStandard !== null,
226+
compile: compileStandardWrapper,
247227
// Loads the compiler of the given version from the github repository
248228
// instead of from the local filesystem.
249229
loadRemoteVersion: function (versionString, cb) {

0 commit comments

Comments
 (0)