ipld / js-ipld-ethereum

JavaScript Implementation of All Ethereum IPLD formats
MIT License
40 stars 11 forks source link

fix: sorting function needs to return an integer #36

Closed vmx closed 6 years ago

vmx commented 6 years ago

The sorting function was returning a boolean, which is wrong. For proper comparison it needs to return an integer.

Intrestingly enough, this issue only surfaced in the Browser test run on Windows. There somehow the sorting function of a two element array gets the second element first, then the second element.

achingbrain commented 6 years ago

Looks good. Is it covered by any tests?

vmx commented 6 years ago

Yes, it was triggered by failing tests, examples are https://github.com/ipld/js-ipld/issues/172 and https://ci.ipfs.team/blue/organizations/jenkins/IPLD%2Fjs-ipld-ethereum/detail/PR-35/2/tests. Those now pass.

vmx commented 6 years ago

I take @achingbrain as an "approved", hence merge this change.