diff --git a/remix-analyzer/test/analysis/staticAnalysisIntegration-test.js b/remix-analyzer/test/analysis/staticAnalysisIntegration-test.js index 0d3a67cfdb..9d002ad3e3 100644 --- a/remix-analyzer/test/analysis/staticAnalysisIntegration-test.js +++ b/remix-analyzer/test/analysis/staticAnalysisIntegration-test.js @@ -41,7 +41,7 @@ var testFileAsts = {} testFiles.forEach((fileName) => { var content = fs.readFileSync(path.join(__dirname, 'test-contracts', fileName), 'utf8') - testFileAsts[fileName] = JSON.parse(compiler.compileStandardWrapper(compilerInput(content))) + testFileAsts[fileName] = JSON.parse(compiler.compile(compilerInput(content))) }) test('Integration test thisLocal.js', function (t) { diff --git a/remix-analyzer/test/analysis/staticAnalysisIssues-test.js b/remix-analyzer/test/analysis/staticAnalysisIssues-test.js index e3353d1786..c51108fb86 100644 --- a/remix-analyzer/test/analysis/staticAnalysisIssues-test.js +++ b/remix-analyzer/test/analysis/staticAnalysisIssues-test.js @@ -11,7 +11,7 @@ var path = require('path') function compile (fileName) { var content = fs.readFileSync(path.join(__dirname, 'test-contracts', fileName), 'utf8') - return JSON.parse(compiler.compileStandardWrapper(compilerInput(content))) + return JSON.parse(compiler.compile(compilerInput(content))) } test('staticAnalysisIssues.functionParameterPassingError', function (t) { diff --git a/remix-debug/test/decoder/decodeInfo.js b/remix-debug/test/decoder/decodeInfo.js index 6a41f0d9d4..29dcffb937 100644 --- a/remix-debug/test/decoder/decodeInfo.js +++ b/remix-debug/test/decoder/decodeInfo.js @@ -12,7 +12,7 @@ var util = require('../../src/solidity-decoder/types/util') tape('solidity', function (t) { t.test('astHelper, decodeInfo', function (st) { - var output = compiler.compileStandardWrapper(compilerInput(contracts)) + var output = compiler.compile(compilerInput(contracts)) output = JSON.parse(output) var state = astHelper.extractStateDefinitions('test.sol:contractUint', output.sources) @@ -65,7 +65,7 @@ tape('solidity', function (t) { parsedType = decodeInfo.parseType(stateDef[5].attributes.type, states, 'contractSmallVariable', util.extractLocationFromAstVariable(stateDef[5])) checkDecodeInfo(st, parsedType, 1, 2, 'int16') - output = compiler.compileStandardWrapper(compilerInput(simplecontracts)) + output = compiler.compile(compilerInput(simplecontracts)) output = JSON.parse(output) state = astHelper.extractStateDefinitions('test.sol:simpleContract', output.sources) diff --git a/remix-debug/test/decoder/localDecoder.js b/remix-debug/test/decoder/localDecoder.js index 21c45e17ee..f8fe3c55c1 100644 --- a/remix-debug/test/decoder/localDecoder.js +++ b/remix-debug/test/decoder/localDecoder.js @@ -21,16 +21,16 @@ tape('solidity', function (t) { }) function test (st, vm, privateKey) { - var output = compiler.compileStandardWrapper(compilerInput(intLocal.contract)) + var output = compiler.compile(compilerInput(intLocal.contract)) output = JSON.parse(output) intLocalTest(st, vm, privateKey, output.contracts['test.sol']['intLocal'].evm.bytecode.object, output, function () { - output = compiler.compileStandardWrapper(compilerInput(miscLocal.contract)) + output = compiler.compile(compilerInput(miscLocal.contract)) output = JSON.parse(output) miscLocalTest(st, vm, privateKey, output.contracts['test.sol']['miscLocal'].evm.bytecode.object, output, function () { - output = compiler.compileStandardWrapper(compilerInput(miscLocal.contract)) + output = compiler.compile(compilerInput(miscLocal.contract)) output = JSON.parse(output) misc2LocalTest(st, vm, privateKey, output.contracts['test.sol']['miscLocal2'].evm.bytecode.object, output, function () { - output = compiler.compileStandardWrapper(compilerInput(structArrayLocal.contract)) + output = compiler.compile(compilerInput(structArrayLocal.contract)) output = JSON.parse(output) structArrayLocalTest(st, vm, privateKey, output.contracts['test.sol']['structArrayLocal'].evm.bytecode.object, output, function () { st.end() diff --git a/remix-debug/test/decoder/stateTests/mapping.js b/remix-debug/test/decoder/stateTests/mapping.js index 5a25368642..a3fbb0ede2 100644 --- a/remix-debug/test/decoder/stateTests/mapping.js +++ b/remix-debug/test/decoder/stateTests/mapping.js @@ -13,7 +13,7 @@ module.exports = function testMappingStorage (st, cb) { var mappingStorage = require('../contracts/mappingStorage') var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') var vm = vmCall.initVM(st, privateKey) - var output = compiler.compileStandardWrapper(compilerInput(mappingStorage.contract)) + var output = compiler.compile(compilerInput(mappingStorage.contract)) output = JSON.parse(output) vmCall.sendTx(vm, {nonce: 0, privateKey: privateKey}, null, 0, output.contracts['test.sol']['SimpleMappingState'].evm.bytecode.object, function (error, txHash) { if (error) { diff --git a/remix-debug/test/decoder/storageDecoder.js b/remix-debug/test/decoder/storageDecoder.js index 4b57247814..97396880bd 100644 --- a/remix-debug/test/decoder/storageDecoder.js +++ b/remix-debug/test/decoder/storageDecoder.js @@ -23,7 +23,7 @@ tape('solidity', function (t) { function testIntStorage (st, cb) { var intStorage = require('./contracts/intStorage') - var output = compiler.compileStandardWrapper(compilerInput(intStorage.contract)) + var output = compiler.compile(compilerInput(intStorage.contract)) output = JSON.parse(output) var mockStorageResolver for (var storage of [intStorage.fullStorage, shrinkStorage(intStorage.fullStorage)]) { @@ -70,7 +70,7 @@ function testIntStorage (st, cb) { function testByteStorage (st, cb) { var byteStorage = require('./contracts/byteStorage') - var output = compiler.compileStandardWrapper(compilerInput(byteStorage.contract)) + var output = compiler.compile(compilerInput(byteStorage.contract)) output = JSON.parse(output) var mockStorageResolver for (var storage of [byteStorage.storage, shrinkStorage(byteStorage.storage)]) { @@ -183,7 +183,7 @@ function shrinkStorage (storage) { function testStructArrayStorage (st, cb) { var structArrayStorage = require('./contracts/structArrayStorage') - var output = compiler.compileStandardWrapper(compilerInput(structArrayStorage.contract)) + var output = compiler.compile(compilerInput(structArrayStorage.contract)) output = JSON.parse(output) var mockStorageResolver = new MockStorageResolver(structArrayStorage.storage) stateDecoder.solidityState(mockStorageResolver, output.sources, 'structArrayStorage').then((decoded) => { diff --git a/remix-debug/test/decoder/storageLocation.js b/remix-debug/test/decoder/storageLocation.js index 300adc467b..303ba277c4 100644 --- a/remix-debug/test/decoder/storageLocation.js +++ b/remix-debug/test/decoder/storageLocation.js @@ -8,7 +8,7 @@ var compilerInput = remixLib.helpers.compiler.compilerInput tape('solidity', function (t) { t.test('storage location', function (st) { - var output = compiler.compileStandardWrapper(compilerInput(contracts)) + var output = compiler.compile(compilerInput(contracts)) output = JSON.parse(output) var stateDec = stateDecoder.extractStateVariables('contractUint', output.sources) checkLocation(st, stateDec[0].storagelocation, 0, 0) diff --git a/remix-debug/test/tests.js b/remix-debug/test/tests.js index 01817ce5cd..2adab8b10e 100644 --- a/remix-debug/test/tests.js +++ b/remix-debug/test/tests.js @@ -17,7 +17,7 @@ tape('debug contract', function (t) { t.plan(12) var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') var vm = vmCall.initVM(t, privateKey) - var output = compiler.compileStandardWrapper(compilerInput(ballot)) + var output = compiler.compile(compilerInput(ballot)) output = JSON.parse(output) var web3VM = new remixLib.vm.Web3VMProvider() web3VM.setVM(vm) diff --git a/remix-lib/test/sourceMappingDecoder.js b/remix-lib/test/sourceMappingDecoder.js index 1a6513e384..e7b9a8ea64 100644 --- a/remix-lib/test/sourceMappingDecoder.js +++ b/remix-lib/test/sourceMappingDecoder.js @@ -7,7 +7,7 @@ var compilerInput = require('../src/helpers/compilerHelper').compilerInput tape('SourceMappingDecoder', function (t) { t.test('SourceMappingDecoder.findNodeAtInstructionIndex', function (st) { - var output = compiler.compileStandardWrapper(compilerInput(contracts)) + var output = compiler.compile(compilerInput(contracts)) output = JSON.parse(output) var sourceMappingDecoder = new SourceMappingDecoder() var node = sourceMappingDecoder.findNodeAtInstructionIndex('FunctionDefinition', 2, output.contracts['test.sol']['test'].evm.deployedBytecode.sourceMap, output.sources['test.sol']) diff --git a/remix-lib/test/txFormat.js b/remix-lib/test/txFormat.js index cb542cf6ad..0dabd5f34e 100644 --- a/remix-lib/test/txFormat.js +++ b/remix-lib/test/txFormat.js @@ -11,7 +11,7 @@ var executionContext = require('../src/execution/execution-context') var context tape('ContractParameters - (TxFormat.buildData) - format input parameters', function (t) { - var output = compiler.compileStandardWrapper(compilerInput(uintContract)) + var output = compiler.compile(compilerInput(uintContract)) output = JSON.parse(output) var contract = output.contracts['test.sol']['uintContractTest'] context = { output, contract } @@ -37,7 +37,7 @@ function testWithInput (st, params, expected) { tape('ContractParameters - (TxFormat.buildData) - link Libraries', function (t) { executionContext.setContext('vm') - var compileData = compiler.compileStandardWrapper(compilerInput(deploySimpleLib)) + var compileData = compiler.compile(compilerInput(deploySimpleLib)) var fakeDeployedContracts = { lib1: '0xf7a10e525d4b168f45f74db1b61f63d3e7619e11', @@ -140,7 +140,7 @@ tape('EncodeParameter', function (t) { }) function encodeFunctionCallTest (st) { - var output = compiler.compileStandardWrapper(compilerInput(encodeFunctionCall)) + var output = compiler.compile(compilerInput(encodeFunctionCall)) output = JSON.parse(output) var contract = output.contracts['test.sol']['testContractLinkLibrary'] txFormat.encodeFunctionCall('123, "test string"', contract.abi[0], (error, encoded) => { @@ -154,7 +154,7 @@ function encodeFunctionCallTest (st) { tape('test fallback function', function (t) { t.test('(fallback)', function (st) { st.plan(2) - var output = compiler.compileStandardWrapper(compilerInput(fallbackFunction)) + var output = compiler.compile(compilerInput(fallbackFunction)) output = JSON.parse(output) var contract = output.contracts['test.sol']['fallbackFunctionContract'] st.equal(txHelper.encodeFunctionId(contract.abi[0]), '0x805da4ad') @@ -171,7 +171,7 @@ tape('test abiEncoderV2', function (t) { var decodedData = `[${value1}, ${value2}, "${value3}"], 23` t.test('(abiEncoderV2)', function (st) { st.plan(2) - var output = compiler.compileStandardWrapper(compilerInput(abiEncoderV2)) + var output = compiler.compile(compilerInput(abiEncoderV2)) output = JSON.parse(output) var contract = output.contracts['test.sol']['test'] txFormat.encodeFunctionCall(decodedData, contract.abi[0], (error, encoded) => { @@ -194,7 +194,7 @@ tape('test abiEncoderV2 array of tuple', function (t) { */ st.plan(2) - var output = compiler.compileStandardWrapper(compilerInput(abiEncoderV2ArrayOfTuple)) + var output = compiler.compile(compilerInput(abiEncoderV2ArrayOfTuple)) output = JSON.parse(output) var contract = output.contracts['test.sol']['test'] txFormat.encodeParams('[34, "test"]', contract.abi[0], (error, encoded) => { diff --git a/remix-solidity/src/compiler/compiler-worker.js b/remix-solidity/src/compiler/compiler-worker.js index 14e630aeaf..b4223edf89 100644 --- a/remix-solidity/src/compiler/compiler-worker.js +++ b/remix-solidity/src/compiler/compiler-worker.js @@ -22,7 +22,7 @@ module.exports = function (self) { compileJSON = function (input) { try { - return compiler.compileStandardWrapper(input, function (path) { + return compiler.compile(input, function (path) { missingInputs.push(path) return { 'error': 'Deferred import' } }) diff --git a/remix-solidity/src/compiler/compiler.js b/remix-solidity/src/compiler/compiler.js index 1eeec59da7..f7d954c1e6 100644 --- a/remix-solidity/src/compiler/compiler.js +++ b/remix-solidity/src/compiler/compiler.js @@ -90,7 +90,7 @@ function Compiler (handleImportCall) { var result try { var input = compilerInput(source.sources, {optimize: optimize, target: source.target}) - result = compiler.compileStandardWrapper(input, missingInputsCallback) + result = compiler.compile(input, missingInputsCallback) result = JSON.parse(result) } catch (exception) { result = { error: { formattedMessage: 'Uncaught JavaScript exception:\n' + exception, severity: 'error', mode: 'panic' } }