Skip to content

[TM-282] Cleanup StoreClass a bit

Ivan Gromakovskii requested to merge gromak/tm282-cleanup-store-class into master

Description

Problem:

  1. First of all, StoreClass has an obsolete statement that top-level storage is a pair of big_map and other fields. This restriction has been removed.
  2. store*OpsTopLevelStorage kinda suggests that it should only be used for top-level storage, but I think I encountered a valid use-case when it is used for something else. Imagine you have Storage which has A inside and it has some big_map. It makes sense to use this store*OpsTopLevelStorage logic to define StoreHasSubmap for A, but A is not top-level storage. Same would happen for field if A contained B which in turned contained some useful field.
  3. composeStoreFieldOps is exported, but composeStoreSubmapOps. I think there is no reason for inconsistency, especially now that big_maps can appear everywhere.

Solution:

  1. Update obsolete comments.
  2. Rename *TopLevelStorage to *Deeper.
  3. Export composeStoreSubmapOps as well.

Related issue(s)

https://issues.serokell.io/issue/TM-282

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.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:

Stylistic guide (mandatory)

Edited by Ivan Gromakovskii

Merge request reports