Skip to content

[#728] Access MorleyClientEnv in network tests

Description

Problem: we sometimes need to access MorleyClientEnv in cleveland network tests. However, due to locking, we can't.

Solution: Introduce NetworkCaps that carries NetworkEnv and related instances/synonyms. Replace ScenarioCleveland with ScenarioNetwork. Reimplement scenario as a typeclass function lifting the corresponding ClevelandT into the appropriate monad. Add some convenience synonyms to avoid the typeclass constraint proliferation. Finally, instead of carrying Maybe EmulatedImpl in misc caps, carry Either EmulatedImpl NetworkEnv, so that ifEmulation can access NetworkEnv as well.

Related issue(s)

Resolves #728 (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 Nikolay Yakimov

Merge request reports