Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix gnolang#817 There was actually 2 bugs in the code responsible for loading a map from the state: - `UnmarshalAmino` doesn't check that `ml.Tail` is nil before accessing it. It is correctly done for instance in `MapList.Append` for instance. The fix just ensures that `ml.Tail` is not nil. - `fillTypesOfValue` which is called just after the store data is unmarshalSized, resets the map data by calling `MapValue.MakeMap()`. So at the end the map is always empty, whatever was stored before the transaction. The fix replaces the call of `MakeMap` to a simple map creation. This has to be confirmed, but this change may also fix gnolang#311, because I'm not convinced that the indetermenistic behavior of the golang map can be a problem when saved to the store. Indeed, a gno map is serialized with the help of a slice, which should remove any indetermenistic problem.
- Loading branch information