baking-bad / pytezos

🐍 Python SDK for Tezos | Michelson VM in Python
https://pytezos.org
MIT License
112 stars 38 forks source link

Big maps don't support records as keys due to `unhashable type: dict` #280

Closed konchunas closed 2 years ago

konchunas commented 2 years ago

Sum types are stored as dicts in the interpreter code and it seem they cannot be hashed to be used as big_map keys. This scenario works perfectly fine in the real Tezos node though.

When storage is converted to Python representation I always get the following exception: pytezos.michelson.micheline.MichelsonRuntimeError: ('storage', 'big_map', 'map', "unhashable type: 'dict'")

Here is a little sample to demonstrate this: https://github.com/konchunas/pytezos-record-as-map-key-bug