Skip to content

[#351] [#53] Add `getNow` and `advanceTime` to Morley.Nettest

Diogo Castro requested to merge diogo/#351-advanceTime-emu into master

Description

Problem: sometimes, we might want to test scenarios where we need to advance time by some given number of seconds.

We've needed this in stablecoin and tezos-nbit before, and we're seeing the need for this again in BaseDAO.

https://github.com/tqtezos/stablecoin/blob/master/haskell/test/Lorentz/Contracts/Test/Permit.hs#L151-L160

Additionally, in tezos-nbit we've also needed to know what the current time is. In Integrational, we can just use dummyNow, but there's no way to do this in Morley.Nettest at the moment.

Solution: Add getNow and advanceTime to Morley.Nettest.

Related issue(s)

Resolves #351 (closed) Resolves part of #53 (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 Diogo Castro

Merge request reports