Skip to content

[#171] Unify aeson instances generation and drop aeson-options

Ivan Gromakovskii requested to merge gromak/#171-drop-aeson-options into master

Description

Problem: In many cases we use aeson's defaultOptions, in one place we use defaultOptions from aeson-options.

  1. It seems better to use consistent options unless there is a good reason to use something different somewhere (currently there are no such reasons).
  2. aeson's defaultOptions is not quite good for us because usually our record fields have prefixes derived from their names which are quite redundant in JSON.

Solution:

  1. Define morleyAesonOptions based on aeson-casing. It drops prefix from record fields. Use it everywhere.
  2. Remove aeson-options since it's not used anymore.
  3. Update manually defined JSON encoding of ContractState to drop prefixes.

Related issue(s)

Resolves #171 (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