Skip to content

[TM-304] Add polymorphic methods to work w/ storages

Konstantin Ivanov requested to merge martoon/tm302-poly-storage into master

Description

Problem: we are going to reuse some contract pieces, but different contracts take significantly different approaches, and this includes chosen storage type.

Solution: add methods which work for all our storage types.

This MR slightly downgrades the performance of complex operations, e.g. stDelete implementation via stUpdate will be less efficient than specific implementation ustoreDelete, and not sure that our optimizer will be able to neglect the difference in this case in the nearest future; if we any care I can fix that now.

Related issue(s)

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

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it I'm not sure whether tests are required here, quite complex scenario of storage structure is already covered by tests for ManagedLedger.
    • 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 Konstantin Ivanov

Merge request reports