From 9febad6be1946673d35af1f39e7dab4c62b5ce9e Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 2 Oct 2018 09:29:23 +0200 Subject: [PATCH 01/32] add "addProvider" "removeProvider" to execution context --- remix-lib/src/execution/execution-context.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/remix-lib/src/execution/execution-context.js b/remix-lib/src/execution/execution-context.js index b8c459973a..07cd4ee079 100644 --- a/remix-lib/src/execution/execution-context.js +++ b/remix-lib/src/execution/execution-context.js @@ -85,6 +85,7 @@ function ExecutionContext () { this.blockGasLimitDefault = 4300000 this.blockGasLimit = this.blockGasLimitDefault + this.customNetWorks = {} this.init = function (config) { if (config.get('settings/always-use-vm')) { @@ -134,6 +135,16 @@ function ExecutionContext () { } } + this.removeProvider = function (name) { + delete this.customNetWorks[name] + self.event.trigger('removeProvider', [name]) + } + + this.addProvider = function (network) { + this.customNetWorks[network.name] = network + self.event.trigger('addProvider', [network]) + } + this.internalWeb3 = function () { return web3 } @@ -182,6 +193,11 @@ function ExecutionContext () { if (context === 'web3') { confirmCb(cb) } + + if (this.customNetWorks[context]) { + var provider = this.customNetWorks[context] + setProviderFromEndpoint(provider.url, provider.name, () => { cb() }) + } } this.currentblockGasLimit = function () { From f265dffd070ecbddc8ab22f8a419f1331be0367a Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 11 Oct 2018 09:40:29 +0200 Subject: [PATCH 02/32] test before adding/removing --- remix-lib/src/execution/execution-context.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/remix-lib/src/execution/execution-context.js b/remix-lib/src/execution/execution-context.js index 07cd4ee079..fef1a1544b 100644 --- a/remix-lib/src/execution/execution-context.js +++ b/remix-lib/src/execution/execution-context.js @@ -136,13 +136,17 @@ function ExecutionContext () { } this.removeProvider = function (name) { - delete this.customNetWorks[name] - self.event.trigger('removeProvider', [name]) + if (name && this.customNetWorks[name]) { + delete this.customNetWorks[name] + self.event.trigger('removeProvider', [name]) + } } this.addProvider = function (network) { - this.customNetWorks[network.name] = network - self.event.trigger('addProvider', [network]) + if (network && network.name && network.url) { + this.customNetWorks[network.name] = network + self.event.trigger('addProvider', [network]) + } } this.internalWeb3 = function () { From 8f0981f721db3661e1c8c786ba17c0f2dc4ac7fa Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 11 Oct 2018 13:38:43 +0200 Subject: [PATCH 03/32] update lerna / add gulp --- gulpfile.js | 10 ++++++++++ lerna.json | 11 ++++++++++- package.json | 16 +++++++++------- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 gulpfile.js diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000000..232d580250 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node + +'use strict'; +var gulp = require('gulp'); + +var lernaJSON = require('./lerna.json'); + +gulp.task('publishTag', function () { + exec("git tag v"+ lernaJSON.version +"; git push --tags"); +}); diff --git a/lerna.json b/lerna.json index c28bf231ed..541838e744 100644 --- a/lerna.json +++ b/lerna.json @@ -8,5 +8,14 @@ "remix-tests", "remix-simulator" ], - "version": "independent" + "command": { + "init": { + "exact": true + }, + "publish": { + "exact": true, + "skipGit": true + } + }, + "version": "0.0.1" } diff --git a/package.json b/package.json index 6caf32cecb..1e1ce5eab7 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,11 @@ { - "devDependencies": { - "lerna": "^2.10.2" - }, - "scripts": { - "bootstrap": "lerna bootstrap", - "publish": "lerna publish" - } + "devDependencies": { + "gulp": "^3.9.1", + "lerna": "^2.10.2" + }, + "scripts": { + "bootstrap": "lerna bootstrap", + "publish": "lerna publish", + "release": "lerna bootstrap; lerna publish; gulp; gulp publishTag;" + } } From 7101668754cdae7ad1a3bbc9a4caa0b00b9f65c8 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Tue, 16 Oct 2018 11:56:02 +0200 Subject: [PATCH 04/32] update to zeppelin contract for tutorial --- docs/workshop_Building_smart_contracts_with_Remix.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/workshop_Building_smart_contracts_with_Remix.md b/docs/workshop_Building_smart_contracts_with_Remix.md index 654668ba0c..204065b64f 100644 --- a/docs/workshop_Building_smart_contracts_with_Remix.md +++ b/docs/workshop_Building_smart_contracts_with_Remix.md @@ -10,5 +10,5 @@ This tutorial was used in workshops at ethCC, Edcon, and DappCon. You can [watch the Edcon presentation talk](https://www.youtube.com/watch?v=nAI_Cr5Y8JY) and here are the [workshop slides](https://slides.com/ninabreznik/deck-11-13#/). (May 3, 2018) -Here are the [DappCon slides (hosted on swarm)](https://30400.swarm-gateways.net/bzz:/2271229d214f8aef9b1176bc22dbc09e384cd8c577a87c60ebece68aebc59d3a/) and here are the [DappCon slides (not on swarm)](https://www.updig.is/pdf/remix-at-dappcon.pdf). -(July 19, 2018) \ No newline at end of file +Here are the [latest slides (hosted on swarm)](http://30400.swarm-gateways.net/bzz:/49277e2a16baf5576c9f54204c70dc403a425c3df85424864fe04ad6dfc609bc/) and here are the [latest slides (not on swarm)](https://www.updig.is/pdf/remix-chez-coinhouse.pdf). +(Oct 16, 2018) \ No newline at end of file From cb71dc9df8757a66561ea5b2a9e64b2f50c5357d Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 16 Oct 2018 16:00:03 +0200 Subject: [PATCH 05/32] change initial version --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 541838e744..184e829ecc 100644 --- a/lerna.json +++ b/lerna.json @@ -17,5 +17,5 @@ "skipGit": true } }, - "version": "0.0.1" + "version": "0.1.0" } From f6e2c02a61218170e876d28df6e341a1969ec5d2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 16 Oct 2018 17:32:34 +0200 Subject: [PATCH 06/32] run publish and create tag --- .gitignore | 1 + gulpfile.js | 5 +++-- lerna.json | 2 +- package.json | 1 + remix-analyzer/package.json | 4 ++-- remix-debug/package.json | 4 ++-- remix-lib/package.json | 2 +- remix-solidity/package.json | 4 ++-- remix-tests/package.json | 6 +++--- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index eddf24d1ff..2f9b6cc3d7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ package-lock.json .tern-port TODO soljson.js +lerna-debug.log diff --git a/gulpfile.js b/gulpfile.js index 232d580250..c8234e39c0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,9 +2,10 @@ 'use strict'; var gulp = require('gulp'); +var exec = require('child_process').exec; -var lernaJSON = require('./lerna.json'); +var packageJSON = require('./package.json'); gulp.task('publishTag', function () { - exec("git tag v"+ lernaJSON.version +"; git push --tags"); + exec("git tag v"+ packageJSON.version +"; git push --tags"); }); diff --git a/lerna.json b/lerna.json index 184e829ecc..648f59d921 100644 --- a/lerna.json +++ b/lerna.json @@ -17,5 +17,5 @@ "skipGit": true } }, - "version": "0.1.0" + "version": "independent" } diff --git a/package.json b/package.json index 1e1ce5eab7..1785d6104b 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "version": "0.1.0", "devDependencies": { "gulp": "^3.9.1", "lerna": "^2.10.2" diff --git a/remix-analyzer/package.json b/remix-analyzer/package.json index 2a24abc649..244e89be34 100644 --- a/remix-analyzer/package.json +++ b/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "remix-analyzer", - "version": "0.2.8", + "version": "0.2.10", "description": "Remix Analyzer", "main": "./index.js", "contributors": [ @@ -21,7 +21,7 @@ "babel-eslint": "^7.1.1", "babel-plugin-transform-object-assign": "^6.22.0", "babel-preset-es2015": "^6.24.0", - "remix-lib": "^0.3.8", + "remix-lib": "0.3.10", "solc": "^0.4.24", "standard": "^7.0.1", "tape": "^4.6.0" diff --git a/remix-debug/package.json b/remix-debug/package.json index 97774d32fb..79a44e2662 100644 --- a/remix-debug/package.json +++ b/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "remix-debug", - "version": "0.2.9", + "version": "0.2.11", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -23,7 +23,7 @@ "fast-async": "^6.1.2", "notify-error": "^1.2.0", "npm-run-all": "^4.1.2", - "remix-lib": "^0.3.8", + "remix-lib": "0.3.10", "solc": "^0.4.24" }, "devDependencies": { diff --git a/remix-lib/package.json b/remix-lib/package.json index b4aa95f968..6be93a55d2 100644 --- a/remix-lib/package.json +++ b/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "remix-lib", - "version": "0.3.8", + "version": "0.3.10", "description": "Ethereum IDE and tools for the web", "contributors": [ { diff --git a/remix-solidity/package.json b/remix-solidity/package.json index f0a2e4da0c..bf856ec5c4 100644 --- a/remix-solidity/package.json +++ b/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "remix-solidity", - "version": "0.2.8", + "version": "0.2.10", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -22,7 +22,7 @@ "ethereumjs-vm": "^2.3.3", "fast-async": "^6.1.2", "npm-run-all": "^4.0.2", - "remix-lib": "^0.3.8", + "remix-lib": "0.3.10", "solc": "^0.4.24", "standard": "^7.0.1", "tape": "^4.6.0", diff --git a/remix-tests/package.json b/remix-tests/package.json index f8fca503ed..5075f4bc2d 100644 --- a/remix-tests/package.json +++ b/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "remix-tests", - "version": "0.0.13", + "version": "0.0.15", "description": "Tests for the Ethereum tool suite Remix", "main": "./src/index.js", "contributors": [ @@ -41,9 +41,9 @@ "change-case": "^3.0.1", "colors": "^1.1.2", "commander": "^2.13.0", - "remix-lib": "^0.3.8", + "remix-lib": "0.3.10", "remix-simulator": "^0.0.4", - "remix-solidity": "^0.2.8", + "remix-solidity": "0.2.10", "signale": "^1.2.1", "solc": "^0.4.24", "standard": "^10.0.3", From a04880946ab5735159c91b7df126fba9c929c62b Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 17 Oct 2018 16:41:57 +0200 Subject: [PATCH 07/32] Set the msg.sender in the solidity userdoc --- remix-simulator/src/methods/accounts.js | 7 ++- remix-tests/sol/tests_accounts.sol.js | 9 +++ remix-tests/src/compiler.js | 23 +++++-- remix-tests/src/index.js | 62 ++++++++++++------ remix-tests/src/testRunner.js | 43 +++++++++++-- remix-tests/tests/testRunner.js | 63 +++++++++++++++---- .../tests/various_sender/sender_test.sol | 28 +++++++++ 7 files changed, 192 insertions(+), 43 deletions(-) create mode 100644 remix-tests/sol/tests_accounts.sol.js create mode 100644 remix-tests/tests/various_sender/sender_test.sol diff --git a/remix-simulator/src/methods/accounts.js b/remix-simulator/src/methods/accounts.js index c85493aade..d23f572229 100644 --- a/remix-simulator/src/methods/accounts.js +++ b/remix-simulator/src/methods/accounts.js @@ -3,10 +3,15 @@ var Web3 = require('web3') var Accounts = function () { this.web3 = new Web3() // TODO: make it random and/or use remix-libs - this.accounts = [this.web3.eth.accounts.create(['abcd'])] + this.accounts = [this.web3.eth.accounts.create(['abcd']), this.web3.eth.accounts.create(['ef12']), this.web3.eth.accounts.create(['ef34'])] this.accounts[this.accounts[0].address.toLowerCase()] = this.accounts[0] + this.accounts[this.accounts[1].address.toLowerCase()] = this.accounts[1] + this.accounts[this.accounts[2].address.toLowerCase()] = this.accounts[2] + this.accounts[this.accounts[0].address.toLowerCase()].privateKey = Buffer.from(this.accounts[this.accounts[0].address.toLowerCase()].privateKey.slice(2), 'hex') + this.accounts[this.accounts[1].address.toLowerCase()].privateKey = Buffer.from(this.accounts[this.accounts[1].address.toLowerCase()].privateKey.slice(2), 'hex') + this.accounts[this.accounts[2].address.toLowerCase()].privateKey = Buffer.from(this.accounts[this.accounts[2].address.toLowerCase()].privateKey.slice(2), 'hex') } Accounts.prototype.methods = function () { diff --git a/remix-tests/sol/tests_accounts.sol.js b/remix-tests/sol/tests_accounts.sol.js new file mode 100644 index 0000000000..2a3cb04024 --- /dev/null +++ b/remix-tests/sol/tests_accounts.sol.js @@ -0,0 +1,9 @@ +module.exports = `pragma solidity ^0.4.7; + +library TestsAccounts { + function getAccount(uint index) returns (address) { + >accounts< + return accounts[index]; + } +} +` diff --git a/remix-tests/src/compiler.js b/remix-tests/src/compiler.js index f43a9cab65..f25709fd8a 100644 --- a/remix-tests/src/compiler.js +++ b/remix-tests/src/compiler.js @@ -9,18 +9,28 @@ String.prototype.regexIndexOf = function (regex, startpos) { return (indexOf >= 0) ? (indexOf + (startpos || 0)) : indexOf } +function writeTestAccountsContract (accounts) { + var testAccountContract = require('../sol/tests_accounts.sol.js') + var body = 'address[' + accounts.length + '] memory accounts' + if (!accounts.length) body += ';' + else { + body += '= [' + accounts.map((value) => { return `address(${value})` }).join(',') + '];' + } + return testAccountContract.replace('>accounts<', body) +} + var userAgent = (typeof (navigator) !== 'undefined') && navigator.userAgent ? navigator.userAgent.toLowerCase() : '-' var isBrowser = !(typeof (window) === 'undefined' || userAgent.indexOf(' electron/') > -1) // TODO: replace this with remix's own compiler code -function compileFileOrFiles (filename, isDirectory, cb) { +function compileFileOrFiles (filename, isDirectory, opts, cb) { let compiler, filepath - + let accounts = opts.accounts || [] const sources = { 'tests.sol': { content: require('../sol/tests.sol.js') }, - 'remix_tests.sol': { content: require('../sol/tests.sol.js') } + 'remix_tests.sol': { content: require('../sol/tests.sol.js') }, + 'remix_accounts.sol': { content: writeTestAccountsContract(accounts) } } - // TODO: for now assumes filepath dir contains all tests, later all this // should be replaced with remix's & browser solidity compiler code filepath = (isDirectory ? filename : path.dirname(filename)) @@ -61,12 +71,13 @@ function compileFileOrFiles (filename, isDirectory, cb) { }) } -function compileContractSources (sources, importFileCb, cb) { +function compileContractSources (sources, importFileCb, cb, opts) { let compiler, filepath - + let accounts = opts.accounts || [] // Iterate over sources keys. Inject test libraries. Inject test library import statements. if (!('remix_tests.sol' in sources) && !('tests.sol' in sources)) { sources['remix_tests.sol'] = { content: require('../sol/tests.sol.js') } + sources['remix_accounts.sol'] = { content: writeTestAccountsContract(accounts) } } const s = /^(import)\s['"](remix_tests.sol|tests.sol)['"];/gm for (let file in sources) { diff --git a/remix-tests/src/index.js b/remix-tests/src/index.js index 3dfd689ff4..baf9c8d674 100644 --- a/remix-tests/src/index.js +++ b/remix-tests/src/index.js @@ -16,13 +16,22 @@ var createWeb3Provider = function () { return web3 } -var runTestSources = function (contractSources, testCallback, resultCallback, finalCallback, importFileCb) { +var runTestSources = function (contractSources, testCallback, resultCallback, finalCallback, importFileCb, opts) { + opts = opts || {} + let web3 = opts.web3 || createWeb3Provider() + let accounts = opts.accounts || null async.waterfall([ + function getAccountList (next) { + if (accounts) return next() + web3.eth.getAccounts((_err, _accounts) => { + accounts = _accounts + next() + }) + }, function compile (next) { Compiler.compileContractSources(contractSources, importFileCb, next) }, function deployAllContracts (compilationResult, next) { - let web3 = createWeb3Provider() Deployer.deployAll(compilationResult, web3, function (err, contracts) { if (err) { next(err) @@ -33,19 +42,21 @@ var runTestSources = function (contractSources, testCallback, resultCallback, fi }, function determineTestContractsToRun (compilationResult, contracts, next) { let contractsToTest = [] + let contractsToTestDetails = [] for (let filename in compilationResult) { if (filename.indexOf('_test.sol') < 0) { continue } Object.keys(compilationResult[filename]).forEach(contractName => { + contractsToTestDetails.push(compilationResult[filename][contractName]) contractsToTest.push(contractName) }) } - next(null, contractsToTest, contracts) + next(null, contractsToTest, contractsToTestDetails, contracts) }, - function runTests (contractsToTest, contracts, next) { + function runTests (contractsToTest, contractsToTestDetails, contracts, next) { let totalPassing = 0 let totalFailing = 0 let totalTime = 0 @@ -67,7 +78,7 @@ var runTestSources = function (contractSources, testCallback, resultCallback, fi } async.eachOfLimit(contractsToTest, 1, (contractName, index, cb) => { - TestRunner.runTest(contractName, contracts[contractName], _testCallback, (err, result) => { + TestRunner.runTest(contractName, contracts[contractName], contractsToTestDetails[index], { accounts }, _testCallback, (err, result) => { if (err) { return cb(err) } @@ -95,7 +106,8 @@ var runTestSources = function (contractSources, testCallback, resultCallback, fi ], finalCallback) } -var runTestFiles = function (filepath, isDirectory, web3) { +var runTestFiles = function (filepath, isDirectory, web3, opts) { + opts = opts || {} const { Signale } = require('signale') // signale configuration const options = { @@ -118,37 +130,49 @@ var runTestFiles = function (filepath, isDirectory, web3) { } } const signale = new Signale(options) + let accounts = opts.accounts || null async.waterfall([ + function getAccountList (next) { + if (accounts) return next(null) + web3.eth.getAccounts((_err, _accounts) => { + accounts = _accounts + next(null) + }) + }, function compile (next) { - Compiler.compileFileOrFiles(filepath, isDirectory, next) + Compiler.compileFileOrFiles(filepath, isDirectory, { accounts }, next) }, function deployAllContracts (compilationResult, next) { Deployer.deployAll(compilationResult, web3, function (err, contracts) { if (err) { next(err) } - next(null, compilationResult, contracts) }) }, function determineTestContractsToRun (compilationResult, contracts, next) { let contractsToTest = [] + let contractsToTestDetails = [] + var gatherContractsFrom = (filename) => { + if (filename.indexOf('_test.sol') < 0) { + return + } + Object.keys(compilationResult[path.basename(filename)]).forEach(contractName => { + contractsToTest.push(contractName) + contractsToTestDetails.push(compilationResult[path.basename(filename)][contractName]) + }) + } + if (isDirectory) { fs.readdirSync(filepath).forEach(filename => { - if (filename.indexOf('_test.sol') < 0) { - return - } - Object.keys(compilationResult[path.basename(filename)]).forEach(contractName => { - contractsToTest.push(contractName) - }) + gatherContractsFrom(filename) }) } else { - contractsToTest = Object.keys(compilationResult[path.basename(filepath)]) + gatherContractsFrom(filepath) } - - next(null, contractsToTest, contracts) + next(null, contractsToTest, contractsToTestDetails, contracts) }, - function runTests (contractsToTest, contracts, next) { + function runTests (contractsToTest, contractsToTestDetails, contracts, next) { let totalPassing = 0 let totalFailing = 0 let totalTime = 0 @@ -172,7 +196,7 @@ var runTestFiles = function (filepath, isDirectory, web3) { } async.eachOfLimit(contractsToTest, 1, (contractName, index, cb) => { - TestRunner.runTest(contractName, contracts[contractName], testCallback, (err, result) => { + TestRunner.runTest(contractName, contracts[contractName], contractsToTestDetails[index], { accounts }, testCallback, (err, result) => { if (err) { return cb(err) } diff --git a/remix-tests/src/testRunner.js b/remix-tests/src/testRunner.js index 89493e944b..c22dba71e2 100644 --- a/remix-tests/src/testRunner.js +++ b/remix-tests/src/testRunner.js @@ -2,6 +2,20 @@ var async = require('async') var changeCase = require('change-case') var Web3 = require('web3') +function getFunctionFullName (signature, methodIdentifiers) { + for (var method in methodIdentifiers) { + if (signature.replace('0x', '') === methodIdentifiers[method].replace('0x', '')) { + return method + } + } + return null +} + +function getOverridedSender (userdoc, signature, methodIdentifiers) { + let fullName = getFunctionFullName(signature, methodIdentifiers) + return fullName && userdoc.methods[fullName] ? userdoc.methods[fullName].notice : null +} + function getAvailableFunctions (jsonInterface) { return jsonInterface.reverse().filter((x) => x.type === 'function').map((x) => x.name) } @@ -24,7 +38,7 @@ function createRunList (jsonInterface) { if (availableFunctions.indexOf('beforeEach') >= 0) { runList.push({name: 'beforeEach', type: 'internal', constant: false}) } - runList.push({name: func.name, type: 'test', constant: func.constant}) + runList.push({name: func.name, signature: func.signature, type: 'test', constant: func.constant}) if (availableFunctions.indexOf('afterEach') >= 0) { runList.push({name: 'afterEach', type: 'internal', constant: false}) } @@ -37,7 +51,7 @@ function createRunList (jsonInterface) { return runList } -function runTest (testName, testObject, testCallback, resultsCallback) { +function runTest (testName, testObject, contractDetails, opts, testCallback, resultsCallback) { let runList = createRunList(testObject._jsonInterface) let passingNum = 0 @@ -45,12 +59,32 @@ function runTest (testName, testObject, testCallback, resultsCallback) { let timePassed = 0 let web3 = new Web3() + var userAgent = (typeof (navigator) !== 'undefined') && navigator.userAgent ? navigator.userAgent.toLowerCase() : '-' + var isBrowser = !(typeof (window) === 'undefined' || userAgent.indexOf(' electron/') > -1) + if (!isBrowser) { + let signale = require('signale') + signale.warn('DO NOT TRY TO ACCESS (IN YOUR SOLIDITY TEST) AN ACCOUNT GREATER THAN THE LENGTH OF THE FOLLOWING ARRAY (' + opts.accounts.length + ') :') + signale.warn(opts.accounts) + signale.warn('e.g: the following code won\'t work in the current context:') + signale.warn('TestsAccounts.getAccount(' + opts.accounts.length + ')') + } + testCallback({type: 'contract', value: testName, filename: testObject.filename}) async.eachOfLimit(runList, 1, function (func, index, next) { + let sender + if (func.signature) { + sender = getOverridedSender(contractDetails.userdoc, func.signature, contractDetails.evm.methodIdentifiers) + if (opts.accounts) { + sender = opts.accounts[sender] + } + } + let sendParams + if (sender) sendParams = { from: sender } + let method = testObject.methods[func.name].apply(testObject.methods[func.name], []) let startTime = Date.now() if (func.constant) { - method.call().then((result) => { + method.call(sendParams).then((result) => { let time = Math.ceil((Date.now() - startTime) / 1000.0) if (result) { testCallback({type: 'testPass', value: changeCase.sentenceCase(func.name), time: time, context: testName}) @@ -63,7 +97,7 @@ function runTest (testName, testObject, testCallback, resultsCallback) { next() }) } else { - method.send().on('receipt', function (receipt) { + method.send(sendParams).on('receipt', function (receipt) { try { let time = Math.ceil((Date.now() - startTime) / 1000.0) let topic = Web3.utils.sha3('AssertionEvent(bool,string)') @@ -95,6 +129,7 @@ function runTest (testName, testObject, testCallback, resultsCallback) { return next(err) } }).on('error', function (err) { + console.error(err) next(err) }) } diff --git a/remix-tests/tests/testRunner.js b/remix-tests/tests/testRunner.js index ccdd0c84b7..1c6d00f335 100644 --- a/remix-tests/tests/testRunner.js +++ b/remix-tests/tests/testRunner.js @@ -10,18 +10,27 @@ const Provider = require('remix-simulator').Provider function compileAndDeploy (filename, callback) { let web3 = new Web3() web3.setProvider(new Provider()) - + let compilationData + let accounts async.waterfall([ + function getAccountList (next) { + web3.eth.getAccounts((_err, _accounts) => { + accounts = _accounts + next(_err) + }) + }, function compile (next) { - Compiler.compileFileOrFiles(filename, false, next) + Compiler.compileFileOrFiles(filename, false, {accounts}, next) }, function deployAllContracts (compilationResult, next) { + compilationData = compilationResult Deployer.deployAll(compilationResult, web3, next) } ], function (_err, contracts) { - callback(null, contracts) + callback(null, compilationData, contracts, accounts) }) -} +} + describe('testRunner', function () { describe('#runTest', function() { @@ -30,7 +39,7 @@ describe('testRunner', function () { let tests = [], results = {} before(function (done) { - compileAndDeploy(filename, function (_err, contracts) { + compileAndDeploy(filename, function (_err, compilationData, contracts, accounts) { var testCallback = function (test) { tests.push(test) } @@ -38,7 +47,7 @@ describe('testRunner', function () { results = _results done() } - TestRunner.runTest('MyTest', contracts.MyTest, testCallback, resultsCallback) + TestRunner.runTest('MyTest', contracts.MyTest, compilationData['simple_storage_test.sol']['MyTest'], { accounts }, testCallback, resultsCallback) }) }) @@ -66,7 +75,7 @@ describe('testRunner', function () { let tests = [], results = {} before(function (done) { - compileAndDeploy(filename, function (_err, contracts) { + compileAndDeploy(filename, function (_err, compilationData, contracts, accounts) { var testCallback = function (test) { tests.push(test) } @@ -74,7 +83,7 @@ describe('testRunner', function () { results = _results done() } - TestRunner.runTest('MyTest', contracts.MyTest, testCallback, resultsCallback) + TestRunner.runTest('MyTest', contracts.MyTest, compilationData['simple_storage_test.sol']['MyTest'], { accounts }, testCallback, resultsCallback) }) }) @@ -101,7 +110,7 @@ describe('testRunner', function () { let tests = [], results = {} before(function (done) { - compileAndDeploy(filename, function (_err, contracts) { + compileAndDeploy(filename, function (_err, compilationData, contracts, accounts) { var testCallback = function (test) { tests.push(test) } @@ -109,8 +118,8 @@ describe('testRunner', function () { results = _results done() } - TestRunner.runTest('StringTest', contracts.StringTest, testCallback, resultsCallback) - TestRunner.runTest('StringTest2', contracts.StringTest2, testCallback, resultsCallback) + TestRunner.runTest('StringTest', contracts.StringTest, compilationData['simple_string_test.sol']['StringTest'], { accounts }, testCallback, resultsCallback) + TestRunner.runTest('StringTest2', contracts.StringTest2, compilationData['simple_string_test.sol']['StringTest2'], { accounts }, testCallback, resultsCallback) }) }) @@ -138,7 +147,7 @@ describe('testRunner', function () { let tests = [], results = {} before(function (done) { - compileAndDeploy(filename, function (_err, contracts) { + compileAndDeploy(filename, function (_err, compilationData, contracts, accounts) { var testCallback = function (test) { tests.push(test) } @@ -146,7 +155,7 @@ describe('testRunner', function () { results = _results done() } - TestRunner.runTest('IntegerTest', contracts.IntegerTest, testCallback, resultsCallback) + TestRunner.runTest('IntegerTest', contracts.IntegerTest, compilationData['number_test.sol']['IntegerTest'], { accounts }, testCallback, resultsCallback) }) }) @@ -157,5 +166,33 @@ describe('testRunner', function () { assert.equal(results.failureNum, 2) }) }) + + // Test Transaction with different sender + describe('various sender', function () { + let filename = 'tests/various_sender/sender_test.sol' + let tests = [], results = {} + + before(function (done) { + compileAndDeploy(filename, function (_err, compilationData, contracts, accounts) { + var testCallback = function (test) { + tests.push(test) + } + var resultsCallback = function (_err, _results) { + results = _results + done() + } + + TestRunner.runTest('SenderTest', contracts.SenderTest, compilationData['sender_test.sol']['SenderTest'], { accounts }, testCallback, resultsCallback) + + }) + }) + + it('should have 4 passing tests', function () { + assert.equal(results.passingNum, 4) + }) + it('should have 1 failing tests', function () { + assert.equal(results.failureNum, 0) + }) + }) }) }) diff --git a/remix-tests/tests/various_sender/sender_test.sol b/remix-tests/tests/various_sender/sender_test.sol new file mode 100644 index 0000000000..896c145447 --- /dev/null +++ b/remix-tests/tests/various_sender/sender_test.sol @@ -0,0 +1,28 @@ +pragma solidity ^0.4.7; +import "remix_tests.sol"; // this import is automatically injected by Remix. +import "remix_accounts.sol"; + +contract SenderTest { + + function beforeAll () {} + + /// 1 + function checkSenderIs1 () public { + Assert.equal(msg.sender, TestsAccounts.getAccount(1), "wrong sender in checkSenderIs1"); + } + + /// 0 + function checkSenderIs0 () public { + Assert.equal(msg.sender, TestsAccounts.getAccount(0), "wrong sender in checkSenderIs0"); + } + + /// 1 + function checkSenderIsNt0 () public { + Assert.notEqual(msg.sender, TestsAccounts.getAccount(0), "wrong sender in checkSenderIsNot0"); + } + + /// 2 + function checkSenderIsnt2 () public { + Assert.notEqual(msg.sender, TestsAccounts.getAccount(1), "wrong sender in checkSenderIsnt2"); + } +} From 6d296658b50263925d9850b3329ca9f3dca5ee8b Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 23 Oct 2018 10:01:07 +0200 Subject: [PATCH 08/32] Update unittesting_tab.md --- docs/unittesting_tab.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/unittesting_tab.md b/docs/unittesting_tab.md index e128529dcd..db82d713ec 100644 --- a/docs/unittesting_tab.md +++ b/docs/unittesting_tab.md @@ -24,6 +24,8 @@ This execute tests. The execution is run in a separate environment and the resul | `Assert.greaterThan()` | `uint`, `int` | | `Assert.lesserThan()` | `uint`, `int` | +see [https://github.com/ethereum/remix/blob/master/remix-tests/tests/examples_4/SafeMath_test.sol](https://github.com/ethereum/remix/blob/master/remix-tests/tests/examples_4/SafeMath_test.sol) for some code sample + Continuous integration ---------------------- From 001142fc9b6548b785925ac8732154acde2f08c1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 23 Oct 2018 13:17:33 +0200 Subject: [PATCH 09/32] Update compiler.js --- remix-solidity/src/compiler/compiler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-solidity/src/compiler/compiler.js b/remix-solidity/src/compiler/compiler.js index 1eeec59da7..72427c22cb 100644 --- a/remix-solidity/src/compiler/compiler.js +++ b/remix-solidity/src/compiler/compiler.js @@ -313,7 +313,7 @@ function Compiler (handleImportCall) { while ((match = importRegex.exec(files[fileName].content))) { var importFilePath = match[1] if (importFilePath.startsWith('./')) { - var path = /(.*\/).*/.exec(target) + var path = /(.*\/).*/.exec(fileName) if (path !== null) { importFilePath = importFilePath.replace('./', path[1]) } else { From d3c6210c4e47479dc629f234e1b5f111b9163182 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 24 Oct 2018 11:25:54 +0200 Subject: [PATCH 10/32] publishing --- package.json | 7 +++++-- remix-solidity/package.json | 2 +- remix-tests/package.json | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1785d6104b..785dc81e63 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,15 @@ { - "version": "0.1.0", + "version": "0.1.1", "devDependencies": { "gulp": "^3.9.1", "lerna": "^2.10.2" }, "scripts": { + "diff": "lerna diff", + "updated": "lerna updated", "bootstrap": "lerna bootstrap", "publish": "lerna publish", - "release": "lerna bootstrap; lerna publish; gulp; gulp publishTag;" + "release": "lerna bootstrap; lerna publish;", + "tag": "gulp; gulp publishTag;" } } diff --git a/remix-solidity/package.json b/remix-solidity/package.json index bf856ec5c4..ac279f668b 100644 --- a/remix-solidity/package.json +++ b/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "remix-solidity", - "version": "0.2.10", + "version": "0.2.11", "description": "Ethereum IDE and tools for the web", "contributors": [ { diff --git a/remix-tests/package.json b/remix-tests/package.json index 5075f4bc2d..c069cc67a5 100644 --- a/remix-tests/package.json +++ b/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "remix-tests", - "version": "0.0.15", + "version": "0.0.16", "description": "Tests for the Ethereum tool suite Remix", "main": "./src/index.js", "contributors": [ @@ -43,7 +43,7 @@ "commander": "^2.13.0", "remix-lib": "0.3.10", "remix-simulator": "^0.0.4", - "remix-solidity": "0.2.10", + "remix-solidity": "0.2.11", "signale": "^1.2.1", "solc": "^0.4.24", "standard": "^10.0.3", From b2b18d49c1bd2b988034bd5b89d874c6f4b2d7ec Mon Sep 17 00:00:00 2001 From: William Entriken Date: Wed, 24 Oct 2018 20:03:23 -0400 Subject: [PATCH 11/32] Compile if solidity is fixed version, fixes #1011 --- remix-tests/src/compiler.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/remix-tests/src/compiler.js b/remix-tests/src/compiler.js index f43a9cab65..c65bdadeca 100644 --- a/remix-tests/src/compiler.js +++ b/remix-tests/src/compiler.js @@ -26,12 +26,12 @@ function compileFileOrFiles (filename, isDirectory, cb) { filepath = (isDirectory ? filename : path.dirname(filename)) fs.readdirSync(filepath).forEach(file => { - // only process .sol files - if (file.split('.').pop() === 'sol') { + // only process .sol files named *_test.sol + if (/_test.sol$/.test(file)) { let c = fs.readFileSync(path.join(filepath, file)).toString() const s = /^(import)\s['"](remix_tests.sol|tests.sol)['"];/gm - if (file.indexOf('_test.sol') > 0 && c.regexIndexOf(s) < 0) { - c = c.replace(/(pragma solidity \^\d+\.\d+\.\d+;)/, '$1\nimport \'remix_tests.sol\';') + if (!s.test(c)) { + c = c.replace(/(pragma solidity \^?\d+\.\d+\.\d+;)/, '$1\nimport \'remix_tests.sol\';') } sources[file] = { content: c } } From b8706daa3dca584536333a4f2c3c4bf79cc6037e Mon Sep 17 00:00:00 2001 From: William Entriken Date: Wed, 24 Oct 2018 20:40:10 -0400 Subject: [PATCH 12/32] Easier fix --- remix-tests/src/compiler.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/remix-tests/src/compiler.js b/remix-tests/src/compiler.js index c65bdadeca..09a1f8f89e 100644 --- a/remix-tests/src/compiler.js +++ b/remix-tests/src/compiler.js @@ -26,16 +26,16 @@ function compileFileOrFiles (filename, isDirectory, cb) { filepath = (isDirectory ? filename : path.dirname(filename)) fs.readdirSync(filepath).forEach(file => { - // only process .sol files named *_test.sol - if (/_test.sol$/.test(file)) { + // only process .sol files + if (file.split('.').pop() === 'sol') { let c = fs.readFileSync(path.join(filepath, file)).toString() const s = /^(import)\s['"](remix_tests.sol|tests.sol)['"];/gm - if (!s.test(c)) { + if (file.indexOf('_test.sol') > 0 && c.regexIndexOf(s) < 0) { c = c.replace(/(pragma solidity \^?\d+\.\d+\.\d+;)/, '$1\nimport \'remix_tests.sol\';') } sources[file] = { content: c } } - }) + }) async.waterfall([ function loadCompiler (next) { From a285eef49f842650dff4464a0d5f187015677637 Mon Sep 17 00:00:00 2001 From: William Entriken Date: Wed, 24 Oct 2018 20:40:39 -0400 Subject: [PATCH 13/32] 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 09a1f8f89e..82c63a56f2 100644 --- a/remix-tests/src/compiler.js +++ b/remix-tests/src/compiler.js @@ -35,7 +35,7 @@ function compileFileOrFiles (filename, isDirectory, cb) { } sources[file] = { content: c } } - }) + }) async.waterfall([ function loadCompiler (next) { From c2ee295c87765c501cd289ca5de0673931ecc0f4 Mon Sep 17 00:00:00 2001 From: William Entriken Date: Fri, 26 Oct 2018 00:03:47 -0400 Subject: [PATCH 14/32] Link to example project that uses Travis + Remix-tests --- remix-tests/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/remix-tests/README.md b/remix-tests/README.md index f18a3f48e4..f00c69208c 100644 --- a/remix-tests/README.md +++ b/remix-tests/README.md @@ -43,6 +43,8 @@ contract MyTest { } ``` +See also: example [Su Squares contract](https://github.com/su-squares/ethereum-contract/tree/e542f37d4f8f6c7b07d90a6554424268384a4186) and [https://travis-ci.org/su-squares/ethereum-contract/builds/446186067](Travis build) that uses remix-tests for continuous integration testing. + Available special functions: * `beforeEach()` - runs before each test * `beforeAll()` - runs before all tests From b30f3eb4021874807b1729f4e55e6115d586f75c Mon Sep 17 00:00:00 2001 From: William Entriken Date: Fri, 26 Oct 2018 00:06:17 -0400 Subject: [PATCH 15/32] Link to example project using remix-test with CI --- docs/unittesting_tab.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/unittesting_tab.md b/docs/unittesting_tab.md index db82d713ec..df12a1a320 100644 --- a/docs/unittesting_tab.md +++ b/docs/unittesting_tab.md @@ -31,3 +31,5 @@ Continuous integration remix-tests is also a CLI, it can be used in a continuous integration environement which support node.js. Please find more information in the [remix-test repository](https://github.com/ethereum/remix/tree/master/remix-tests) + +See also: example [Su Squares contract](https://github.com/su-squares/ethereum-contract/tree/e542f37d4f8f6c7b07d90a6554424268384a4186) and [https://travis-ci.org/su-squares/ethereum-contract/builds/446186067](Travis build) that uses remix-tests for continuous integration testing. From 70e75614a3402512e808add1059d0074ed4b5430 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 1 Nov 2018 16:45:12 +0100 Subject: [PATCH 16/32] Update README.md --- remix-tests/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/remix-tests/README.md b/remix-tests/README.md index f18a3f48e4..57a0b199ad 100644 --- a/remix-tests/README.md +++ b/remix-tests/README.md @@ -1,5 +1,3 @@ -[![Build Status](https://travis-ci.org/ethereum/remix-tests.svg?branch=master)](https://travis-ci.org/ethereum/remix-tests) - Remix-Tests --- From eae459df3711e537e800cff957cc40d72f629907 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 1 Nov 2018 16:50:23 +0100 Subject: [PATCH 17/32] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a8fcbdcc05..ab7233986b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Remix [![Join the chat at https://gitter.im/ethereum/remix](https://badges.gitter.im/ethereum/remix.svg)](https://gitter.im/ethereum/remix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![CircleCI](https://circleci.com/gh/ethereum/remix.svg?style=svg)](https://circleci.com/gh/ethereum/remix) +[![CircleCI](https://circleci.com/gh/ethereum/remix/tree/master.svg?style=svg)](https://circleci.com/gh/ethereum/remix/tree/master) [![Documentation Status](https://readthedocs.org/projects/docs/badge/?version=latest)](https://remix.readthedocs.io/en/latest/) Ethereum tools for the web. From ff5bf089aea7aa07d6fc1bfc7b72fd8dcad946f8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 1 Nov 2018 22:38:49 +0100 Subject: [PATCH 18/32] Delete .travis.yml --- .travis.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8db3013e25..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: node_js -node_js: - - stable -env: - - TEST_DIR=remix-lib - - TEST_DIR=remix-solidity - - TEST_DIR=remix-debug - - TEST_DIR=remix-tests - - TEST_DIR=remix-simulator -script: - - cd $TEST_DIR && npm install && npm test -deploy: - provider: script - script: remix-debugger/ci/deploy_from_travis.sh - skip_cleanup: true - on: - branch: master - condition: $TEST_DIR = remix-debugger -cache: false From 7c391f2a57ca608ceef146d3db5c40a74e5137df Mon Sep 17 00:00:00 2001 From: yann300 Date: Sat, 3 Nov 2018 17:17:38 +0100 Subject: [PATCH 19/32] addRemixd --- .gitmodules | 3 +++ remixd | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 remixd diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..dd7bf5c3ad --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "remixd"] + path = remixd + url = https://github.com/ethereum/remixd diff --git a/remixd b/remixd new file mode 160000 index 0000000000..1a9ec3230e --- /dev/null +++ b/remixd @@ -0,0 +1 @@ +Subproject commit 1a9ec3230e7a3c278ddc6344e5c89d488a316910 From a1455c864f95dc2f12a86af17a1b23893246f4d9 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 6 Nov 2018 16:49:24 +0100 Subject: [PATCH 20/32] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ab7233986b..631f5907dd 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Remix is built out of several different modules: + [`remix-lib`](remix-lib/README.md) + [`remix-debug`](remix-debugger/README.md) is now *deprecated*. It contains the debugger. + [`remix-tests`](remix-tests/README.md) contains our tests. ++ [`remixd`](remixd/README.md) CLI which allow accessing local element from Remix IDE (see https://remix.readthedocs.io/en/latest/tutorial_remixd_filesystem.html) Each generally has their own npm package and test suite, as well as basic documentation. From 8a4a15108e1cc6b210ef8bcca023f803740b9a98 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 6 Nov 2018 16:51:28 +0100 Subject: [PATCH 21/32] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 631f5907dd..30012a3add 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Remix is built out of several different modules: + [`remix-lib`](remix-lib/README.md) + [`remix-debug`](remix-debugger/README.md) is now *deprecated*. It contains the debugger. + [`remix-tests`](remix-tests/README.md) contains our tests. -+ [`remixd`](remixd/README.md) CLI which allow accessing local element from Remix IDE (see https://remix.readthedocs.io/en/latest/tutorial_remixd_filesystem.html) ++ [`remixd`](https://github.com/ethereum/remixd/tree/master) CLI which allow accessing local element from Remix IDE (see https://remix.readthedocs.io/en/latest/tutorial_remixd_filesystem.html) Each generally has their own npm package and test suite, as well as basic documentation. From fc6a27d0f89e61d1f0eaa5ab13b12e915b3a6339 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Nov 2018 12:42:58 +0100 Subject: [PATCH 22/32] add missing field to receipt (status) --- remix-lib/src/web3Provider/web3VmProvider.js | 1 + remix-simulator/src/methods/transactions.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/remix-lib/src/web3Provider/web3VmProvider.js b/remix-lib/src/web3Provider/web3VmProvider.js index 189a44617e..17f3a644a7 100644 --- a/remix-lib/src/web3Provider/web3VmProvider.js +++ b/remix-lib/src/web3Provider/web3VmProvider.js @@ -122,6 +122,7 @@ web3VmProvider.prototype.txProcessed = function (self, data) { } self.txsReceipt[self.processingHash].logs = logs self.txsReceipt[self.processingHash].transactionHash = self.processingHash + self.txsReceipt[self.processingHash].status = '0x' + data.vm.exception.toString(16) if (data.createdAddress) { var address = util.hexConvert(data.createdAddress) diff --git a/remix-simulator/src/methods/transactions.js b/remix-simulator/src/methods/transactions.js index 53834ea7dd..1e0f315d2c 100644 --- a/remix-simulator/src/methods/transactions.js +++ b/remix-simulator/src/methods/transactions.js @@ -39,7 +39,7 @@ Transactions.prototype.eth_getTransactionReceipt = function (payload, cb) { 'cumulativeGasUsed': '0x06345f', 'contractAddress': receipt.contractAddress, 'logs': receipt.logs, - 'status': 1 + 'status': receipt.status } cb(null, r) From 1aae6e549a625fa3a0cf826b928fc230a2f36fb3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Nov 2018 12:43:47 +0100 Subject: [PATCH 23/32] fix parameters consistency --- remix-tests/src/compiler.js | 2 +- remix-tests/src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/remix-tests/src/compiler.js b/remix-tests/src/compiler.js index d143db5f43..476c8ea881 100644 --- a/remix-tests/src/compiler.js +++ b/remix-tests/src/compiler.js @@ -71,7 +71,7 @@ function compileFileOrFiles (filename, isDirectory, opts, cb) { }) } -function compileContractSources (sources, importFileCb, cb, opts) { +function compileContractSources (sources, importFileCb, opts, cb) { let compiler, filepath let accounts = opts.accounts || [] // Iterate over sources keys. Inject test libraries. Inject test library import statements. diff --git a/remix-tests/src/index.js b/remix-tests/src/index.js index baf9c8d674..91aa7e3a01 100644 --- a/remix-tests/src/index.js +++ b/remix-tests/src/index.js @@ -29,7 +29,7 @@ var runTestSources = function (contractSources, testCallback, resultCallback, fi }) }, function compile (next) { - Compiler.compileContractSources(contractSources, importFileCb, next) + Compiler.compileContractSources(contractSources, importFileCb, { accounts }, next) }, function deployAllContracts (compilationResult, next) { Deployer.deployAll(compilationResult, web3, function (err, contracts) { From 19c61f10dfa8539281283d4e2a4d4737eeb6cc06 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Nov 2018 12:44:15 +0100 Subject: [PATCH 24/32] forward error to resultsCallback --- remix-tests/src/testRunner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remix-tests/src/testRunner.js b/remix-tests/src/testRunner.js index c22dba71e2..7c804b91c9 100644 --- a/remix-tests/src/testRunner.js +++ b/remix-tests/src/testRunner.js @@ -133,8 +133,8 @@ function runTest (testName, testObject, contractDetails, opts, testCallback, res next(err) }) } - }, function () { - resultsCallback(null, { + }, function (error) { + resultsCallback(error, { passingNum: passingNum, failureNum: failureNum, timePassed: timePassed From 4f5b6315a93e40d16f79cd1783c8ccd1df7b35b3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Nov 2018 12:45:43 +0100 Subject: [PATCH 25/32] web3 bump used version --- 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 c069cc67a5..fff8f71330 100644 --- a/remix-tests/package.json +++ b/remix-tests/package.json @@ -47,7 +47,7 @@ "signale": "^1.2.1", "solc": "^0.4.24", "standard": "^10.0.3", - "web3": "1.0.0-beta.34", + "web3": "1.0.0-beta.36", "winston": "^3.0.0" }, "peerDependencies": { From a76a724bc068009483f467a42c686f706c032c39 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Nov 2018 12:46:00 +0100 Subject: [PATCH 26/32] used fixed version as for the other module --- remix-simulator/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-simulator/package.json b/remix-simulator/package.json index f024401e6f..8f143db970 100644 --- a/remix-simulator/package.json +++ b/remix-simulator/package.json @@ -23,7 +23,7 @@ "express": "^4.16.3", "fast-async": "^6.3.7", "merge": "^1.2.0", - "remix-lib": "^0.2.5", + "remix-lib": "0.3.10", "standard": "^10.0.3", "time-stamp": "^2.0.0", "web3": "1.0.0-beta.27" From 379dbfac20c34d16d8aba09adc421e1b747ba0ac Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Nov 2018 12:51:24 +0100 Subject: [PATCH 27/32] add missing dep --- remix-simulator/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/remix-simulator/package.json b/remix-simulator/package.json index 8f143db970..1e5510f4b3 100644 --- a/remix-simulator/package.json +++ b/remix-simulator/package.json @@ -15,6 +15,7 @@ "main": "./index.js", "dependencies": { "ansi-gray": "^0.1.1", + "babel-eslint": "^7.1.1", "babel-plugin-transform-object-assign": "^6.22.0", "babel-preset-es2017": "^6.24.1", "babelify": "^7.3.0", From f5fa2d1d635959e043c208f91188cdda830acb9c Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 15 Nov 2018 10:01:14 +0100 Subject: [PATCH 28/32] publish --- remix-simulator/package.json | 2 +- remix-tests/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/remix-simulator/package.json b/remix-simulator/package.json index f024401e6f..a0338febed 100644 --- a/remix-simulator/package.json +++ b/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "remix-simulator", - "version": "0.0.4", + "version": "0.0.5", "description": "Ethereum IDE and tools for the web", "contributors": [ { diff --git a/remix-tests/package.json b/remix-tests/package.json index c069cc67a5..67293ad871 100644 --- a/remix-tests/package.json +++ b/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "remix-tests", - "version": "0.0.16", + "version": "0.0.17", "description": "Tests for the Ethereum tool suite Remix", "main": "./src/index.js", "contributors": [ @@ -42,7 +42,7 @@ "colors": "^1.1.2", "commander": "^2.13.0", "remix-lib": "0.3.10", - "remix-simulator": "^0.0.4", + "remix-simulator": "0.0.5", "remix-solidity": "0.2.11", "signale": "^1.2.1", "solc": "^0.4.24", From 1e63ab6ab1537db2712e08653206312ba8a217ec Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 15 Nov 2018 10:16:02 +0100 Subject: [PATCH 29/32] bump --- remix-analyzer/package.json | 4 ++-- remix-debug/package.json | 4 ++-- remix-lib/package.json | 2 +- remix-simulator/package.json | 4 ++-- remix-solidity/package.json | 4 ++-- remix-tests/package.json | 8 ++++---- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/remix-analyzer/package.json b/remix-analyzer/package.json index 244e89be34..a4bf9c2aff 100644 --- a/remix-analyzer/package.json +++ b/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "remix-analyzer", - "version": "0.2.10", + "version": "0.2.11", "description": "Remix Analyzer", "main": "./index.js", "contributors": [ @@ -21,7 +21,7 @@ "babel-eslint": "^7.1.1", "babel-plugin-transform-object-assign": "^6.22.0", "babel-preset-es2015": "^6.24.0", - "remix-lib": "0.3.10", + "remix-lib": "0.3.11", "solc": "^0.4.24", "standard": "^7.0.1", "tape": "^4.6.0" diff --git a/remix-debug/package.json b/remix-debug/package.json index 79a44e2662..35cac15450 100644 --- a/remix-debug/package.json +++ b/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "remix-debug", - "version": "0.2.11", + "version": "0.2.12", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -23,7 +23,7 @@ "fast-async": "^6.1.2", "notify-error": "^1.2.0", "npm-run-all": "^4.1.2", - "remix-lib": "0.3.10", + "remix-lib": "0.3.11", "solc": "^0.4.24" }, "devDependencies": { diff --git a/remix-lib/package.json b/remix-lib/package.json index 6be93a55d2..947723c668 100644 --- a/remix-lib/package.json +++ b/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "remix-lib", - "version": "0.3.10", + "version": "0.3.11", "description": "Ethereum IDE and tools for the web", "contributors": [ { diff --git a/remix-simulator/package.json b/remix-simulator/package.json index ace52268ea..0efe18ee2c 100644 --- a/remix-simulator/package.json +++ b/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "remix-simulator", - "version": "0.0.5", + "version": "0.0.6", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -24,7 +24,7 @@ "express": "^4.16.3", "fast-async": "^6.3.7", "merge": "^1.2.0", - "remix-lib": "0.3.10", + "remix-lib": "0.3.11", "standard": "^10.0.3", "time-stamp": "^2.0.0", "web3": "1.0.0-beta.27" diff --git a/remix-solidity/package.json b/remix-solidity/package.json index ac279f668b..43bc61e0fe 100644 --- a/remix-solidity/package.json +++ b/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "remix-solidity", - "version": "0.2.11", + "version": "0.2.12", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -22,7 +22,7 @@ "ethereumjs-vm": "^2.3.3", "fast-async": "^6.1.2", "npm-run-all": "^4.0.2", - "remix-lib": "0.3.10", + "remix-lib": "0.3.11", "solc": "^0.4.24", "standard": "^7.0.1", "tape": "^4.6.0", diff --git a/remix-tests/package.json b/remix-tests/package.json index 6bfdde3918..07fb8a00c4 100644 --- a/remix-tests/package.json +++ b/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "remix-tests", - "version": "0.0.17", + "version": "0.0.18", "description": "Tests for the Ethereum tool suite Remix", "main": "./src/index.js", "contributors": [ @@ -41,9 +41,9 @@ "change-case": "^3.0.1", "colors": "^1.1.2", "commander": "^2.13.0", - "remix-lib": "0.3.10", - "remix-simulator": "0.0.5", - "remix-solidity": "0.2.11", + "remix-lib": "0.3.11", + "remix-simulator": "0.0.6", + "remix-solidity": "0.2.12", "signale": "^1.2.1", "solc": "^0.4.24", "standard": "^10.0.3", From 6f76e22fabadc6b25a640ccbc2fa66fde90e31f6 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 15 Nov 2018 10:54:22 +0100 Subject: [PATCH 30/32] incr root package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 785dc81e63..b5e4ef1d69 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.1.1", + "version": "0.1.2", "devDependencies": { "gulp": "^3.9.1", "lerna": "^2.10.2" From 6a2e31118246dafea49295ab6d4adb49c9e48c16 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 15 Nov 2018 11:27:46 +0100 Subject: [PATCH 31/32] Create release-process.md --- release-process.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 release-process.md diff --git a/release-process.md b/release-process.md new file mode 100644 index 0000000000..7371e3f95d --- /dev/null +++ b/release-process.md @@ -0,0 +1,15 @@ +# Release process +This document details step for publishing packages and tag the code base accordingly: + +- checkout a new branch +- npm run publish +- commit +- increment root package.json version +- commit +- merge the branch +- fetch origin/master +- checkout origin/master +- npm run tag +- github-changes -o ethereum -r remix -a --only-pulls --use-commit-body --only-merges --between-tags ... +- create a new release out of the changelog.md +- in changelog put list of published packages with version From 365fbd9fcf3ad50e9ca3788b6cc57dc97a4173ce Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 15 Nov 2018 11:31:52 +0100 Subject: [PATCH 32/32] Update release-process.md --- release-process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-process.md b/release-process.md index 7371e3f95d..405ce367e7 100644 --- a/release-process.md +++ b/release-process.md @@ -1,5 +1,5 @@ # Release process -This document details step for publishing packages and tag the code base accordingly: +This document details steps for publishing packages and tag the code base accordingly: - checkout a new branch - npm run publish