Skip to content

[#708] Add ability to call on-chain views directly

Description

Problem: we want to call views from cleveland tests

Solution: high-level idea is to use runCode to call a view.

Turns out runCode didn't work with failure predicates on network (but did on emulator), so had to fix that, too.

This includes checked and unchecked versions of view calls. The reason for the unchecked version is we want to still allow it to work with untyped contracts, or perhaps we want to ignore typing information (e.g. because an imported contract doesn't have views declared on the type level).

Related issue(s)

Resolves #708 (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)

Merge request reports