Right now address JSON generation is not deterministic. The two potential sources of non-determinism are:
Order of properties in objects — this is taken care of eslint (properties are order alphabetically)
Order of items in the array — this is actually not deterministic right now.
This doesn't affect the users of the package, but it does affect the development process: every time we generate addresses they may end up in different order and it's hard to tell if the content has changed (a big deal) or only the order (not a big deal).
This PR adds simple sorting so that every time addresses are generated they are generated deterministically.
I considered using canonical JSON libs instead, but they (understandably) don't sort arrays, because in arrays order is important.
Right now address JSON generation is not deterministic. The two potential sources of non-determinism are:
This doesn't affect the users of the package, but it does affect the development process: every time we generate addresses they may end up in different order and it's hard to tell if the content has changed (a big deal) or only the order (not a big deal).
This PR adds simple sorting so that every time addresses are generated they are generated deterministically.
I considered using canonical JSON libs instead, but they (understandably) don't sort arrays, because in arrays order is important.