Skip to content

Testing framework: add `Test.get_time` to discover current time

E. Rivas requested to merge er433/test/time-helper into dev

Motivation and Context

The usage of Tezos.get_now in the testing framework to get current time (in meta-LIGO) is problematic as it can be confused with obj-LIGO Tezos.get_now (and eventually stop working/change behaviour).

Description

This MR adds a new function in Test to get current time.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (non-breaking change that improves performance)
  • None (change with no changelog)

Changelog

New function in Test module:

val get_time : unit -> timestamp

It returns the current timestamp in the context of tests (similar to Tezos.get_now in contracts).

Checklist:

  • Changes follow the existing coding style (use dune @fmt to check).
  • Tests for the changes have been added (for bug fixes / feature).
  • Documentation has been updated.
  • Changelog description has been added (if appropriate).
  • Examples in changed behaviour have been added to the changelog (for breaking change / feature).
Edited by E. Rivas

Merge request reports

Loading