bismuthfoundation / masternodes

[Deprecated] Bismuth Masternodes
GNU General Public License v3.0
4 stars 2 forks source link

Consider using `sort_keys=True` for replicability in JSON #2

Open Aareon opened 6 years ago

Aareon commented 6 years ago

https://github.com/bismuthfoundation/masternodes/blob/eecc38559d471ee4a4011a59d576948119dad8d1/modules/poscrypto.py#L208

hclivess commented 6 years ago

Hi, which JSON? Default implementation of JSON does not support unsorted keys?

Aareon commented 6 years ago

@hclivess right now the current usage creates an unsorted string containing the JSON. With sort_keys enabled, the JSON will be sorted alphabetically by key. This is generally preferred as unsorted JSON doesn't work well in cryptocurrency. In this case, it may work fine, but as a future note, I would suggest sorting keys.