renamed solc.compileStandardWrapper to solc.compile

pull/7/head
LianaHus 6 years ago
parent 96083a484c
commit fcc623bf2b
  1. 2
      remix-analyzer/test/analysis/staticAnalysisIntegration-test.js
  2. 2
      remix-analyzer/test/analysis/staticAnalysisIssues-test.js
  3. 4
      remix-debug/test/decoder/decodeInfo.js
  4. 8
      remix-debug/test/decoder/localDecoder.js
  5. 2
      remix-debug/test/decoder/stateTests/mapping.js
  6. 6
      remix-debug/test/decoder/storageDecoder.js
  7. 2
      remix-debug/test/decoder/storageLocation.js
  8. 2
      remix-debug/test/tests.js
  9. 2
      remix-lib/test/sourceMappingDecoder.js
  10. 12
      remix-lib/test/txFormat.js
  11. 2
      remix-solidity/src/compiler/compiler-worker.js
  12. 2
      remix-solidity/src/compiler/compiler.js

@ -41,7 +41,7 @@ var testFileAsts = {}
testFiles.forEach((fileName) => { testFiles.forEach((fileName) => {
var content = fs.readFileSync(path.join(__dirname, 'test-contracts', fileName), 'utf8') 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) { test('Integration test thisLocal.js', function (t) {

@ -11,7 +11,7 @@ var path = require('path')
function compile (fileName) { function compile (fileName) {
var content = fs.readFileSync(path.join(__dirname, 'test-contracts', fileName), 'utf8') 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) { test('staticAnalysisIssues.functionParameterPassingError', function (t) {

@ -12,7 +12,7 @@ var util = require('../../src/solidity-decoder/types/util')
tape('solidity', function (t) { tape('solidity', function (t) {
t.test('astHelper, decodeInfo', function (st) { t.test('astHelper, decodeInfo', function (st) {
var output = compiler.compileStandardWrapper(compilerInput(contracts)) var output = compiler.compile(compilerInput(contracts))
output = JSON.parse(output) output = JSON.parse(output)
var state = astHelper.extractStateDefinitions('test.sol:contractUint', output.sources) 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])) parsedType = decodeInfo.parseType(stateDef[5].attributes.type, states, 'contractSmallVariable', util.extractLocationFromAstVariable(stateDef[5]))
checkDecodeInfo(st, parsedType, 1, 2, 'int16') checkDecodeInfo(st, parsedType, 1, 2, 'int16')
output = compiler.compileStandardWrapper(compilerInput(simplecontracts)) output = compiler.compile(compilerInput(simplecontracts))
output = JSON.parse(output) output = JSON.parse(output)
state = astHelper.extractStateDefinitions('test.sol:simpleContract', output.sources) state = astHelper.extractStateDefinitions('test.sol:simpleContract', output.sources)

@ -21,16 +21,16 @@ tape('solidity', function (t) {
}) })
function test (st, vm, privateKey) { function test (st, vm, privateKey) {
var output = compiler.compileStandardWrapper(compilerInput(intLocal.contract)) var output = compiler.compile(compilerInput(intLocal.contract))
output = JSON.parse(output) output = JSON.parse(output)
intLocalTest(st, vm, privateKey, output.contracts['test.sol']['intLocal'].evm.bytecode.object, output, function () { 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) output = JSON.parse(output)
miscLocalTest(st, vm, privateKey, output.contracts['test.sol']['miscLocal'].evm.bytecode.object, output, function () { 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) output = JSON.parse(output)
misc2LocalTest(st, vm, privateKey, output.contracts['test.sol']['miscLocal2'].evm.bytecode.object, output, function () { 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) output = JSON.parse(output)
structArrayLocalTest(st, vm, privateKey, output.contracts['test.sol']['structArrayLocal'].evm.bytecode.object, output, function () { structArrayLocalTest(st, vm, privateKey, output.contracts['test.sol']['structArrayLocal'].evm.bytecode.object, output, function () {
st.end() st.end()

@ -13,7 +13,7 @@ module.exports = function testMappingStorage (st, cb) {
var mappingStorage = require('../contracts/mappingStorage') var mappingStorage = require('../contracts/mappingStorage')
var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex')
var vm = vmCall.initVM(st, privateKey) var vm = vmCall.initVM(st, privateKey)
var output = compiler.compileStandardWrapper(compilerInput(mappingStorage.contract)) var output = compiler.compile(compilerInput(mappingStorage.contract))
output = JSON.parse(output) output = JSON.parse(output)
vmCall.sendTx(vm, {nonce: 0, privateKey: privateKey}, null, 0, output.contracts['test.sol']['SimpleMappingState'].evm.bytecode.object, function (error, txHash) { vmCall.sendTx(vm, {nonce: 0, privateKey: privateKey}, null, 0, output.contracts['test.sol']['SimpleMappingState'].evm.bytecode.object, function (error, txHash) {
if (error) { if (error) {

@ -23,7 +23,7 @@ tape('solidity', function (t) {
function testIntStorage (st, cb) { function testIntStorage (st, cb) {
var intStorage = require('./contracts/intStorage') var intStorage = require('./contracts/intStorage')
var output = compiler.compileStandardWrapper(compilerInput(intStorage.contract)) var output = compiler.compile(compilerInput(intStorage.contract))
output = JSON.parse(output) output = JSON.parse(output)
var mockStorageResolver var mockStorageResolver
for (var storage of [intStorage.fullStorage, shrinkStorage(intStorage.fullStorage)]) { for (var storage of [intStorage.fullStorage, shrinkStorage(intStorage.fullStorage)]) {
@ -70,7 +70,7 @@ function testIntStorage (st, cb) {
function testByteStorage (st, cb) { function testByteStorage (st, cb) {
var byteStorage = require('./contracts/byteStorage') var byteStorage = require('./contracts/byteStorage')
var output = compiler.compileStandardWrapper(compilerInput(byteStorage.contract)) var output = compiler.compile(compilerInput(byteStorage.contract))
output = JSON.parse(output) output = JSON.parse(output)
var mockStorageResolver var mockStorageResolver
for (var storage of [byteStorage.storage, shrinkStorage(byteStorage.storage)]) { for (var storage of [byteStorage.storage, shrinkStorage(byteStorage.storage)]) {
@ -183,7 +183,7 @@ function shrinkStorage (storage) {
function testStructArrayStorage (st, cb) { function testStructArrayStorage (st, cb) {
var structArrayStorage = require('./contracts/structArrayStorage') var structArrayStorage = require('./contracts/structArrayStorage')
var output = compiler.compileStandardWrapper(compilerInput(structArrayStorage.contract)) var output = compiler.compile(compilerInput(structArrayStorage.contract))
output = JSON.parse(output) output = JSON.parse(output)
var mockStorageResolver = new MockStorageResolver(structArrayStorage.storage) var mockStorageResolver = new MockStorageResolver(structArrayStorage.storage)
stateDecoder.solidityState(mockStorageResolver, output.sources, 'structArrayStorage').then((decoded) => { stateDecoder.solidityState(mockStorageResolver, output.sources, 'structArrayStorage').then((decoded) => {

@ -8,7 +8,7 @@ var compilerInput = remixLib.helpers.compiler.compilerInput
tape('solidity', function (t) { tape('solidity', function (t) {
t.test('storage location', function (st) { t.test('storage location', function (st) {
var output = compiler.compileStandardWrapper(compilerInput(contracts)) var output = compiler.compile(compilerInput(contracts))
output = JSON.parse(output) output = JSON.parse(output)
var stateDec = stateDecoder.extractStateVariables('contractUint', output.sources) var stateDec = stateDecoder.extractStateVariables('contractUint', output.sources)
checkLocation(st, stateDec[0].storagelocation, 0, 0) checkLocation(st, stateDec[0].storagelocation, 0, 0)

@ -17,7 +17,7 @@ tape('debug contract', function (t) {
t.plan(12) t.plan(12)
var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex')
var vm = vmCall.initVM(t, privateKey) var vm = vmCall.initVM(t, privateKey)
var output = compiler.compileStandardWrapper(compilerInput(ballot)) var output = compiler.compile(compilerInput(ballot))
output = JSON.parse(output) output = JSON.parse(output)
var web3VM = new remixLib.vm.Web3VMProvider() var web3VM = new remixLib.vm.Web3VMProvider()
web3VM.setVM(vm) web3VM.setVM(vm)

@ -7,7 +7,7 @@ var compilerInput = require('../src/helpers/compilerHelper').compilerInput
tape('SourceMappingDecoder', function (t) { tape('SourceMappingDecoder', function (t) {
t.test('SourceMappingDecoder.findNodeAtInstructionIndex', function (st) { t.test('SourceMappingDecoder.findNodeAtInstructionIndex', function (st) {
var output = compiler.compileStandardWrapper(compilerInput(contracts)) var output = compiler.compile(compilerInput(contracts))
output = JSON.parse(output) output = JSON.parse(output)
var sourceMappingDecoder = new SourceMappingDecoder() var sourceMappingDecoder = new SourceMappingDecoder()
var node = sourceMappingDecoder.findNodeAtInstructionIndex('FunctionDefinition', 2, output.contracts['test.sol']['test'].evm.deployedBytecode.sourceMap, output.sources['test.sol']) var node = sourceMappingDecoder.findNodeAtInstructionIndex('FunctionDefinition', 2, output.contracts['test.sol']['test'].evm.deployedBytecode.sourceMap, output.sources['test.sol'])

@ -11,7 +11,7 @@ var executionContext = require('../src/execution/execution-context')
var context var context
tape('ContractParameters - (TxFormat.buildData) - format input parameters', function (t) { 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) output = JSON.parse(output)
var contract = output.contracts['test.sol']['uintContractTest'] var contract = output.contracts['test.sol']['uintContractTest']
context = { output, contract } context = { output, contract }
@ -37,7 +37,7 @@ function testWithInput (st, params, expected) {
tape('ContractParameters - (TxFormat.buildData) - link Libraries', function (t) { tape('ContractParameters - (TxFormat.buildData) - link Libraries', function (t) {
executionContext.setContext('vm') executionContext.setContext('vm')
var compileData = compiler.compileStandardWrapper(compilerInput(deploySimpleLib)) var compileData = compiler.compile(compilerInput(deploySimpleLib))
var fakeDeployedContracts = { var fakeDeployedContracts = {
lib1: '0xf7a10e525d4b168f45f74db1b61f63d3e7619e11', lib1: '0xf7a10e525d4b168f45f74db1b61f63d3e7619e11',
@ -140,7 +140,7 @@ tape('EncodeParameter', function (t) {
}) })
function encodeFunctionCallTest (st) { function encodeFunctionCallTest (st) {
var output = compiler.compileStandardWrapper(compilerInput(encodeFunctionCall)) var output = compiler.compile(compilerInput(encodeFunctionCall))
output = JSON.parse(output) output = JSON.parse(output)
var contract = output.contracts['test.sol']['testContractLinkLibrary'] var contract = output.contracts['test.sol']['testContractLinkLibrary']
txFormat.encodeFunctionCall('123, "test string"', contract.abi[0], (error, encoded) => { txFormat.encodeFunctionCall('123, "test string"', contract.abi[0], (error, encoded) => {
@ -154,7 +154,7 @@ function encodeFunctionCallTest (st) {
tape('test fallback function', function (t) { tape('test fallback function', function (t) {
t.test('(fallback)', function (st) { t.test('(fallback)', function (st) {
st.plan(2) st.plan(2)
var output = compiler.compileStandardWrapper(compilerInput(fallbackFunction)) var output = compiler.compile(compilerInput(fallbackFunction))
output = JSON.parse(output) output = JSON.parse(output)
var contract = output.contracts['test.sol']['fallbackFunctionContract'] var contract = output.contracts['test.sol']['fallbackFunctionContract']
st.equal(txHelper.encodeFunctionId(contract.abi[0]), '0x805da4ad') st.equal(txHelper.encodeFunctionId(contract.abi[0]), '0x805da4ad')
@ -171,7 +171,7 @@ tape('test abiEncoderV2', function (t) {
var decodedData = `[${value1}, ${value2}, "${value3}"], 23` var decodedData = `[${value1}, ${value2}, "${value3}"], 23`
t.test('(abiEncoderV2)', function (st) { t.test('(abiEncoderV2)', function (st) {
st.plan(2) st.plan(2)
var output = compiler.compileStandardWrapper(compilerInput(abiEncoderV2)) var output = compiler.compile(compilerInput(abiEncoderV2))
output = JSON.parse(output) output = JSON.parse(output)
var contract = output.contracts['test.sol']['test'] var contract = output.contracts['test.sol']['test']
txFormat.encodeFunctionCall(decodedData, contract.abi[0], (error, encoded) => { txFormat.encodeFunctionCall(decodedData, contract.abi[0], (error, encoded) => {
@ -194,7 +194,7 @@ tape('test abiEncoderV2 array of tuple', function (t) {
*/ */
st.plan(2) st.plan(2)
var output = compiler.compileStandardWrapper(compilerInput(abiEncoderV2ArrayOfTuple)) var output = compiler.compile(compilerInput(abiEncoderV2ArrayOfTuple))
output = JSON.parse(output) output = JSON.parse(output)
var contract = output.contracts['test.sol']['test'] var contract = output.contracts['test.sol']['test']
txFormat.encodeParams('[34, "test"]', contract.abi[0], (error, encoded) => { txFormat.encodeParams('[34, "test"]', contract.abi[0], (error, encoded) => {

@ -22,7 +22,7 @@ module.exports = function (self) {
compileJSON = function (input) { compileJSON = function (input) {
try { try {
return compiler.compileStandardWrapper(input, function (path) { return compiler.compile(input, function (path) {
missingInputs.push(path) missingInputs.push(path)
return { 'error': 'Deferred import' } return { 'error': 'Deferred import' }
}) })

@ -90,7 +90,7 @@ function Compiler (handleImportCall) {
var result var result
try { try {
var input = compilerInput(source.sources, {optimize: optimize, target: source.target}) var input = compilerInput(source.sources, {optimize: optimize, target: source.target})
result = compiler.compileStandardWrapper(input, missingInputsCallback) result = compiler.compile(input, missingInputsCallback)
result = JSON.parse(result) result = JSON.parse(result)
} catch (exception) { } catch (exception) {
result = { error: { formattedMessage: 'Uncaught JavaScript exception:\n' + exception, severity: 'error', mode: 'panic' } } result = { error: { formattedMessage: 'Uncaught JavaScript exception:\n' + exception, severity: 'error', mode: 'panic' } }

Loading…
Cancel
Save