Skip to content

[#139] Use a hackier way to compute storage size in client

Ivan Gromakovskii requested to merge gromak/hack-storage-size-computation into master

Description

Problem: currently morley-client computes storage size incorrectly. If there are multiple transactions and at least one of them targets an implicit account it will compute arStorageSize as Nothing and eventually we will assume that storage limit is 257 (and add 20 for safety). But the real storage size consumption can be much greater because for example a transfer to a smart contract can be involved.

Solution: compute arStorageSize pessimistically and treat each Nothing as 257. We may set higher limit than necessary, but normally it shouldn't be a problem, especially given that we are currently using this code only for testing. Storage limit is only a safety measure. A better solution is postponed and will be handled in #139 (closed). At this point I need a hotfix for another project.

Related issue(s)

Relates to #139 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it ← no, it's a hack anyway.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again ← no, it's a hack anyway.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Merge request reports