midnight avatar

Fix method sort ordering logic

midnight426

Published: 27 Feb 2018 › Updated: 27 Feb 2018Fix method sort ordering logic

Fix method sort ordering logic

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

Leave Fix method sort ordering logic to:

Written by

Read more #utopian-io posts


Best Posts From midnight

We have not curated any of midnight426's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From midnight