From dfd564ad03d644b97ff801813b49e7dee0192ec9 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Tue, 7 Nov 2017 16:22:32 -0800 Subject: [PATCH 1/2] Do not preprocess view and constant --- lib/app.js | 4 ---- package.json | 2 +- test/sources/cli/PureView.sol | 3 ++- test/sources/cli/TotallyPure.sol | 3 ++- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/app.js b/lib/app.js index a0b3bbe..0bec678 100644 --- a/lib/app.js +++ b/lib/app.js @@ -285,14 +285,10 @@ class App { postProcessPure(env) { shell.ls(`${env}/**/*.sol`).forEach(file => { const pureRe = /\spure\s/gi; - const viewRe = /\sview\s/gi; - const constantRe = /\sconstant\s/gi; const contractPath = this.platformNeutralPath(file); let contract = fs.readFileSync(contractPath).toString(); contract = contract.replace(pureRe, ' '); - contract = contract.replace(viewRe, ' '); - contract = contract.replace(constantRe, ' '); fs.writeFileSync(contractPath, contract); }) } diff --git a/package.json b/package.json index 7a3a570..efd37da 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ "ethereumjs-vm": "https://github.com/sc-forks/ethereumjs-vm-sc.git#a5f797299d0e96214af739be3bea4d0e15499c0d", "merkle-patricia-tree": "~2.1.2", "mocha": "^3.1.0", - "solc": "0.4.17", "request": "^2.81.0", + "solc": "0.4.17", "truffle": "4.0.0-beta.2" } } diff --git a/test/sources/cli/PureView.sol b/test/sources/cli/PureView.sol index c13653d..8a74918 100644 --- a/test/sources/cli/PureView.sol +++ b/test/sources/cli/PureView.sol @@ -1,4 +1,5 @@ -pragma experimental "v0.5.0"; +//pragma experimental "v0.5.0"; +pragma solidity ^0.4.17; contract PureView { diff --git a/test/sources/cli/TotallyPure.sol b/test/sources/cli/TotallyPure.sol index 2045e3a..cb46fda 100644 --- a/test/sources/cli/TotallyPure.sol +++ b/test/sources/cli/TotallyPure.sol @@ -1,4 +1,5 @@ -pragma experimental "v0.5.0"; +//pragma experimental "v0.5.0"; +pragma solidity ^0.4.17; import "./../assets/PureView.sol"; From a94fcb99219d3af71bbf86b2ab72f9bb2375e710 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Tue, 7 Nov 2017 16:38:04 -0800 Subject: [PATCH 2/2] Use most recent vm-sc fix for tests --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5065ea4..6c11e01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1963,7 +1963,7 @@ } }, "ethereumjs-vm": { - "version": "git+https://github.com/sc-forks/ethereumjs-vm-sc.git#a5f797299d0e96214af739be3bea4d0e15499c0d", + "version": "git+https://github.com/sc-forks/ethereumjs-vm-sc.git#6be86e6f12634b711423203e6744cafe07c38e69", "dev": true, "requires": { "async": "2.6.0", diff --git a/package.json b/package.json index efd37da..a9a885c 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "ethereumjs-account": "~2.0.4", "ethereumjs-tx": "^1.2.2", "ethereumjs-util": "^5.0.1", - "ethereumjs-vm": "https://github.com/sc-forks/ethereumjs-vm-sc.git#a5f797299d0e96214af739be3bea4d0e15499c0d", + "ethereumjs-vm": "https://github.com/sc-forks/ethereumjs-vm-sc.git#6be86e6f12634b711423203e6744cafe07c38e69", "merkle-patricia-tree": "~2.1.2", "mocha": "^3.1.0", "request": "^2.81.0",