Fix method sort ordering logic

in #utopian-io7 years ago (edited)

The Remix web-based IDE for Solidity smart contract development has in its sidebar a listing of the various functions a deployed contract has that can be called. However, the way that the methods were being sorted wasn't having the desired effect. The intent of the code seemed to be that the "constant" functions (ones that don't mutate state) be listed first, followed by the other functions, and sorted by name within those groupings. But due to the manner in which the Javascript sort functions were called, the one sort was clobbering the effect of the other, leading to the functions sorted by "constant first", but not by name within the groupings.

I fixed the issue in pull request #696, combining the logic of the two "sort" functions into one, creating the desired effect, and making it easier for developers to find the function needed in the listing of all functions for the contract.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it is very small contribution in terms of code, this type of posts may be accepted in future once we have a quality slider but owing to the high reward, I cannot accept it now.

You can contact us on Discord.
[utopian-moderator]