Skip to content

[#139] Fix storage size computation and fee calculation in morley-client

Description

Problem: When we originate new contract or perform transfer to the implicit contract which is unknown for the chain, it's required to add 257 bytes for each new address. However, we don't do such thing, thus some of our nettest scenarios fail.

Solution: Unconditionally add 257 bytes to storage limit for contract origination. run_operation RPC output for transaction has allocated_destination_contract field that states whether contract receiver was allocated. So in order to correctly calculate storage limit for transaction, we simply count all newly allocated contract and add 257 bytes to storage limit for each.

Apart from that, fixed always zero initial balance when originating via morley-client.

Also, morley-nettest now has only one test-suite morley-nettest-nettest. Both pure and real-chain nettest scenarios are run in it.

Also, added preapply step to the transaction sending, thus test-suites doesn't end up with success in case some of the operations were backtracked.

Also, fee calculation logic was changed. Now fees are calculated using dry-run tezos-client calls. Tests are coming soon.

Related issue(s)

Resolves #139 (closed)

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:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Roman Melnikov

Merge request reports