[#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
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.