|
|
|
@ -8,6 +8,7 @@ const istanbul = require('istanbul'); |
|
|
|
|
const getInstrumentedVersion = require('./instrumentSolidity.js'); |
|
|
|
|
const CoverageMap = require('./coverageMap.js'); |
|
|
|
|
const defaultTruffleConfig = require('./truffleConfig.js'); |
|
|
|
|
const preprocessor = require('./preprocessor'); |
|
|
|
|
|
|
|
|
|
const isWin = /^win/.test(process.platform); |
|
|
|
|
|
|
|
|
@ -284,16 +285,11 @@ 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, ' '); |
|
|
|
|
contract = preprocessor.run(contract); |
|
|
|
|
fs.writeFileSync(contractPath, contract); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|