From fcc623bf2b852f3f507b0f3e3dd1238494416a35 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Wed, 14 Nov 2018 17:22:32 +0100 Subject: [PATCH 01/20] renamed solc.compileStandardWrapper to solc.compile --- .../test/analysis/staticAnalysisIntegration-test.js | 2 +- .../test/analysis/staticAnalysisIssues-test.js | 2 +- remix-debug/test/decoder/decodeInfo.js | 4 ++-- remix-debug/test/decoder/localDecoder.js | 8 ++++---- remix-debug/test/decoder/stateTests/mapping.js | 2 +- remix-debug/test/decoder/storageDecoder.js | 6 +++--- remix-debug/test/decoder/storageLocation.js | 2 +- remix-debug/test/tests.js | 2 +- remix-lib/test/sourceMappingDecoder.js | 2 +- remix-lib/test/txFormat.js | 12 ++++++------ remix-solidity/src/compiler/compiler-worker.js | 2 +- remix-solidity/src/compiler/compiler.js | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) 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' } } From 339f3ad54c9e3dba36ae208cb8642d521b40f810 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 15 Nov 2018 08:49:15 +0100 Subject: [PATCH 02/20] constant -> view --- remix-tests/examples/simple_storage2_test.sol | 4 ++-- remix-tests/sol/tests.sol.js | 16 ++++++++-------- .../tests/examples_1/simple_storage_test.sol | 4 ++-- .../tests/examples_2/simple_storage_test.sol | 4 ++-- .../tests/examples_3/simple_string_test.sol | 6 +++--- remix-tests/tests/examples_4/SafeMath_test.sol | 8 ++++---- remix-tests/tests/number/number_test.sol | 16 ++++++++-------- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/remix-tests/examples/simple_storage2_test.sol b/remix-tests/examples/simple_storage2_test.sol index 6c7f953738..d07fa73cfa 100644 --- a/remix-tests/examples/simple_storage2_test.sol +++ b/remix-tests/examples/simple_storage2_test.sol @@ -17,11 +17,11 @@ contract MyTest2 { i += 1; } - function initialValueShouldBe100() public constant returns (bool) { + function initialValueShouldBe100() public view returns (bool) { return Assert.equal(foo.get(), 100, "initial value is not correct"); } - function initialValueShouldBe200() public constant returns (bool) { + function initialValueShouldBe200() public view returns (bool) { return Assert.equal(foo.get(), 200, "initial value is not correct"); } diff --git a/remix-tests/sol/tests.sol.js b/remix-tests/sol/tests.sol.js index ac0c98978a..4a7d2428a1 100644 --- a/remix-tests/sol/tests.sol.js +++ b/remix-tests/sol/tests.sol.js @@ -98,17 +98,17 @@ library Assert { } /*----------------- Greater than --------------------*/ - function greaterThan(uint a, uint b, string message) public constant returns (bool result) { + function greaterThan(uint a, uint b, string message) public view returns (bool result) { result = (a > b); emit AssertionEvent(result, message); } - function greaterThan(int a, int b, string message) public constant returns (bool result) { + function greaterThan(int a, int b, string message) public view returns (bool result) { result = (a > b); emit AssertionEvent(result, message); } // TODO: safely compare between uint and int - function greaterThan(uint a, int b, string message) public constant returns (bool result) { + function greaterThan(uint a, int b, string message) public view returns (bool result) { if(b < int(0)) { // int is negative uint "a" always greater result = true; @@ -117,7 +117,7 @@ library Assert { } emit AssertionEvent(result, message); } - function greaterThan(int a, uint b, string message) public constant returns (bool result) { + function greaterThan(int a, uint b, string message) public view returns (bool result) { if(a < int(0)) { // int is negative uint "b" always greater result = false; @@ -127,17 +127,17 @@ library Assert { emit AssertionEvent(result, message); } /*----------------- Lesser than --------------------*/ - function lesserThan(uint a, uint b, string message) public constant returns (bool result) { + function lesserThan(uint a, uint b, string message) public view returns (bool result) { result = (a < b); emit AssertionEvent(result, message); } - function lesserThan(int a, int b, string message) public constant returns (bool result) { + function lesserThan(int a, int b, string message) public view returns (bool result) { result = (a < b); emit AssertionEvent(result, message); } // TODO: safely compare between uint and int - function lesserThan(uint a, int b, string message) public constant returns (bool result) { + function lesserThan(uint a, int b, string message) public view returns (bool result) { if(b < int(0)) { // int is negative int "b" always lesser result = false; @@ -147,7 +147,7 @@ library Assert { emit AssertionEvent(result, message); } - function lesserThan(int a, uint b, string message) public constant returns (bool result) { + function lesserThan(int a, uint b, string message) public view returns (bool result) { if(a < int(0)) { // int is negative int "a" always lesser result = true; diff --git a/remix-tests/tests/examples_1/simple_storage_test.sol b/remix-tests/tests/examples_1/simple_storage_test.sol index 6c4b35942f..f5f6da99d2 100644 --- a/remix-tests/tests/examples_1/simple_storage_test.sol +++ b/remix-tests/tests/examples_1/simple_storage_test.sol @@ -8,12 +8,12 @@ contract MyTest { foo = new SimpleStorage(); } - function initialValueShouldBe100() public constant returns (bool) { + function initialValueShouldBe100() public view returns (bool) { //return Assert.equal(foo.get(), 100, "initial value is not correct"); return foo.get() == 100; } - function initialValueShouldBe200() public constant returns (bool) { + function initialValueShouldBe200() public view returns (bool) { //return Assert.equal(foo.get(), 200, "initial value is not correct"); return foo.get() == 200; } diff --git a/remix-tests/tests/examples_2/simple_storage_test.sol b/remix-tests/tests/examples_2/simple_storage_test.sol index b794095f5c..ca7d348f11 100644 --- a/remix-tests/tests/examples_2/simple_storage_test.sol +++ b/remix-tests/tests/examples_2/simple_storage_test.sol @@ -13,12 +13,12 @@ contract MyTest { i += 1; } - function initialValueShouldBe100() public constant returns (bool) { + function initialValueShouldBe100() public view returns (bool) { //return Assert.equal(foo.get(), 100, "initial value is not correct"); return foo.get() == 100; } - function initialValueShouldBe200() public constant returns (bool) { + function initialValueShouldBe200() public view returns (bool) { //return Assert.equal(foo.get(), 200, "initial value is not correct"); return foo.get() == 200; } diff --git a/remix-tests/tests/examples_3/simple_string_test.sol b/remix-tests/tests/examples_3/simple_string_test.sol index 918c97c88e..a24ebb2599 100644 --- a/remix-tests/tests/examples_3/simple_string_test.sol +++ b/remix-tests/tests/examples_3/simple_string_test.sol @@ -8,15 +8,15 @@ contract StringTest { foo = new SimpleString(); } - function initialValueShouldBeHello() public constant returns (bool) { + function initialValueShouldBeHello() public view returns (bool) { return Assert.equal(foo.get(), "Hello world!", "initial value is not correct"); } - function valueShouldNotBeHelloWorld() public constant returns (bool) { + function valueShouldNotBeHelloWorld() public viewview returns (bool) { return Assert.notEqual(foo.get(), "Hello wordl!", "initial value is not correct"); } - function valueShouldBeHelloWorld() public constant returns (bool) { + function valueShouldBeHelloWorld() public view returns (bool) { return Assert.equal(foo.get(), "Hello wordl!", "initial value is not correct"); } } diff --git a/remix-tests/tests/examples_4/SafeMath_test.sol b/remix-tests/tests/examples_4/SafeMath_test.sol index 4259e847a3..bf4534c913 100644 --- a/remix-tests/tests/examples_4/SafeMath_test.sol +++ b/remix-tests/tests/examples_4/SafeMath_test.sol @@ -10,7 +10,7 @@ contract SafeMathTest { safemathproxy = new SafeMathProxy(); } - function unsafeMultiplicationShouldOverflow() public constant returns (bool) { + function unsafeMultiplicationShouldOverflow() public view returns (bool) { uint256 a = 4; uint256 b = 2 ** 256 - 1; return Assert.equal( @@ -20,7 +20,7 @@ contract SafeMathTest { ); } - function safeMultiplicationShouldRevert() public constant returns (bool) { + function safeMultiplicationShouldRevert() public view returns (bool) { uint256 a = 4; uint256 b = 2 ** 256 - 1; return Assert.equal( @@ -30,7 +30,7 @@ contract SafeMathTest { ); } - function safeDivisionByZeroShouldRevert() public constant returns (bool) { + function safeDivisionByZeroShouldRevert() public view returns (bool) { uint256 a = 4; uint256 b = 0; return Assert.equal( @@ -40,7 +40,7 @@ contract SafeMathTest { ); } - function unsafeSubtractShouldUnderflow() public constant returns (bool) { + function unsafeSubtractShouldUnderflow() public view returns (bool) { uint256 a = 0; uint256 b = a - 1; return Assert.equal( diff --git a/remix-tests/tests/number/number_test.sol b/remix-tests/tests/number/number_test.sol index 9098490215..cc097d2436 100644 --- a/remix-tests/tests/number/number_test.sol +++ b/remix-tests/tests/number/number_test.sol @@ -3,36 +3,36 @@ pragma solidity ^0.4.24; contract IntegerTest { // GREATER THAN [>] tests - function _2_shouldBeGreaterThan_1() public constant returns (bool) { + function _2_shouldBeGreaterThan_1() public view returns (bool) { return Assert.greaterThan(uint(2), uint(1), "2 is greater than 1"); } - function _0_shouldBeGreaterThan_neg_1() public constant returns (bool) { + function _0_shouldBeGreaterThan_neg_1() public view returns (bool) { return Assert.greaterThan(uint(0), int(-1), "0 is greater than -1"); } - function _neg_1_shouldNotBeGreaterThan_1() public constant returns (bool) { + function _neg_1_shouldNotBeGreaterThan_1() public view returns (bool) { return Assert.greaterThan(int(-1), uint(1), "-1 is not greater than 1"); } - function _1_shouldBeGreaterThan_neg_1() public constant returns (bool) { + function _1_shouldBeGreaterThan_neg_1() public view returns (bool) { return Assert.greaterThan(uint(1), int(-1), "1 is greater than -1"); } // LESSER THAN [<] tests - function _1_shouldBeLesserThan_2() public constant returns (bool) { + function _1_shouldBeLesserThan_2() public view returns (bool) { return Assert.lesserThan(uint(1), uint(2), "1 is lesser than 2"); } - function _neg_1_shouldBeLesserThan_0() public constant returns (bool) { + function _neg_1_shouldBeLesserThan_0() public view returns (bool) { return Assert.lesserThan(int(-1), uint(0), "-1 is lesser than 0"); } - function _neg_2_shouldBeLesserThan_neg_1() public constant returns (bool) { + function _neg_2_shouldBeLesserThan_neg_1() public view returns (bool) { return Assert.lesserThan(int(-2), int(-1), "-2 is lesser than -1"); } - function _0_shouldNotBeLesserThan_neg_1() public constant returns (bool) { + function _0_shouldNotBeLesserThan_neg_1() public view returns (bool) { return Assert.lesserThan(uint(0), int(-1), "0 is not lesser than -1"); } } From 00408be9b4fad471dd58cf85a7b47e08147848c2 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 15 Nov 2018 08:58:30 +0100 Subject: [PATCH 03/20] syntax fix - constructor identifier --- remix-tests/examples/simple_storage.sol | 2 +- remix-tests/tests/examples_1/simple_storage.sol | 2 +- remix-tests/tests/examples_2/simple_storage.sol | 2 +- remix-tests/tests/examples_3/simple_string.sol | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/remix-tests/examples/simple_storage.sol b/remix-tests/examples/simple_storage.sol index 4f8a84a5b1..b7513c34c6 100644 --- a/remix-tests/examples/simple_storage.sol +++ b/remix-tests/examples/simple_storage.sol @@ -2,7 +2,7 @@ pragma solidity ^0.4.7; contract SimpleStorage { uint public storedData; - function SimpleStorage() public { + constructor() public { storedData = 100; } diff --git a/remix-tests/tests/examples_1/simple_storage.sol b/remix-tests/tests/examples_1/simple_storage.sol index 4f8a84a5b1..b7513c34c6 100644 --- a/remix-tests/tests/examples_1/simple_storage.sol +++ b/remix-tests/tests/examples_1/simple_storage.sol @@ -2,7 +2,7 @@ pragma solidity ^0.4.7; contract SimpleStorage { uint public storedData; - function SimpleStorage() public { + constructor() public { storedData = 100; } diff --git a/remix-tests/tests/examples_2/simple_storage.sol b/remix-tests/tests/examples_2/simple_storage.sol index 4f8a84a5b1..b7513c34c6 100644 --- a/remix-tests/tests/examples_2/simple_storage.sol +++ b/remix-tests/tests/examples_2/simple_storage.sol @@ -2,7 +2,7 @@ pragma solidity ^0.4.7; contract SimpleStorage { uint public storedData; - function SimpleStorage() public { + constructor() public { storedData = 100; } diff --git a/remix-tests/tests/examples_3/simple_string.sol b/remix-tests/tests/examples_3/simple_string.sol index 25773f148c..7ac5e2e6c3 100644 --- a/remix-tests/tests/examples_3/simple_string.sol +++ b/remix-tests/tests/examples_3/simple_string.sol @@ -2,7 +2,7 @@ pragma solidity ^0.4.7; contract SimpleString { string public storedData; - function SimpleString() public { + constructor() public { storedData = "Hello world!"; } From 97ceaa426d627f3c025262b4e3ac2888cea13ad7 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 15 Nov 2018 11:21:55 +0100 Subject: [PATCH 04/20] - added visibility specifiers - pragma solidity 0.4.* -> 0.5.0 --- remix-tests/examples/simple_storage.sol | 2 +- remix-tests/examples/simple_storage2_test.sol | 10 ++-- remix-tests/examples/simple_storage_test.sol | 10 ++-- remix-tests/sol/tests.sol.js | 60 +++++++++---------- .../tests/examples_1/simple_storage.sol | 2 +- .../tests/examples_1/simple_storage_test.sol | 4 +- .../tests/examples_2/simple_storage.sol | 2 +- .../tests/examples_2/simple_storage_test.sol | 4 +- .../tests/examples_3/simple_string.sol | 4 +- .../tests/examples_3/simple_string_test.sol | 10 ++-- remix-tests/tests/number/number_test.sol | 18 +++--- remix-tests/tests/testRunner.js | 3 +- 12 files changed, 65 insertions(+), 64 deletions(-) diff --git a/remix-tests/examples/simple_storage.sol b/remix-tests/examples/simple_storage.sol index b7513c34c6..bc74b55c00 100644 --- a/remix-tests/examples/simple_storage.sol +++ b/remix-tests/examples/simple_storage.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.7; +pragma solidity ^0.5.0; contract SimpleStorage { uint public storedData; diff --git a/remix-tests/examples/simple_storage2_test.sol b/remix-tests/examples/simple_storage2_test.sol index d07fa73cfa..ac6115eba5 100644 --- a/remix-tests/examples/simple_storage2_test.sol +++ b/remix-tests/examples/simple_storage2_test.sol @@ -1,16 +1,16 @@ -pragma solidity ^0.4.7; +ppragma solidity ^0.5.0; import "remix_tests.sol"; import "./simple_storage.sol"; contract MyTest2 { - SimpleStorage foo; - uint i = 0; + SimpleStorage storage foo; + uint storage i = 0; - function beforeAll() { + function beforeAll() public { foo = new SimpleStorage(); } - function beforeEach() { + function beforeEach() public { if (i == 1) { foo.set(200); } diff --git a/remix-tests/examples/simple_storage_test.sol b/remix-tests/examples/simple_storage_test.sol index 09392087e3..3fe9dd08cd 100644 --- a/remix-tests/examples/simple_storage_test.sol +++ b/remix-tests/examples/simple_storage_test.sol @@ -1,15 +1,15 @@ -pragma solidity ^0.4.7; +pragma solidity ^0.5.0; import "./simple_storage.sol"; contract MyTest { - SimpleStorage foo; - uint i = 0; + SimpleStorage storage foo; + uint storage i = 0; - function beforeAll() { + function beforeAll() public { foo = new SimpleStorage(); } - function beforeEach() { + function beforeEach() public { if (i == 1) { foo.set(200); } diff --git a/remix-tests/sol/tests.sol.js b/remix-tests/sol/tests.sol.js index 4a7d2428a1..0fd3e5b35d 100644 --- a/remix-tests/sol/tests.sol.js +++ b/remix-tests/sol/tests.sol.js @@ -1,5 +1,5 @@ module.exports = ` -pragma solidity ^0.4.7; +pragma solidity ^0.5.0; library Assert { @@ -8,107 +8,107 @@ library Assert { string message ); - function ok(bool a, string message) public returns (bool result) { + function ok(bool a, string memory message) public returns (bool result) { result = a; emit AssertionEvent(result, message); } - function equal(uint a, uint b, string message) public returns (bool result) { + function equal(uint a, uint b, string memory message) public returns (bool result) { result = (a == b); emit AssertionEvent(result, message); } - function equal(int a, int b, string message) public returns (bool result) { + function equal(int a, int b, string memory message) public returns (bool result) { result = (a == b); emit AssertionEvent(result, message); } - function equal(bool a, bool b, string message) public returns (bool result) { + function equal(bool a, bool b, string memory message) public returns (bool result) { result = (a == b); emit AssertionEvent(result, message); } // TODO: only for certain versions of solc - //function equal(fixed a, fixed b, string message) public returns (bool result) { + //function equal(fixed a, fixed b, string memory message) public returns (bool result) { // result = (a == b); // emit AssertionEvent(result, message); //} // TODO: only for certain versions of solc - //function equal(ufixed a, ufixed b, string message) public returns (bool result) { + //function equal(ufixed a, ufixed b, string memory message) public returns (bool result) { // result = (a == b); // emit AssertionEvent(result, message); //} - function equal(address a, address b, string message) public returns (bool result) { + function equal(address a, address b, string memory message) public returns (bool result) { result = (a == b); emit AssertionEvent(result, message); } - function equal(bytes32 a, bytes32 b, string message) public returns (bool result) { + function equal(bytes32 a, bytes32 b, string memory message) public returns (bool result) { result = (a == b); emit AssertionEvent(result, message); } - function equal(string a, string b, string message) public returns (bool result) { - result = (keccak256(a) == keccak256(b)); - AssertionEvent(result, message); + function equal(string memory a, string memory b, string memory message) public returns (bool result) { + result = (keccak256(abi.encode(a)) == keccak256(abi.encode(b))); + emit AssertionEvent(result, message); } - function notEqual(uint a, uint b, string message) public returns (bool result) { + function notEqual(uint a, uint b, string memory message) public returns (bool result) { result = (a != b); emit AssertionEvent(result, message); } - function notEqual(int a, int b, string message) public returns (bool result) { + function notEqual(int a, int b, string memory message) public returns (bool result) { result = (a != b); emit AssertionEvent(result, message); } - function notEqual(bool a, bool b, string message) public returns (bool result) { + function notEqual(bool a, bool b, string memory message) public returns (bool result) { result = (a != b); emit AssertionEvent(result, message); } // TODO: only for certain versions of solc - //function notEqual(fixed a, fixed b, string message) public returns (bool result) { + //function notEqual(fixed a, fixed b, string memory message) public returns (bool result) { // result = (a != b); // emit AssertionEvent(result, message); //} // TODO: only for certain versions of solc - //function notEqual(ufixed a, ufixed b, string message) public returns (bool result) { + //function notEqual(ufixed a, ufixed b, string memory message) public returns (bool result) { // result = (a != b); // emit AssertionEvent(result, message); //} - function notEqual(address a, address b, string message) public returns (bool result) { + function notEqual(address a, address b, string memory message) public returns (bool result) { result = (a != b); emit AssertionEvent(result, message); } - function notEqual(bytes32 a, bytes32 b, string message) public returns (bool result) { + function notEqual(bytes32 a, bytes32 b, string memory message) public returns (bool result) { result = (a != b); emit AssertionEvent(result, message); } - function notEqual(string a, string b, string message) public returns (bool result) { - result = (keccak256(a) != keccak256(b)); - AssertionEvent(result, message); + function notEqual(string memory a, string memory b, string memory message) public returns (bool result) { + result = (keccak256(abi.encode(a)) != keccak256(abi.encode(b))); + emit AssertionEvent(result, message); } /*----------------- Greater than --------------------*/ - function greaterThan(uint a, uint b, string message) public view returns (bool result) { + function greaterThan(uint a, uint b, string memory message) public returns (bool result) { result = (a > b); emit AssertionEvent(result, message); } - function greaterThan(int a, int b, string message) public view returns (bool result) { + function greaterThan(int a, int b, string memory message) public returns (bool result) { result = (a > b); emit AssertionEvent(result, message); } // TODO: safely compare between uint and int - function greaterThan(uint a, int b, string message) public view returns (bool result) { + function greaterThan(uint a, int b, string memory message) public returns (bool result) { if(b < int(0)) { // int is negative uint "a" always greater result = true; @@ -117,7 +117,7 @@ library Assert { } emit AssertionEvent(result, message); } - function greaterThan(int a, uint b, string message) public view returns (bool result) { + function greaterThan(int a, uint b, string memory message) public returns (bool result) { if(a < int(0)) { // int is negative uint "b" always greater result = false; @@ -127,17 +127,17 @@ library Assert { emit AssertionEvent(result, message); } /*----------------- Lesser than --------------------*/ - function lesserThan(uint a, uint b, string message) public view returns (bool result) { + function lesserThan(uint a, uint b, string memory message) public returns (bool result) { result = (a < b); emit AssertionEvent(result, message); } - function lesserThan(int a, int b, string message) public view returns (bool result) { + function lesserThan(int a, int b, string memory message) public returns (bool result) { result = (a < b); emit AssertionEvent(result, message); } // TODO: safely compare between uint and int - function lesserThan(uint a, int b, string message) public view returns (bool result) { + function lesserThan(uint a, int b, string memory message) public returns (bool result) { if(b < int(0)) { // int is negative int "b" always lesser result = false; @@ -147,7 +147,7 @@ library Assert { emit AssertionEvent(result, message); } - function lesserThan(int a, uint b, string message) public view returns (bool result) { + function lesserThan(int a, uint b, string memory message) public returns (bool result) { if(a < int(0)) { // int is negative int "a" always lesser result = true; diff --git a/remix-tests/tests/examples_1/simple_storage.sol b/remix-tests/tests/examples_1/simple_storage.sol index b7513c34c6..bc74b55c00 100644 --- a/remix-tests/tests/examples_1/simple_storage.sol +++ b/remix-tests/tests/examples_1/simple_storage.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.7; +pragma solidity ^0.5.0; contract SimpleStorage { uint public storedData; diff --git a/remix-tests/tests/examples_1/simple_storage_test.sol b/remix-tests/tests/examples_1/simple_storage_test.sol index f5f6da99d2..35063a4179 100644 --- a/remix-tests/tests/examples_1/simple_storage_test.sol +++ b/remix-tests/tests/examples_1/simple_storage_test.sol @@ -1,10 +1,10 @@ -pragma solidity ^0.4.7; +pragma solidity ^0.5.0; import "./simple_storage.sol"; contract MyTest { SimpleStorage foo; - function beforeAll() { + function beforeAll() public { foo = new SimpleStorage(); } diff --git a/remix-tests/tests/examples_2/simple_storage.sol b/remix-tests/tests/examples_2/simple_storage.sol index b7513c34c6..bc74b55c00 100644 --- a/remix-tests/tests/examples_2/simple_storage.sol +++ b/remix-tests/tests/examples_2/simple_storage.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.7; +pragma solidity ^0.5.0; contract SimpleStorage { uint public storedData; diff --git a/remix-tests/tests/examples_2/simple_storage_test.sol b/remix-tests/tests/examples_2/simple_storage_test.sol index ca7d348f11..be7afd8545 100644 --- a/remix-tests/tests/examples_2/simple_storage_test.sol +++ b/remix-tests/tests/examples_2/simple_storage_test.sol @@ -1,11 +1,11 @@ -pragma solidity ^0.4.7; +pragma solidity ^0.5.0; import "./simple_storage.sol"; contract MyTest { SimpleStorage foo; uint i = 0; - function beforeEach() { + function beforeEach() public { foo = new SimpleStorage(); if (i == 1) { foo.set(200); diff --git a/remix-tests/tests/examples_3/simple_string.sol b/remix-tests/tests/examples_3/simple_string.sol index 7ac5e2e6c3..b031a5e69f 100644 --- a/remix-tests/tests/examples_3/simple_string.sol +++ b/remix-tests/tests/examples_3/simple_string.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.7; +pragma solidity ^0.5.0; contract SimpleString { string public storedData; @@ -6,7 +6,7 @@ contract SimpleString { storedData = "Hello world!"; } - function get() public view returns (string retVal) { + function get() public view returns (string memory retVal) { return storedData; } } diff --git a/remix-tests/tests/examples_3/simple_string_test.sol b/remix-tests/tests/examples_3/simple_string_test.sol index a24ebb2599..9bcc562167 100644 --- a/remix-tests/tests/examples_3/simple_string_test.sol +++ b/remix-tests/tests/examples_3/simple_string_test.sol @@ -1,22 +1,22 @@ -pragma solidity ^0.4.7; +pragma solidity ^0.5.0; import "./simple_string.sol"; contract StringTest { SimpleString foo; - function beforeAll() { + function beforeAll() public { foo = new SimpleString(); } - function initialValueShouldBeHello() public view returns (bool) { + function initialValueShouldBeHello() public returns (bool) { return Assert.equal(foo.get(), "Hello world!", "initial value is not correct"); } - function valueShouldNotBeHelloWorld() public viewview returns (bool) { + function valueShouldNotBeHelloWorld() public returns (bool) { return Assert.notEqual(foo.get(), "Hello wordl!", "initial value is not correct"); } - function valueShouldBeHelloWorld() public view returns (bool) { + function valueShouldBeHelloWorld() public returns (bool) { return Assert.equal(foo.get(), "Hello wordl!", "initial value is not correct"); } } diff --git a/remix-tests/tests/number/number_test.sol b/remix-tests/tests/number/number_test.sol index cc097d2436..7e232fe630 100644 --- a/remix-tests/tests/number/number_test.sol +++ b/remix-tests/tests/number/number_test.sol @@ -1,38 +1,38 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.0; contract IntegerTest { // GREATER THAN [>] tests - function _2_shouldBeGreaterThan_1() public view returns (bool) { + function _2_shouldBeGreaterThan_1() public returns (bool) { return Assert.greaterThan(uint(2), uint(1), "2 is greater than 1"); } - function _0_shouldBeGreaterThan_neg_1() public view returns (bool) { + function _0_shouldBeGreaterThan_neg_1() public returns (bool) { return Assert.greaterThan(uint(0), int(-1), "0 is greater than -1"); } - function _neg_1_shouldNotBeGreaterThan_1() public view returns (bool) { + function _neg_1_shouldNotBeGreaterThan_1() public returns (bool) { return Assert.greaterThan(int(-1), uint(1), "-1 is not greater than 1"); } - function _1_shouldBeGreaterThan_neg_1() public view returns (bool) { + function _1_shouldBeGreaterThan_neg_1() public returns (bool) { return Assert.greaterThan(uint(1), int(-1), "1 is greater than -1"); } // LESSER THAN [<] tests - function _1_shouldBeLesserThan_2() public view returns (bool) { + function _1_shouldBeLesserThan_2() public returns (bool) { return Assert.lesserThan(uint(1), uint(2), "1 is lesser than 2"); } - function _neg_1_shouldBeLesserThan_0() public view returns (bool) { + function _neg_1_shouldBeLesserThan_0() public returns (bool) { return Assert.lesserThan(int(-1), uint(0), "-1 is lesser than 0"); } - function _neg_2_shouldBeLesserThan_neg_1() public view returns (bool) { + function _neg_2_shouldBeLesserThan_neg_1() public returns (bool) { return Assert.lesserThan(int(-2), int(-1), "-2 is lesser than -1"); } - function _0_shouldNotBeLesserThan_neg_1() public view returns (bool) { + function _0_shouldNotBeLesserThan_neg_1() public returns (bool) { return Assert.lesserThan(uint(0), int(-1), "0 is not lesser than -1"); } } diff --git a/remix-tests/tests/testRunner.js b/remix-tests/tests/testRunner.js index ccdd0c84b7..899ef17b56 100644 --- a/remix-tests/tests/testRunner.js +++ b/remix-tests/tests/testRunner.js @@ -123,9 +123,10 @@ describe('testRunner', function () { }) it('should returns 3 messages', function () { + console.log(tests) assert.deepEqual(tests, [ { type: 'contract', value: 'StringTest', filename: 'simple_string_test.sol' }, - { type: 'testFailure', value: 'Value should be hello world', time: 1, context: 'StringTest', "errMsg": "function returned false" }, + { type: 'testFailure', value: 'Value should be hello world', time: 1, context: 'StringTest', "errMsg": "initial value is not correct" }, { type: 'testPass', value: 'Value should not be hello world', time: 1, context: 'StringTest' }, { type: 'testPass', value: 'Initial value should be hello', time: 1, context: 'StringTest' }, ]) From 08f57e19ff3b9e61892cab3c7082d070c02e16af Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 15 Nov 2018 11:48:33 +0100 Subject: [PATCH 05/20] updated solc version to 0.5.0 --- remix-solidity/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-solidity/package.json b/remix-solidity/package.json index f0a2e4da0c..6199d3cc85 100644 --- a/remix-solidity/package.json +++ b/remix-solidity/package.json @@ -23,7 +23,7 @@ "fast-async": "^6.1.2", "npm-run-all": "^4.0.2", "remix-lib": "^0.3.8", - "solc": "^0.4.24", + "solc": "^0.5.0", "standard": "^7.0.1", "tape": "^4.6.0", "webworkify": "^1.2.1" From d89010ffd397ca72cc39be33099c4c99e1d41c38 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 15 Nov 2018 11:30:41 +0100 Subject: [PATCH 06/20] Update testRunner.js --- remix-tests/tests/testRunner.js | 1 - 1 file changed, 1 deletion(-) diff --git a/remix-tests/tests/testRunner.js b/remix-tests/tests/testRunner.js index 899ef17b56..4f23dfd243 100644 --- a/remix-tests/tests/testRunner.js +++ b/remix-tests/tests/testRunner.js @@ -123,7 +123,6 @@ describe('testRunner', function () { }) it('should returns 3 messages', function () { - console.log(tests) assert.deepEqual(tests, [ { type: 'contract', value: 'StringTest', filename: 'simple_string_test.sol' }, { type: 'testFailure', value: 'Value should be hello world', time: 1, context: 'StringTest', "errMsg": "initial value is not correct" }, From b2b8a0cb11395efa52e4bb4c044271e6eae71afc Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 15 Nov 2018 11:30:41 +0100 Subject: [PATCH 07/20] fixes tests --- remix-lib/package.json | 2 +- remix-lib/test/sourceMappingDecoder.js | 4 +-- remix-lib/test/txFormat.js | 45 +++++++++++++------------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/remix-lib/package.json b/remix-lib/package.json index b4aa95f968..648100b19e 100644 --- a/remix-lib/package.json +++ b/remix-lib/package.json @@ -27,7 +27,7 @@ "ethereumjs-vm": "^2.3.3", "ethers": "^3.0.15", "fast-async": "^6.1.2", - "solc": "^0.4.13", + "solc": "^0.5.0", "standard": "^7.0.1", "tape": "^4.6.0", "web3": "0.20.6" diff --git a/remix-lib/test/sourceMappingDecoder.js b/remix-lib/test/sourceMappingDecoder.js index e7b9a8ea64..5be0348132 100644 --- a/remix-lib/test/sourceMappingDecoder.js +++ b/remix-lib/test/sourceMappingDecoder.js @@ -107,12 +107,12 @@ tape('SourceMappingDecoder', function (t) { }) var contracts = `contract test { - function f1() returns (uint) { + function f1() public returns (uint) { uint t = 4; return t; } - function f2() { + function f2() public { } } diff --git a/remix-lib/test/txFormat.js b/remix-lib/test/txFormat.js index 0dabd5f34e..c8192ed80b 100644 --- a/remix-lib/test/txFormat.js +++ b/remix-lib/test/txFormat.js @@ -15,7 +15,7 @@ tape('ContractParameters - (TxFormat.buildData) - format input parameters', func output = JSON.parse(output) var contract = output.contracts['test.sol']['uintContractTest'] context = { output, contract } - var bytecode = '608060405234801561001057600080fd5b50610111806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634b521953146044575b600080fd5b348015604f57600080fd5b50609660048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506098565b005b8260008190555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505600a165627a7a7230582028c4b7d4bd450fb198ccfdf15510df1721e4f8abda2487d4b452c533bed8880b0029' + var bytecode = '608060405234801561001057600080fd5b5061011e806100206000396000f3fe608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634b521953146044575b600080fd5b348015604f57600080fd5b5060a360048036036060811015606457600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505060a5565b005b8260008190555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505056fea165627a7a7230582053a6bee96a62b9079722b2a0004a405aa29803abc12ed6dd0322007ebb44a5f60029' t.test('(TxFormat.buildData)', function (st) { st.plan(3) testWithInput(st, '123123, "0xf7a10e525d4b168f45f74db1b61f63d3e7619ea8", "34"', bytecode + '000000000000000000000000000000000000000000000000000000000001e0f3000000000000000000000000f7a10e525d4b168f45f74db1b61f63d3e7619ea80000000000000000000000000000000000000000000000000000000000000022') @@ -29,7 +29,7 @@ function testWithInput (st, params, expected) { txFormat.buildData('uintContractTest', context.contract, context.output.contracts, true, context.contract.abi[0], params, (error, data) => { if (error) { return st.fails(error) } console.log(data) - st.equal(data.dataHex, expected) + st.equal(expected, data.dataHex) }, () => {}, () => {}) } @@ -96,7 +96,8 @@ function testLinkLibrary2 (st, callbackDeployLibraries) { 'lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2': '0xf7a10e525d4b168f45f74db1b61f63d3e7619e33' } } - var data = '608060405234801561001057600080fd5b5061026b806100206000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680636d4ce63c14610046575b600080fd5b34801561005257600080fd5b5061005b61005d565b005b73f7a10e525d4b168f45f74db1b61f63d3e7619e116344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b1580156100bd57600080fd5b505af41580156100d1573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e336344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b15801561013557600080fd5b505af4158015610149573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e336344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b1580156101ad57600080fd5b505af41580156101c1573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e116344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b15801561022557600080fd5b505af4158015610239573d6000803e3d6000fd5b505050505600a165627a7a7230582007a22a440570c53944d704e68b3fd4ba3ba4a0fba71c4abd66b195d87f065bcd0029' + + var data = '608060405234801561001057600080fd5b5061026b806100206000396000f3fe608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680636d4ce63c14610046575b600080fd5b34801561005257600080fd5b5061005b61005d565b005b73f7a10e525d4b168f45f74db1b61f63d3e7619e116344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b1580156100bd57600080fd5b505af41580156100d1573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e336344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b15801561013557600080fd5b505af4158015610149573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e336344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b1580156101ad57600080fd5b505af41580156101c1573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e116344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b15801561022557600080fd5b505af4158015610239573d6000803e3d6000fd5b5050505056fea165627a7a72305820d2fdcf2968ba13c89dd82748af1cac609a670e333fce635bc2212c2a50508be70029' var deployMsg = ['creation of library test.sol:lib1 pending...', 'creation of library test.sol:lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2 pending...'] @@ -216,26 +217,26 @@ tape('test abiEncoderV2 array of tuple', function (t) { var uintContract = `contract uintContractTest { uint _tp; address _ap; - function test(uint _t, address _a, uint _i) { + function test(uint _t, address _a, uint _i) public { _tp = _t; _ap = _a; } }` -var deploySimpleLib = `pragma solidity ^0.4.4; +var deploySimpleLib = `pragma solidity ^0.5.0; library lib1 { - function getEmpty () { + function getEmpty () public { } } library lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2 { - function getEmpty () { + function getEmpty () public { } } contract testContractLinkLibrary { - function get () { + function get () public { lib1.getEmpty(); lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2.getEmpty(); lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2.getEmpty(); @@ -243,22 +244,20 @@ contract testContractLinkLibrary { } }` -var encodeFunctionCall = `pragma solidity ^0.4.4; +var encodeFunctionCall = `pragma solidity ^0.5.0; contract testContractLinkLibrary { - function get (uint _p, string _o) { - - } + function get (uint _p, string memory _o) public { + } }` -var fallbackFunction = `pragma solidity ^0.4.4; +var fallbackFunction = `pragma solidity ^0.5.0; contract fallbackFunctionContract { - function get (uint _p, string _o) { - + function get (uint _p, string memory _o) public { } - function () {} + function () external {} }` var abiEncoderV2 = `pragma experimental ABIEncoderV2; @@ -269,12 +268,12 @@ contract test { uint b; string s; } - function t (p _p, uint _i) returns (p) { + function t (p memory _p, uint _i) public returns (p memory) { return _p; } - function t () returns (p) { - p mm; + function t () public returns (p memory) { + p memory mm; mm.a = 123; mm.b = 133; return mm; @@ -284,17 +283,17 @@ contract test { var abiEncoderV2ArrayOfTuple = `pragma experimental ABIEncoderV2; contract test { - struct MyStruct {uint256 num; string _string;} + struct MyStruct {uint256 num; string _string;} - constructor (MyStruct[] _structs, string _str) { + constructor (MyStruct[] memory _structs, string memory _str) public { } - function addStructs(MyStruct[] _structs) public returns (MyStruct[] strucmts) { + function addStructs(MyStruct[] memory _structs) public returns (MyStruct[] memory strucmts) { strucmts = _structs; } - function addStructs(MyStruct _structs) public returns (MyStruct _strucmts) { + function addStructs(MyStruct memory _structs) public returns (MyStruct memory _strucmts) { _strucmts = _structs; } }` From 5b4b099d13d524775972b0762f2b97f0c14c3ff0 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 15 Nov 2018 14:42:18 +0100 Subject: [PATCH 08/20] fixed typo --- remix-debug/test/decoder/contracts/simpleContract.js | 1 + remix-tests/examples/simple_storage2_test.sol | 2 +- remix-tests/tests/number/number_test.sol | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/remix-debug/test/decoder/contracts/simpleContract.js b/remix-debug/test/decoder/contracts/simpleContract.js index bffa2bfe88..bc4200ab66 100644 --- a/remix-debug/test/decoder/contracts/simpleContract.js +++ b/remix-debug/test/decoder/contracts/simpleContract.js @@ -17,6 +17,7 @@ module.exports = ` contract test1 { struct str { + uint8 ui; } } diff --git a/remix-tests/examples/simple_storage2_test.sol b/remix-tests/examples/simple_storage2_test.sol index ac6115eba5..caa4de9bba 100644 --- a/remix-tests/examples/simple_storage2_test.sol +++ b/remix-tests/examples/simple_storage2_test.sol @@ -1,4 +1,4 @@ -ppragma solidity ^0.5.0; +pragma solidity ^0.5.0; import "remix_tests.sol"; import "./simple_storage.sol"; diff --git a/remix-tests/tests/number/number_test.sol b/remix-tests/tests/number/number_test.sol index 7e232fe630..f6cfca13ac 100644 --- a/remix-tests/tests/number/number_test.sol +++ b/remix-tests/tests/number/number_test.sol @@ -1,5 +1,4 @@ pragma solidity ^0.5.0; - contract IntegerTest { // GREATER THAN [>] tests From 949a65f4cfabf9994472ab371457ffdd6b051dd5 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 15 Nov 2018 14:45:01 +0100 Subject: [PATCH 09/20] Update number_test.sol --- remix-tests/tests/number/number_test.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/remix-tests/tests/number/number_test.sol b/remix-tests/tests/number/number_test.sol index f6cfca13ac..7e232fe630 100644 --- a/remix-tests/tests/number/number_test.sol +++ b/remix-tests/tests/number/number_test.sol @@ -1,4 +1,5 @@ pragma solidity ^0.5.0; + contract IntegerTest { // GREATER THAN [>] tests From b7655b657ef46446fabc44e369a28f1a268fa601 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Mon, 19 Nov 2018 18:02:18 +0100 Subject: [PATCH 10/20] fixes tests --- remix-debug/test/decoder/contracts/byteStorage.js | 4 ++-- remix-debug/test/decoder/contracts/intLocal.js | 6 +++--- remix-debug/test/decoder/contracts/mappingStorage.js | 4 ++-- remix-debug/test/decoder/contracts/miscLocal.js | 4 ++-- .../test/decoder/contracts/structArrayLocal.js | 2 +- .../test/decoder/contracts/structArrayStorage.js | 2 +- remix-debug/test/decoder/decodeInfo.js | 5 ++--- remix-debug/test/decoder/stateTests/mapping.js | 2 +- remix-debug/test/tests.js | 12 ++++++------ 9 files changed, 20 insertions(+), 21 deletions(-) diff --git a/remix-debug/test/decoder/contracts/byteStorage.js b/remix-debug/test/decoder/contracts/byteStorage.js index dfd5e04fff..42ff3c0b81 100644 --- a/remix-debug/test/decoder/contracts/byteStorage.js +++ b/remix-debug/test/decoder/contracts/byteStorage.js @@ -6,10 +6,10 @@ module.exports = { enum enum1 { e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63, e64, e65, e66, e67, e68, e69, e70, e71, e72, e73, e74, e75, e76, e77, e78, e79, e80, e81, e82, e83, e84, e85, e86, e87, e88, e89, e90, e91, e92, e93, e94, e95, e96, e97, e98, e99, e100, e101, e102, e103, e104, e105, e106, e107, e108, e109, e110, e111, e112, e113, e114, e115, e116, e117, e118, e119, e120, e121, e122, e123, e124, e125, e126, e127, e128, e129, e130, e131, e132, e133, e134, e135, e136, e137, e138, e139, e140, e141, e142, e143, e144, e145, e146, e147, e148, e149, e150, e151, e152, e153, e154, e155, e156, e157, e158, e159, e160, e161, e162, e163, e164, e165, e166, e167, e168, e169, e170, e171, e172, e173, e174, e175, e176, e177, e178, e179, e180, e181, e182, e183, e184, e185, e186, e187, e188, e189, e190, e191, e192, e193, e194, e195, e196, e197, e198, e199, e200, e201, e202, e203, e204, e205, e206, e207, e208, e209, e210, e211, e212, e213, e214, e215, e216, e217, e218, e219, e220, e221, e222, e223, e224, e225, e226, e227, e228, e229, e230, e231, e232, e233, e234, e235, e236, e237, e238, e239, e240, e241, e242, e243, e244, e245, e246, e247, e248, e249, e250, e251, e252, e253, e254, e255, e256, e257, e258, e259, e260 } bool b1 = false; - address a1 = 0xfe350f199f244ac9a79038d254400b632a633225; + address a1 = 0xfE350f199F244ac9A79038d254400b632a633225; bool b2 = true; bytes dynb1 = "dynamicbytes"; - byte stab = 0x1; + byte stab = 0x01; bytes1 stab1 = hex"12"; bytes2 stab2 = hex"1579"; bytes3 stab3 = hex"359356"; diff --git a/remix-debug/test/decoder/contracts/intLocal.js b/remix-debug/test/decoder/contracts/intLocal.js index 1bfaf7c5ec..737bac6e49 100644 --- a/remix-debug/test/decoder/contracts/intLocal.js +++ b/remix-debug/test/decoder/contracts/intLocal.js @@ -9,7 +9,7 @@ contract proxy { } } contract intLocal { - function intLocal () { + constructor () public { proxy.testStruct memory p; uint8 ui8 = 130; uint16 ui16 = 456; @@ -31,11 +31,11 @@ contract intLocal { level11(); } - function level11() { + function level11() public { uint8 ui8 = 123; level12(); } - function level12() { + function level12() public { uint8 ui81 = 12; } } diff --git a/remix-debug/test/decoder/contracts/mappingStorage.js b/remix-debug/test/decoder/contracts/mappingStorage.js index 722c36a458..85f877f987 100644 --- a/remix-debug/test/decoder/contracts/mappingStorage.js +++ b/remix-debug/test/decoder/contracts/mappingStorage.js @@ -1,12 +1,12 @@ module.exports = { contract: ` - pragma solidity ^0.4.19; + pragma solidity ^0.5.0; contract SimpleMappingState { uint _num; mapping(string => uint) _iBreakSolidityState; mapping(uint => uint) _iBreakSolidityStateInt; - function updateNum(uint num, string str) public { + function updateNum(uint num, string memory str) public { _num = num; _iBreakSolidityState[str] = num; _iBreakSolidityStateInt[num] = num; diff --git a/remix-debug/test/decoder/contracts/miscLocal.js b/remix-debug/test/decoder/contracts/miscLocal.js index c6a37b6e09..2447e2f959 100644 --- a/remix-debug/test/decoder/contracts/miscLocal.js +++ b/remix-debug/test/decoder/contracts/miscLocal.js @@ -9,7 +9,7 @@ contract miscLocal { three, four } - function miscLocal () { + constructor () public { bool boolFalse = false; bool boolTrue = true; enumDef testEnum; @@ -31,7 +31,7 @@ contract miscLocal { } contract miscLocal2 { - function miscLocal2 () { + constructor () public { bytes memory dynbytes = "dynamicbytes"; string memory smallstring = "test_test_test"; } diff --git a/remix-debug/test/decoder/contracts/structArrayLocal.js b/remix-debug/test/decoder/contracts/structArrayLocal.js index 35bf48ea69..c8391005d8 100644 --- a/remix-debug/test/decoder/contracts/structArrayLocal.js +++ b/remix-debug/test/decoder/contracts/structArrayLocal.js @@ -24,7 +24,7 @@ contract structArrayLocal { enumdef c; } - function structArrayLocal () { + constructor () public { bytes memory bytesSimple = "test_super"; teststruct memory e; e.a = "test"; diff --git a/remix-debug/test/decoder/contracts/structArrayStorage.js b/remix-debug/test/decoder/contracts/structArrayStorage.js index 7f542733f6..1111305dd2 100644 --- a/remix-debug/test/decoder/contracts/structArrayStorage.js +++ b/remix-debug/test/decoder/contracts/structArrayStorage.js @@ -25,7 +25,7 @@ module.exports = { string str; } simpleStruct[][3] arrayStruct; - function structArrayStorage () { + constructor () public { intStructDec.i8 = 32; intStructDec.i16 = -54; intStructDec.ui32 = 128; diff --git a/remix-debug/test/decoder/decodeInfo.js b/remix-debug/test/decoder/decodeInfo.js index 29dcffb937..2083ecab79 100644 --- a/remix-debug/test/decoder/decodeInfo.js +++ b/remix-debug/test/decoder/decodeInfo.js @@ -67,7 +67,6 @@ tape('solidity', function (t) { output = compiler.compile(compilerInput(simplecontracts)) output = JSON.parse(output) - state = astHelper.extractStateDefinitions('test.sol:simpleContract', output.sources) states = astHelper.extractStatesDefinitions(output.sources) stateDef = state.stateDefinitions @@ -81,10 +80,10 @@ tape('solidity', function (t) { state = astHelper.extractStateDefinitions('test.sol:test2', output.sources) stateDef = state.stateDefinitions parsedType = decodeInfo.parseType(stateDef[0].attributes.type, states, 'test1', util.extractLocationFromAstVariable(stateDef[0])) - checkDecodeInfo(st, parsedType, 0, 32, 'struct test1.str') + checkDecodeInfo(st, parsedType, 1, 32, 'struct test1.str') state = stateDecoder.extractStateVariables('test.sol:test2', output.sources) - checkDecodeInfo(st, parsedType, 0, 32, 'struct test1.str') + checkDecodeInfo(st, parsedType, 1, 32, 'struct test1.str') st.end() }) diff --git a/remix-debug/test/decoder/stateTests/mapping.js b/remix-debug/test/decoder/stateTests/mapping.js index a3fbb0ede2..8eb8ece33f 100644 --- a/remix-debug/test/decoder/stateTests/mapping.js +++ b/remix-debug/test/decoder/stateTests/mapping.js @@ -48,7 +48,7 @@ function testMapping (st, vm, privateKey, contractAddress, output, cb) { var traceManager = new TraceManager({web3: vm.web3}) traceManager.resolveTrace(tx, () => { var storageViewer = new StorageViewer({ - stepIndex: 213, + stepIndex: 268, tx: tx, address: contractAddress }, new StorageResolver({web3: vm.web3}), traceManager) diff --git a/remix-debug/test/tests.js b/remix-debug/test/tests.js index 2adab8b10e..7cfd45e4c3 100644 --- a/remix-debug/test/tests.js +++ b/remix-debug/test/tests.js @@ -109,8 +109,8 @@ function testDebugging (t, debugManager) { breakPointManager.event.register('breakpointHit', function (sourceLocation, step) { console.log('breakpointHit') - t.equal(JSON.stringify(sourceLocation), JSON.stringify({ start: 591, length: 1, file: 0, jump: '-' })) - t.equal(step, 75) + t.equal(JSON.stringify(sourceLocation), JSON.stringify({ start: 587, length: 1, file: 0, jump: '-' })) + t.equal(step, 74) }) breakPointManager.event.register('noBreakpointHit', function () { @@ -120,7 +120,7 @@ function testDebugging (t, debugManager) { breakPointManager.jumpNextBreakpoint(0, true) } -var ballot = `pragma solidity ^0.4.0; +var ballot = `pragma solidity ^0.5.0; contract Ballot { struct Voter { @@ -138,13 +138,13 @@ contract Ballot { Proposal[] proposals; /// Create a new ballot with $(_numProposals) different proposals. - function Ballot() public { + constructor() public { uint p = 45; chairperson = msg.sender; address addressLocal = msg.sender; // copy of state variable voters[chairperson].weight = 1; proposals.length = 1; - Proposal[] proposalsLocals = proposals; // copy of state variable + Proposal[] storage proposalsLocals = proposals; // copy of state variable } /// Give $(toVoter) the right to vote on this ballot. @@ -179,7 +179,7 @@ contract Ballot { proposals[toProposal].voteCount += sender.weight; } - function winningProposal() public constant returns (uint8 _winningProposal) { + function winningProposal() public view returns (uint8 _winningProposal) { uint256 winningVoteCount = 0; for (uint8 prop = 0; prop < proposals.length; prop++) if (proposals[prop].voteCount > winningVoteCount) { From c121b93038c53fdcf9167b5c9586446e5df1cf9a Mon Sep 17 00:00:00 2001 From: LianaHus Date: Mon, 19 Nov 2018 18:54:24 +0100 Subject: [PATCH 11/20] updated solc version --- remix-debug/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-debug/package.json b/remix-debug/package.json index 97774d32fb..7b3f35614f 100644 --- a/remix-debug/package.json +++ b/remix-debug/package.json @@ -24,7 +24,7 @@ "notify-error": "^1.2.0", "npm-run-all": "^4.1.2", "remix-lib": "^0.3.8", - "solc": "^0.4.24" + "solc": "^0.5.0" }, "devDependencies": { "standard": "^7.0.1", From 83393201f27f9f4bbfe787481cbcd9ed9a50a531 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 19 Nov 2018 19:11:33 +0100 Subject: [PATCH 12/20] Update tests_accounts.sol.js --- remix-tests/sol/tests_accounts.sol.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-tests/sol/tests_accounts.sol.js b/remix-tests/sol/tests_accounts.sol.js index 2a3cb04024..bab531cc46 100644 --- a/remix-tests/sol/tests_accounts.sol.js +++ b/remix-tests/sol/tests_accounts.sol.js @@ -1,4 +1,4 @@ -module.exports = `pragma solidity ^0.4.7; +module.exports = `pragma solidity ^0.5.0; library TestsAccounts { function getAccount(uint index) returns (address) { From 9012d456111d2bdc28e0f3f66e2097feb8dfe93d Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 19 Nov 2018 19:15:07 +0100 Subject: [PATCH 13/20] Update package.json --- remix-tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-tests/package.json b/remix-tests/package.json index 07fb8a00c4..e8e05ab11a 100644 --- a/remix-tests/package.json +++ b/remix-tests/package.json @@ -45,7 +45,7 @@ "remix-simulator": "0.0.6", "remix-solidity": "0.2.12", "signale": "^1.2.1", - "solc": "^0.4.24", + "solc": "^0.5.0", "standard": "^10.0.3", "web3": "1.0.0-beta.36", "winston": "^3.0.0" From c34b9d88038041d79f51c78f6ede25201b077b22 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 19 Nov 2018 19:16:54 +0100 Subject: [PATCH 14/20] Update tests_accounts.sol.js --- remix-tests/sol/tests_accounts.sol.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-tests/sol/tests_accounts.sol.js b/remix-tests/sol/tests_accounts.sol.js index bab531cc46..c32f656621 100644 --- a/remix-tests/sol/tests_accounts.sol.js +++ b/remix-tests/sol/tests_accounts.sol.js @@ -1,7 +1,7 @@ module.exports = `pragma solidity ^0.5.0; library TestsAccounts { - function getAccount(uint index) returns (address) { + function getAccount(uint index) public returns (address) { >accounts< return accounts[index]; } From b6fe9814faa565874a60ce4a2fe22cd7bd5f985a Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 19 Nov 2018 19:19:34 +0100 Subject: [PATCH 15/20] Update tests_accounts.sol.js --- remix-tests/sol/tests_accounts.sol.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/remix-tests/sol/tests_accounts.sol.js b/remix-tests/sol/tests_accounts.sol.js index c32f656621..55392f8b92 100644 --- a/remix-tests/sol/tests_accounts.sol.js +++ b/remix-tests/sol/tests_accounts.sol.js @@ -1,5 +1,4 @@ -module.exports = `pragma solidity ^0.5.0; - +module.exports = ` library TestsAccounts { function getAccount(uint index) public returns (address) { >accounts< From c3d21d3b2c482a4cfd348689ee5ce259ed037b50 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 19 Nov 2018 19:19:55 +0100 Subject: [PATCH 16/20] Update tests.sol.js --- remix-tests/sol/tests.sol.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/remix-tests/sol/tests.sol.js b/remix-tests/sol/tests.sol.js index 0fd3e5b35d..4d5ccda37d 100644 --- a/remix-tests/sol/tests.sol.js +++ b/remix-tests/sol/tests.sol.js @@ -1,6 +1,4 @@ module.exports = ` -pragma solidity ^0.5.0; - library Assert { event AssertionEvent( From 7990471b455569a14c2799c6a0b1e93588dc0769 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 19 Nov 2018 19:47:23 +0100 Subject: [PATCH 17/20] Update compiler.js --- remix-tests/src/compiler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remix-tests/src/compiler.js b/remix-tests/src/compiler.js index 476c8ea881..4d71e43879 100644 --- a/remix-tests/src/compiler.js +++ b/remix-tests/src/compiler.js @@ -11,7 +11,8 @@ String.prototype.regexIndexOf = function (regex, startpos) { function writeTestAccountsContract (accounts) { var testAccountContract = require('../sol/tests_accounts.sol.js') - var body = 'address[' + accounts.length + '] memory accounts' + // TODO: this will only work for solidity 0.5.0 + var body = 'address payable[' + accounts.length + '] memory accounts;' if (!accounts.length) body += ';' else { body += '= [' + accounts.map((value) => { return `address(${value})` }).join(',') + '];' From e556277ad1782b69a4e449f1854df82658fa4649 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 19 Nov 2018 19:49:09 +0100 Subject: [PATCH 18/20] Update compiler.js --- remix-tests/src/compiler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-tests/src/compiler.js b/remix-tests/src/compiler.js index 4d71e43879..998f6f8327 100644 --- a/remix-tests/src/compiler.js +++ b/remix-tests/src/compiler.js @@ -12,7 +12,7 @@ String.prototype.regexIndexOf = function (regex, startpos) { function writeTestAccountsContract (accounts) { var testAccountContract = require('../sol/tests_accounts.sol.js') // TODO: this will only work for solidity 0.5.0 - var body = 'address payable[' + accounts.length + '] memory accounts;' + var body = 'address payable[' + accounts.length + '] memory accounts' if (!accounts.length) body += ';' else { body += '= [' + accounts.map((value) => { return `address(${value})` }).join(',') + '];' From 28dd63e55b73097558cf3e5d25b0e666b03c2584 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 19 Nov 2018 19:51:19 +0100 Subject: [PATCH 19/20] Update sender_test.sol --- remix-tests/tests/various_sender/sender_test.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/remix-tests/tests/various_sender/sender_test.sol b/remix-tests/tests/various_sender/sender_test.sol index 896c145447..945e926bb9 100644 --- a/remix-tests/tests/various_sender/sender_test.sol +++ b/remix-tests/tests/various_sender/sender_test.sol @@ -1,4 +1,3 @@ -pragma solidity ^0.4.7; import "remix_tests.sol"; // this import is automatically injected by Remix. import "remix_accounts.sol"; From f43052a1d756d97781935ce990cbf5ec2f05a851 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 19 Nov 2018 19:53:19 +0100 Subject: [PATCH 20/20] Update sender_test.sol --- remix-tests/tests/various_sender/sender_test.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-tests/tests/various_sender/sender_test.sol b/remix-tests/tests/various_sender/sender_test.sol index 945e926bb9..a8ee001b3d 100644 --- a/remix-tests/tests/various_sender/sender_test.sol +++ b/remix-tests/tests/various_sender/sender_test.sol @@ -3,7 +3,7 @@ import "remix_accounts.sol"; contract SenderTest { - function beforeAll () {} + function beforeAll () public {} /// 1 function checkSenderIs1 () public {