Skip to content

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

Merged
merged 3 commits into from
Oct 12, 2018
Merged

Support linking via hash. #266

merged 3 commits into from
Oct 12, 2018

Conversation

chriseth
Copy link
Contributor

@chriseth chriseth commented Oct 4, 2018

@coveralls
Copy link

coveralls commented Oct 4, 2018

Coverage Status

Coverage increased (+0.7%) to 60.398% when pulling 4ea94fb on linkViaHash into 5b7cdba on master.

linker.js Outdated
@@ -1,3 +1,5 @@
var sha3 = require('crypto-js/sha3');
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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());
Copy link
Member

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) {
Copy link
Member

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?

@chriseth chriseth force-pushed the linkViaHash branch 2 times, most recently from a6768c8 to e73312c Compare October 11, 2018 12:24
@chriseth chriseth merged commit 5f7375f into master Oct 12, 2018
@axic axic removed the in progress label Oct 12, 2018
@axic axic deleted the linkViaHash branch October 30, 2018 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants