Open theoreticalbts opened 6 years ago
@theoreticalbts what is the expectation of steemd for ordering of objects in maps?
we shouldn't change the implementation to make a test pass unless the change is actually required by the protocol. I'll rewrite the test in such a way that it passes without changing the behavior of the system.
what is the expectation of steemd for ordering of objects in maps?
It serializes in the same order as iteration, which for map
and flat_map
is sorted order of keys. The deserializer does not currently check the order.
Dictionary iteration order is undefined and (in CPython) varies from run to run, causing
test_map()
to sometimes fail.map()
should allowcollections.OrderedDict()
test_map()
should usecollections.OrderedDict()
for predictable iteration order