Skip to content

Commit 0a021cf

Browse files
committed
Insert reportedVersion in list.json
1 parent 1928f10 commit 0a021cf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"devDependencies": {
1010
"ethereumjs-util": "^5.0.1",
11+
"solc": "^0.4.24",
1112
"standard": "^8.4.0",
1213
"swarmhash": "^0.1.0"
1314
},

update

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const path = require('path')
77
const semver = require('semver')
88
const ethUtil = require('ethereumjs-util')
99
const swarmhash = require('swarmhash')
10+
const solc = require('solc/wrapper')
1011

1112
// This script updates the index files list.js and list.txt in the bin directory,
1213
// as well as the soljson-latest.js files.
@@ -33,6 +34,10 @@ dirs.forEach(function (dir) {
3334
return fs.readFileSync(path.join(__dirname, dir, file))
3435
}
3536

37+
function readBuiltinVersion (file) {
38+
return solc(require(path.join(__dirname, '/bin', file))).version()
39+
}
40+
3641
// ascending list (oldest version first)
3742
const parsedList = files
3843
.map(function (file) { return file.match(/^soljson-v([0-9.]*)(-([^+]*))?(\+(.*))?.js$/) })
@@ -41,6 +46,7 @@ dirs.forEach(function (dir) {
4146
.map(function (pars) {
4247
console.log('Processing ' + pars.path)
4348
const fileContent = readFile(pars.path)
49+
pars.reportedVersion = readBuiltinVersion(pars.path)
4450
pars.longVersion = buildVersion(pars)
4551
pars.keccak256 = '0x' + ethUtil.sha3(fileContent).toString('hex')
4652
pars.urls = [ 'bzzr://' + swarmhash(fileContent).toString('hex') ]

0 commit comments

Comments
 (0)