This repository was archived by the owner on Aug 2, 2022. It is now read-only.
Replace the use of "Proxy" in ripemd.js to make eosjs compatible to IE11#411
Merged
c0d3ster merged 1 commit intoEOSIO:masterfrom Nov 1, 2018
Merged
Conversation
…ion instead of a Proxy. Access it by calling the function directly.
Contributor
c0d3ster
approved these changes
Oct 25, 2018
Contributor
c0d3ster
left a comment
There was a problem hiding this comment.
Nice work! We were discussing this the other day actually. It looks good to me, but I'd give @tbfleming a chance to look it over before merging
tbfleming
approved these changes
Oct 26, 2018
Contributor
tbfleming
left a comment
There was a problem hiding this comment.
Passes abieos tests, which checks key conversions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@tbfleming @chris-allnutt
Please refer this pull request to EOSIO/eosjs2#76
I am proposing the fix here since we have migrated eosjs2 to this repo.
Background:
While calculating the RIPEMD160 hash with
ripemd.jsin eosjs,Proxyis used during the calculation.Proxyis not supported in IE11 hence eosjs did not work in IE11.https://github.com/EOSIO/eosjs/blob/master/src/ripemd.js#L382
https://github.com/EOSIO/eosjs/blob/master/src/ripemd.es5.js#L331
Fix:
Replace the way to access the DataView object with an anonymous function instead of a Proxy. Access it by calling the function directly.
Test:
I have put about 10 input cases for the fixed ripemd160 hash function and the result values are same as the original.
I have included the fix locally for the simple-boilerplate-dapp and the game Elemental Battles. After the fix, both dapps works fine in IE11 now and also works fine in other browsers.
Remark:
Although only
ripemd.es5.jswill be built to the/distfolder, I have done the fix onripemd.jsfirst and use babel to compile it intoripemd.es5.js. This pull request include fixes for both JS files.cc @jeffreyssmith2nd @chris-allnutt @rickykung @andriantolie