'python list No displacement

I have a list

[{'sender': '0', 'recipient': '15839597-107f-4166-aff1-ac32d3794748', 'amount': 50}]

and call this list elsewhere for create sha256 but list item is displacement.

I want to sha256 from this list above and compare it with the previous hash. To do this, the items in both lists must be the same (sort order) but the received list will be moved when comparing

[{'amount': 50, 'recipient': '15839597-107f-4166-aff1-ac32d3794748', 'sender': '0'}]

for save items use

self.trxs = []
self.trxs.append({'sender':sender, 'recipient':recipient, 'amount':amount})

how i can fixed list items?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source