-
Notifications
You must be signed in to change notification settings - Fork 491
Support linking via hash. #266
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
Conversation
linker.js
Outdated
@@ -1,3 +1,5 @@ | |||
var sha3 = require('crypto-js/sha3'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use ethereumjs-util
, which is already in package.json
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ethereumjs-util only is a dev dependency, but I think this here needs to be an actual dependency. I want to avoid pulling in all of ethereumjs-util into the dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it should use keccak.js
(or whatever ethereumjs-util
is using). crypto-js/sha3
isn't the best library.
linker.js
Outdated
}; | ||
|
||
replace(libraryName); | ||
replace(sha3(libraryName, {outputLength: 256}).toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add comments to these two.
test/linker.js
Outdated
@@ -82,3 +82,19 @@ tape('Link references', function (t) { | |||
st.end(); | |||
}); | |||
}); | |||
|
|||
tape('Linker via hash', function (t) { | |||
t.test('Non-hashed placeholder', function (st) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicated test?
a6768c8
to
e73312c
Compare
Required by ethereum/solidity#5145