Fix method sort ordering logic

in utopian-io •  9 months ago

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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

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]