Generate storage annotations from Lorentz code
Clarification and motivation
When we turn Lorentz code to Michelson, storage always has no annotations (fcStoreNotes = starNotes
). However, we'd like it to have some annotations for clarity, because otherwise it's hard to understand what is stored in the storage (which field means what) when you open it in block explorer or vanilla Tezos CLI.
Acceptance criteria
Come up with some reasonable way to generate annotations from Lorentz code and implement it. I think we need something similar to what we do for parameter. However, storage is usually a product type while parameter is a sum type. If storage is
data Storage = Storage
{ ledger :: BigMap Address Natural
, totalSupply :: Natural
}
It should be a pair where types have %ledger
and %totalSupply
field annotations. If something is wrapped into Named
, it should have corresponding type annotation (like we do for parameters). Special care should be taken when storage has some non-atomic data type, we should go deeper in this case (again see how it's done for parameter).