From 710dece5440b331bd903e9d2b5473b515d6bf864 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 1 Apr 2019 16:29:15 +0200 Subject: [PATCH 1/6] bump remix libs --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index fbb3c317f5..f97df4c6a2 100644 --- a/package.json +++ b/package.json @@ -42,12 +42,12 @@ "npm-link-local": "^1.1.0", "npm-run-all": "^4.0.2", "onchange": "^3.2.1", - "remix-analyzer": "0.3.1", - "remix-debug": "0.3.1", - "remix-lib": "0.4.1", - "remix-solidity": "0.3.1", + "remix-analyzer": "0.3.2", + "remix-debug": "0.3.2", + "remix-lib": "0.4.2", + "remix-solidity": "0.3.2", "remix-tabs": "^1.0.0", - "remix-tests": "0.1.1", + "remix-tests": "0.1.3", "remixd": "0.1.8-alpha.6", "request": "^2.83.0", "rimraf": "^2.6.1", From 56085ac4043dd52e4d08f3f984ae0c00fc84b8a3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Sat, 1 Dec 2018 17:35:08 +0100 Subject: [PATCH 2/6] jsvm2.5.0 --- src/universal-dapp.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index f5ab1a44ec..85a2d49b8e 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -58,7 +58,6 @@ module.exports = class UniversalDApp extends UdappApi { this._addAccount('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', '0x56BC75E2D63100000') this._addAccount('d74aa6d18aa79a05f3473dd030a97d3305737cbc8337d940344345c1f6b72eea', '0x56BC75E2D63100000') this._addAccount('71975fbf7fe448e004ac7ae54cad0a383c3906055a65468714156a07385e96ce', '0x56BC75E2D63100000') - executionContext.vm().stateManager.cache.flush(function () {}) } // TODO: most params here can be refactored away in txRunner this.txRunner = new TxRunner(this.accounts, { @@ -88,7 +87,6 @@ module.exports = class UniversalDApp extends UdappApi { return new Promise((resolve, reject) => { if (executionContext.getProvider() !== 'vm') return reject('plugin API does not allow creating a new account through web3 connection. Only vm mode is allowed') this._addAccount(privateKey, balance) - executionContext.vm().stateManager.cache.flush(function () {}) privateKey = Buffer.from(privateKey, 'hex') resolve('0x' + ethJSUtil.privateToAddress(privateKey).toString('hex')) }) @@ -108,7 +106,6 @@ module.exports = class UniversalDApp extends UdappApi { privateKey = crypto.randomBytes(32) } while (!ethJSUtil.isValidPrivate(privateKey)) this._addAccount(privateKey, '0x56BC75E2D63100000') - executionContext.vm().stateManager.cache.flush(function () {}) cb(null, '0x' + ethJSUtil.privateToAddress(privateKey).toString('hex')) } } @@ -123,7 +120,15 @@ module.exports = class UniversalDApp extends UdappApi { const address = ethJSUtil.privateToAddress(privateKey) // FIXME: we don't care about the callback, but we should still make this proper - executionContext.vm().stateManager.putAccountBalance(address, balance || '0xf00000000000000001', function cb () {}) + let stateManager = executionContext.vm().stateManager + stateManager.getAccount(address, (error, account) => { + if (error) return console.log(error) + account.balance = balance || '0xf00000000000000001' + stateManager.putAccount(address, account, function cb (error) { + if (error) console.log(error) + }) + }) + this.accounts['0x' + address.toString('hex')] = { privateKey, nonce: 0 } } } @@ -174,11 +179,11 @@ module.exports = class UniversalDApp extends UdappApi { return cb('No accounts?') } - executionContext.vm().stateManager.getAccountBalance(Buffer.from(address, 'hex'), (err, res) => { + executionContext.vm().stateManager.getAccount(Buffer.from(address, 'hex'), (err, res) => { if (err) { cb('Account not found') } else { - cb(null, new BN(res).toString(10)) + cb(null, new BN(res.balance).toString(10)) } }) } From 8b9f09a135adeb2fa177f443d28bd649f4272155 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Apr 2019 12:37:18 +0200 Subject: [PATCH 3/6] bump remix libs --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f97df4c6a2..c140089e9c 100644 --- a/package.json +++ b/package.json @@ -42,12 +42,12 @@ "npm-link-local": "^1.1.0", "npm-run-all": "^4.0.2", "onchange": "^3.2.1", - "remix-analyzer": "0.3.2", - "remix-debug": "0.3.2", - "remix-lib": "0.4.2", - "remix-solidity": "0.3.2", + "remix-analyzer": "0.3.3", + "remix-debug": "0.3.3", + "remix-lib": "0.4.3", + "remix-solidity": "0.3.3", "remix-tabs": "^1.0.0", - "remix-tests": "0.1.3", + "remix-tests": "0.1.4", "remixd": "0.1.8-alpha.6", "request": "^2.83.0", "rimraf": "^2.6.1", From 6be3fea29b0a5872c7d6be1647b497307762c784 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Apr 2019 12:53:05 +0200 Subject: [PATCH 4/6] standard --- package.json | 4 +++- src/universal-dapp.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index c140089e9c..95481cce4a 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "ace-mode-solidity": "^0.1.0", "async": "^2.1.2", "babel-eslint": "^7.1.1", + "babel-plugin-transform-modern-regexp": "0.0.6", "babel-plugin-transform-object-assign": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-plugin-yo-yoify": "^0.3.3", @@ -111,7 +112,8 @@ "transform-es2015-spread", "transform-es2015-parameters", "transform-es2015-destructuring", - "transform-es2015-block-scoping" + "transform-es2015-block-scoping", + "transform-modern-regexp" ] }, "browserify": { diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 85a2d49b8e..3dbeddfa3e 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -124,11 +124,11 @@ module.exports = class UniversalDApp extends UdappApi { stateManager.getAccount(address, (error, account) => { if (error) return console.log(error) account.balance = balance || '0xf00000000000000001' - stateManager.putAccount(address, account, function cb (error) { - if (error) console.log(error) + stateManager.putAccount(address, account, function cb (error) { + if (error) console.log(error) }) }) - + this.accounts['0x' + address.toString('hex')] = { privateKey, nonce: 0 } } } From ee2c830349d4b4a7c401cd147c158c4e8868f812 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 23 Apr 2019 17:48:11 +0200 Subject: [PATCH 5/6] add linkremixdebug script --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 95481cce4a..c10bccdb9e 100644 --- a/package.json +++ b/package.json @@ -154,12 +154,13 @@ "remix-ide": "./bin/remix-ide" }, "scripts": { - "setupremix": "npm run linkremixlib && npm run linkremixsolidity && npm run linkremixsimulator && npm run linkremixtests", + "setupremix": "npm run linkremixdebug && npm run linkremixlib && npm run linkremixsolidity && npm run linkremixsimulator && npm run linkremixtests", "pullremix": "git clone https://github.com/ethereum/remix", "linkremixlib": "cd node_modules && rm -rf remix-lib && ln -s ../../remix/remix-lib remix-lib && cd ..", "linkremixsolidity": "cd node_modules && rm -rf remix-solidity && ln -s ../../remix/remix-solidity remix-solidity && cd ..", "linkremixsimulator": "cd node_modules && rm -rf remix-simulator && ln -s ../../remix/remix-simulator remix-simulator && cd ..", "linkremixtests": "cd node_modules && rm -rf remix-tests && ln -s ../../remix/remix-tests remix-tests && cd ..", + "linkremixdebug": "cd node_modules && rm -rf remix-debug && ln -s ../../remix/remix-debug remix-debug && cd ..", "build": "browserify src/index.js -o build/app.js --exclude solc", "build_debugger": "browserify src/app/debugger/remix-debugger/index.js -o src/app/debugger/remix-debugger/build/app.js", "browsertest": "sleep 5 && npm run nightwatch_local", From 22bd1e33d30ce5940fc9006d04d24f6aed131822 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 23 Apr 2019 18:15:35 +0200 Subject: [PATCH 6/6] use latest remix libs --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c10bccdb9e..2512edbc17 100644 --- a/package.json +++ b/package.json @@ -43,12 +43,12 @@ "npm-link-local": "^1.1.0", "npm-run-all": "^4.0.2", "onchange": "^3.2.1", - "remix-analyzer": "0.3.3", - "remix-debug": "0.3.3", - "remix-lib": "0.4.3", - "remix-solidity": "0.3.3", + "remix-analyzer": "0.3.5", + "remix-debug": "0.3.5", + "remix-lib": "0.4.5", + "remix-solidity": "0.3.5", "remix-tabs": "^1.0.0", - "remix-tests": "0.1.4", + "remix-tests": "0.1.6", "remixd": "0.1.8-alpha.6", "request": "^2.83.0", "rimraf": "^2.6.1",