[#512] Nested storage access
Problem: storage field and submap accessors have a big limitation - that accessing deeply nested entries requires creating special shortcut instances, one per entry.
Solution: allow passing not only string labels, but also more complex references to methods working with fields and submaps; implement nested entries access and other convenient things.
Now it is possible to write
stGetField (#substore . #field).
StoreHasEntrypoint typeclass intact because it has to work with textual labels - entrypoints are stored under strings in map.
I tried to do this with as few breaking changes as possible.
The most controversial commit is the one about
StoreHasSubmap instance (one of the latest commits), but it breaks the code in a way that makes you mostly only remove the code, so I hope this is fine.
To do when we use the recent Morley release in existing projects:
- Try this on indigo
- Try this on morley-upgradeable
- Try this on some relatively large contract (morley-ledger's contracts)
✅ Checklist for your Merge Request
Related changes (conditional)
Tests (see short guidelines)
- If I added new functionality, I added tests covering it.
- If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.