[TM-304] Add polymorphic methods to work w/ storages
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 itI'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
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.
Edited by Konstantin Ivanov