Merge pull request #145 from sc-forks/revert-constant-is-view

Do not preprocess view and constant
fix/constant-pure-view
c-g-e-w-e-k-e- 7 years ago committed by GitHub
commit bb77d270a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      lib/app.js
  2. 2
      package-lock.json
  3. 4
      package.json
  4. 3
      test/sources/cli/PureView.sol
  5. 3
      test/sources/cli/TotallyPure.sol

@ -285,14 +285,10 @@ class App {
postProcessPure(env) { postProcessPure(env) {
shell.ls(`${env}/**/*.sol`).forEach(file => { shell.ls(`${env}/**/*.sol`).forEach(file => {
const pureRe = /\spure\s/gi; const pureRe = /\spure\s/gi;
const viewRe = /\sview\s/gi;
const constantRe = /\sconstant\s/gi;
const contractPath = this.platformNeutralPath(file); const contractPath = this.platformNeutralPath(file);
let contract = fs.readFileSync(contractPath).toString(); let contract = fs.readFileSync(contractPath).toString();
contract = contract.replace(pureRe, ' '); contract = contract.replace(pureRe, ' ');
contract = contract.replace(viewRe, ' ');
contract = contract.replace(constantRe, ' ');
fs.writeFileSync(contractPath, contract); fs.writeFileSync(contractPath, contract);
}) })
} }

2
package-lock.json generated

@ -1963,7 +1963,7 @@
} }
}, },
"ethereumjs-vm": { "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, "dev": true,
"requires": { "requires": {
"async": "2.6.0", "async": "2.6.0",

@ -40,11 +40,11 @@
"ethereumjs-account": "~2.0.4", "ethereumjs-account": "~2.0.4",
"ethereumjs-tx": "^1.2.2", "ethereumjs-tx": "^1.2.2",
"ethereumjs-util": "^5.0.1", "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", "merkle-patricia-tree": "~2.1.2",
"mocha": "^3.1.0", "mocha": "^3.1.0",
"solc": "0.4.17",
"request": "^2.81.0", "request": "^2.81.0",
"solc": "0.4.17",
"truffle": "4.0.0-beta.2" "truffle": "4.0.0-beta.2"
} }
} }

@ -1,4 +1,5 @@
pragma experimental "v0.5.0"; //pragma experimental "v0.5.0";
pragma solidity ^0.4.17;
contract PureView { contract PureView {

@ -1,4 +1,5 @@
pragma experimental "v0.5.0"; //pragma experimental "v0.5.0";
pragma solidity ^0.4.17;
import "./../assets/PureView.sol"; import "./../assets/PureView.sol";

Loading…
Cancel
Save