Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes ethereumjs-util and keccak dependencies. #357

Merged
merged 1 commit into from
Jul 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions downloadCurrentVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var pkg = require('./package.json');
var fs = require('fs');
var https = require('https');
var MemoryStream = require('memorystream');
var ethJSUtil = require('ethereumjs-util');
var keccak256 = require('js-sha3').keccak256;

function getVersionList (cb) {
console.log('Retrieving available version list...');
Expand Down Expand Up @@ -48,7 +48,7 @@ function downloadBinary (outputName, version, expectedHash) {
response.pipe(file);
file.on('finish', function () {
file.close(function () {
var hash = '0x' + ethJSUtil.sha3(fs.readFileSync(outputName, { encoding: 'binary' })).toString('hex');
var hash = '0x' + keccak256(fs.readFileSync(outputName, { encoding: 'binary' }));
if (expectedHash !== hash) {
console.log('Hash mismatch: ' + expectedHash + ' vs ' + hash);
process.exit(1);
Expand Down
8 changes: 2 additions & 6 deletions linker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
var keccak = require('keccak');

function keccak256 (input) {
return keccak('keccak256').update(input).digest();
}
var keccak256 = require('js-sha3').keccak256;

function libraryHashPlaceholder (input) {
return '$' + keccak256(input).toString('hex').slice(0, 34) + '$';
return '$' + keccak256(input).slice(0, 34) + '$';
}

var linkBytecode = function (bytecode, libraries) {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,15 @@
"dependencies": {
"command-exists": "^1.2.8",
"fs-extra": "^0.30.0",
"keccak": "^1.0.2",
"memorystream": "^0.3.1",
"require-from-string": "^2.0.0",
"semver": "^5.5.0",
"js-sha3": "0.8.0",
"tmp": "0.0.33",
"yargs": "^11.0.0"
},
"devDependencies": {
"coveralls": "^3.0.0",
"ethereumjs-util": "^5.2.0",
"istanbul": "^0.4.5",
"semistandard": "^12.0.0",
"tape": "=4.9.2",
Expand Down