Skip to content

[#141] Add storage printing to ContractRegistry

Ivan Gromakovskii requested to merge gromak/#141-container-registry into master

Description

Problem: apart from printing a contract and its documentation we usually need its storage for origination. It's common for (nearly) all contracts, but this functionality is not present in ContractRegistry.

Solution: add a new PrintStorage action there. ContractInfo now specifies how to construct its storage inside command line options parser. It is optional and can be omitted if you think that initial storage is easy to construct manually. Unfortunately, we need a different CLI for this functionality because parsing of initial storage data depends on its name and Parser is not a monad. So we have one storage-NAME command for each contract called NAME. Additionally, we add runContractRegistry function which captures storage printing logic along with handling of all other existing actions.

We also update morley-ledgers and morley-multisig. Updating morley-multisig require adding ciCompilationOptions.

Also I have updated the way output is chosen, now we construct output file name from contract name by default.

Related issue(s)

Resolves #141 (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 Ivan Gromakovskii

Merge request reports