Skip to content

[TM-246] Upgradable parameter

Konstantin Ivanov requested to merge martoon/tm246-uparam into master

Description

Problem: we need an easily extensible parameter for contract, current solution with IsoValue and unions does not help here.

Solution: represent parameters as (MText, ByteString) pair, where the first argument is entry point name and the second one is serialized argument for it.

I do not use Generic magic here because, like, there is no any reason to use it here. Traversing a linear Rec is way simplier, produces less boilerplate and easier to generalize.

Here I provide slightly different interface comparing to one expected in TM-190 prototype. In particular, I aimed on making sure that no entry point handler is lost, neither fallback handler is forgotten.

Related issue(s)

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

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