chore: sort token list #184
Merged
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.
Summary
Sorting token list on addition/update by chainId, then address
Also sorting the current list by the above rules
Why?
Because adding always to the bottom of the list creates merge conflicts for sequential PRs.
This change is a low effort fix that makes less likely to have conflicts in the same areas of the file.
This in turn should make the review/merge process simpler.
Testing
Tested it locally by running
LIST_PATH=src/public/CowSwap.json python3 src/scripts/workflow_helper.py addToken data.jsonThe sorted list is the result of this change, minus the new token being added which I manually removed.
The list should still work when added to CoW Swap. Use this url to try it out https://raw.githubusercontent.com/cowprotocol/token-lists/9fd4fc4b83668115d58f7622998635825289eea6/src/public/CowSwap.json